From 9b62438edebf20305c67fb9967a7e73a80c39268 Mon Sep 17 00:00:00 2001 From: Paul Holzinger Date: Fri, 8 Aug 2025 12:06:29 +0200 Subject: [PATCH] test/buildah-bud: fix checkout to also handle go.mod replace 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 --- test/buildah-bud/run-buildah-bud-tests | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/test/buildah-bud/run-buildah-bud-tests b/test/buildah-bud/run-buildah-bud-tests index 30ca502d81..0438fa553b 100755 --- a/test/buildah-bud/run-buildah-bud-tests +++ b/test/buildah-bud/run-buildah-bud-tests @@ -89,8 +89,20 @@ function die() { failhint= trap 'if [[ $? != 0 ]]; then if [[ -n $failhint ]]; then echo;echo "***************************************";echo "$failhint";echo;echo "Please see $BUD_TEST_DIR_REL/README.md for advice";fi;fi' 0 -# Find the version of buildah we've vendored in, so we can run the right tests -buildah_version=$(awk "\$1 == \"$BUILDAH_REPO\" { print \$2 }" make-new-buildah-diffs chmod 755 make-new-buildah-diffs