-
Notifications
You must be signed in to change notification settings - Fork 2.8k
test/buildah-bud: fix checkout to also handle go.mod replace #26784
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
test/buildah-bud: fix checkout to also handle go.mod replace #26784
Conversation
There is a rather surprising bug in the current test checkout logic. The go.mod version parsing never actually consider a go.mod replace for buildah and always read the main version. This meant a buildah replace actually is testing the old version with the new code and that means the new tests are not run leading people in false belive when testing a buildah vendor that it worked. But then later it fails when doing the proper update without replace. To fix this first use go list to parse go.mod which is more robust. Then first check if there is a replace and then use that repo/version instead. Signed-off-by: Paul Holzinger <[email protected]>
8384d6a
to
d48c724
Compare
Ok this works when vendoring a commit from my fork
Dropping the vendor test commit so we can merge this. |
d48c724
to
9b62438
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: Honny1, Luap99 The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
LGTM |
/lgtm |
There is a rather surprising bug in the current test checkout logic. The
go.mod version parsing never actually consider a go.mod replace for
buildah and always read the main version.
This meant a buildah replace actually is testing the old version with
the new code and that means the new tests are not run leading people in
false belive when testing a buildah vendor that it worked. But then
later it fails when doing the proper update without replace.
To fix this first use go list to parse go.mod which is more robust. Then
first check if there is a replace and then use that repo/version
instead.
Does this PR introduce a user-facing change?