Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add .bin to integration test PATH. #2

Closed
wants to merge 1 commit into from

Conversation

robdimsdale
Copy link
Member

  • Without this, we actually use the system CF CLI which may be a different version than we expect.

- Without this, we actually use the system CF CLI which may be a different version than we expect.
@robdimsdale
Copy link
Member Author

Hmm, actually it seems like direnv / .envrc solves this issue locally (my issues were that I was cloning the repo for the first time).

I'll check if direnv also runs in CI, and if so this PR can be deleted.

@robdimsdale
Copy link
Member Author

robdimsdale commented Oct 1, 2021

@ryanmoran I can't see anywhere in the Dockerfile or any task executable in https://github.com/cloudfoundry/buildpacks-ci where we set the PATH to include the cf binary that each buildpack installs. This happens with direnv via .envrc but I don't see that being executed in CI.

Am I missing something?

For context, the reason for doing this is I want to start the process of updating the CF CLI in each buildpack's integration tests to v7, but I'd rather do this change for one buildpack at a time. Therefore we need to respect the version of cf that each buildpack installs, rather than relying on the system CLI.

@sophiewigmore
Copy link
Member

sophiewigmore commented Oct 11, 2021

@robdimsdale I might be wrong but I noticed that in the buildpack.yml.erb template for buildpacks-ci, we run a task called update-libbuildpack. This task runs source .envrc in the buildpack directory. The task output is the buildpack, and it's used as an input for our tests so I'm assuming that's where it gets run.

@robdimsdale
Copy link
Member Author

Thanks for pointing that out. It's a little hard to tell from the pipeline templates, but it looks like the update-libbuildpack task is the only place we source .envrc. At least, that's the only reference I can find when I search this repo.

It looks like that task is skipping the integration tests (and brats) - and the intention of this PR is to ensure that we use the CF CLI that we install during the integration tests.

Please let me know if I'm missing something though! Also, I'm 100% open to modifying this PR to source .envrc instead of explicitly setting the PATH.

@ryanmoran
Copy link
Contributor

ryanmoran commented Oct 11, 2021

Is this not covered by this?

function util::tools::path::export() {
local dir
dir="${1}"
if ! echo "${PATH}" | grep -q "${dir}"; then
PATH="${dir}:$PATH"
export PATH
fi
}

That is called when the ./scripts/integration.sh invokes the util::tools::cf::install helper function:

util::tools::path::export "${dir}"

@robdimsdale
Copy link
Member Author

Great. I think that was what I was looking for. I'll close this PR and open another with my follow-on questions.

@ryanmoran ryanmoran deleted the ensure-bin-path-integration-test branch August 23, 2022 16:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants