diff --git a/src/tools/xce-build.sh b/src/tools/xce-build.sh index 9b5dffca..4ed966ec 100755 --- a/src/tools/xce-build.sh +++ b/src/tools/xce-build.sh @@ -387,7 +387,13 @@ case "$COMPONENT" in meson compile -C "$BUILD_DIR" "${MESON_COMPILE_JOB_OPTS[@]}" apiserver xcecli if [ "$RUN_TESTS" = 1 ]; then echo "=== Running frontend Go unit tests ===" - cd frontend/apiserver && CGO_ENABLED=0 go test "${GO_TEST_JOB_OPTS[@]}" ./store/... ./utils/... ./controllers/... ./backend/... -count=1 && cd ../xcecli && CGO_ENABLED=0 go test "${GO_TEST_JOB_OPTS[@]}" ./... -count=1 + # bug-1895: one command per suite, each in a subshell. As a single + # `cd a && go test && cd ../b && go test` list, a failing apiserver + # `go test` only short-circuited the list -- set -e ignores every + # command of an && list but the last -- so the build reported + # success and skipped the xcecli tests. + (cd frontend/apiserver && CGO_ENABLED=0 go test "${GO_TEST_JOB_OPTS[@]}" ./store/... ./utils/... ./controllers/... ./backend/... -count=1) + (cd frontend/xcecli && CGO_ENABLED=0 go test "${GO_TEST_JOB_OPTS[@]}" ./... -count=1) fi ;; xcecli) @@ -396,7 +402,7 @@ case "$COMPONENT" in meson compile -C "$BUILD_DIR" "${MESON_COMPILE_JOB_OPTS[@]}" xcecli if [ "$RUN_TESTS" = 1 ]; then echo "=== Running xcecli Go unit tests ===" - cd frontend/xcecli && CGO_ENABLED=0 go test "${GO_TEST_JOB_OPTS[@]}" ./... -count=1 + (cd frontend/xcecli && CGO_ENABLED=0 go test "${GO_TEST_JOB_OPTS[@]}" ./... -count=1) fi ;; xceadmin) @@ -434,7 +440,13 @@ case "$COMPONENT" in echo "=== Running scheduler test (manual) ===" "./$BUILD_DIR/scheduler/testsuite/sched_test" echo "=== Running frontend Go unit tests ===" - cd frontend/apiserver && CGO_ENABLED=0 go test "${GO_TEST_JOB_OPTS[@]}" ./store/... ./utils/... ./controllers/... ./backend/... -count=1 && cd ../xcecli && CGO_ENABLED=0 go test "${GO_TEST_JOB_OPTS[@]}" ./... -count=1 + # bug-1895: one command per suite, each in a subshell. As a single + # `cd a && go test && cd ../b && go test` list, a failing apiserver + # `go test` only short-circuited the list -- set -e ignores every + # command of an && list but the last -- so the build reported + # success and skipped the xcecli tests. + (cd frontend/apiserver && CGO_ENABLED=0 go test "${GO_TEST_JOB_OPTS[@]}" ./store/... ./utils/... ./controllers/... ./backend/... -count=1) + (cd frontend/xcecli && CGO_ENABLED=0 go test "${GO_TEST_JOB_OPTS[@]}" ./... -count=1) fi ;; *)