@@ -7,15 +7,24 @@ go install sigs.k8s.io/controller-tools/cmd/
[email protected] >/dev/null
77go install k8s.io/code-generator/cmd/
[email protected] > /dev/null
88git fetch origin main --depth=1 || true
99
10- # 1) Compute base (robust to unrelated histories)
11- BASE=" $( git merge-base HEAD origin/main 2> /dev/null || true) "
12- if [ -z " ${BASE} " ]; then
13- echo " No merge-base with origin/main → running full set"
14- PKGS=" ./..."
15- E2E_OUT=" $( go run ./scripts/affected-packages.go -mode=suites -changed-files go.mod || true) "
10+ # 1) Determine changed files source: explicit args or git base diff
11+ if [ " $# " -gt 0 ]; then
12+ # Treat provided paths as changed files
13+ CHANGED_CSV=$( printf " %s," " $@ " | sed ' s/,$//' )
14+ echo " Simulating changes in: $CHANGED_CSV "
15+ PKGS=" $( go run ./scripts/affected-packages.go -changed-files " ${CHANGED_CSV} " ) "
16+ E2E_OUT=" $( go run ./scripts/affected-packages.go -mode=suites -changed-files " ${CHANGED_CSV} " ) "
1617else
17- PKGS=" $( go run ./scripts/affected-packages.go -base " ${BASE} " ) "
18- E2E_OUT=" $( go run ./scripts/affected-packages.go -mode=suites -base " ${BASE} " ) "
18+ # Compute base (robust to unrelated histories)
19+ BASE=" $( git merge-base HEAD origin/main 2> /dev/null || true) "
20+ if [ -z " ${BASE} " ]; then
21+ echo " No merge-base with origin/main → running full set"
22+ PKGS=" ./..."
23+ E2E_OUT=" $( go run ./scripts/affected-packages.go -mode=suites -changed-files go.mod || true) "
24+ else
25+ PKGS=" $( go run ./scripts/affected-packages.go -base " ${BASE} " ) "
26+ E2E_OUT=" $( go run ./scripts/affected-packages.go -mode=suites -base " ${BASE} " ) "
27+ fi
1928fi
2029
2130# 2) Print what will run
4150PRE=" $( echo " ${E2E_OUT} " | awk -F: ' $1=="preflight"{print $2}' | paste -sd' |' -) "
4251SB=" $( echo " ${E2E_OUT} " | awk -F: ' $1=="support-bundle"{print $2}' | paste -sd' |' -) "
4352
53+ # Use direct go test with the same build tags as the Makefile to avoid RUN quoting issues locally
54+ BUILD_TAGS=' netgo containers_image_ostree_stub exclude_graphdriver_devicemapper exclude_graphdriver_btrfs containers_image_openpgp'
55+
4456if [ -n " ${PRE} " ]; then
4557 echo " Running preflight e2e: ${PRE} "
46- RUN= " ^((${PRE} ))$ " make support-bundle-e2e-go-test
58+ go test -tags " ${BUILD_TAGS} " -installsuffix netgo -v -count=1 ./test/e2e/preflight -run " ^((" ${PRE} " )$) " || true
4759fi
4860if [ -n " ${SB} " ]; then
4961 echo " Running support-bundle e2e: ${SB} "
50- RUN= " ^((${SB} ))$ " make support-bundle-e2e-go-test
62+ go test -tags " ${BUILD_TAGS} " -installsuffix netgo -v -count=1 ./test/e2e/support-bundle -run " ^((" ${SB} " )$) " || true
5163fi
0 commit comments