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

Improve tests for buildpack env var handling #229

Merged
merged 1 commit into from
Jul 26, 2024
Merged

Conversation

edmorley
Copy link
Member

  • Shifts the testing of buildpack env vars handling slightly more towards integration tests rather than unit tests, since a big part of env var handling is ensuring the env is passed around correctly + aspects like the automatic env vars added by libcnb and lifecycle, which can only be properly tested via integration tests.
  • Adds more testing of broken user-provided env vars, by passing them in by default for all tests (instead of a single test), and by adding more broken env vars to the list.
  • In the unit tests, switches the example layer location to one that's more obviously an example path, to prevent anyone reading the tests from thinking that's the actual location set by the buildpack.

This change will help validate the env var handling remains consistent with the upcoming transition to libcnb.rs' struct layer API.

GUS-W-16261336.

@edmorley edmorley added the skip changelog Skip the check-changelog check label Jul 26, 2024
@edmorley edmorley self-assigned this Jul 26, 2024
* Shifts the testing of buildpack env vars handling slightly more
  towards integration tests rather than unit tests, since a big part of
  env var handling is ensuring the env is passed around correctly +
  aspects like the automatic env vars added by libcnb and lifecycle,
  which can only be properly tested via integration tests.
* Adds more testing of broken user-provided env vars, by passing
  them in by default for all tests (instead of a single test),
  and by adding more broken env vars to the list.
* In the unit tests, switches the example layer location to one that's
  more obviously an example path, to prevent anyone reading the
  tests from thinking that's the actual location set by the buildpack.

This change will help validate the env var handling remains consistent
with the upcoming transition to libcnb.rs' struct layer API.

GUS-W-16261336.
@edmorley edmorley force-pushed the cleanup-env-var-tests branch from 8944edd to 2187a90 Compare July 26, 2024 13:54
@edmorley edmorley marked this pull request as ready for review July 26, 2024 13:56
@edmorley edmorley requested a review from a team as a code owner July 26, 2024 13:56
@edmorley edmorley enabled auto-merge (squash) July 26, 2024 13:57
@edmorley edmorley merged commit 8f0aace into main Jul 26, 2024
7 checks passed
@edmorley edmorley deleted the cleanup-env-var-tests branch July 26, 2024 14:53
@edmorley edmorley added the internal Internal (non-user facing) buildpack changes label Aug 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
internal Internal (non-user facing) buildpack changes skip changelog Skip the check-changelog check
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants