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

refactor phase/generator_test.go #1301

Merged

Conversation

phil9909
Copy link
Contributor

Summary

Refactor phase/generator_test.go as suggested in #1276 (comment).
Related PR #1297

Context

In #1276 we duplicated some of the test code in phase/generator_test.go, basically doing the same tests twice, once for Platform API 0.12 and once for 0.13. The API versions expect a different folder layout, which requires changes to the test setup and assertions. The reduce the size of phase/generator_test.go, we:

  • added a loop around the test cases looping over API versions.
  • for API version >= 0.13 skip the copy tests
  • added some platformAPI.AtLeast("0.13") switches where file paths are different

Now we have every tests only once in code, while still being executed twice (even the ones that we previously only had for platform API 0.12).

CC @natalieparellano

@phil9909 phil9909 requested a review from a team as a code owner February 20, 2024 10:04
Signed-off-by: Philipp Stehle <philipp.stehle@sap.com>
Signed-off-by: Johannes Dillmann <j.dillmann@sap.com>
Co-authored-by: Philipp Stehle <philipp.stehle@sap.com>
Copy link
Member

@natalieparellano natalieparellano left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@phil9909 thank you for this! This should make the tests a lot easier to maintain going forward :)

@natalieparellano natalieparellano merged commit 41d885b into buildpacks:main Mar 1, 2024
10 checks passed
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.

3 participants