diff --git a/.github/workflows/ci-macos-compat.yml b/.github/workflows/ci-macos-compat.yml index 96c3ba2ff86..43285cffd18 100644 --- a/.github/workflows/ci-macos-compat.yml +++ b/.github/workflows/ci-macos-compat.yml @@ -43,7 +43,7 @@ jobs: BASE_SHA="${{ github.event.pull_request.base.sha }}" HEAD_SHA="${{ github.event.pull_request.head.sha }}" - git fetch --no-tags --depth=1 origin "${BASE_SHA}" "${HEAD_SHA}" + git fetch --no-tags origin "${BASE_SHA}" "${HEAD_SHA}" CHANGED_FILES="$(git diff --name-only "${BASE_SHA}...${HEAD_SHA}")" RUN_COMPAT_TESTS=false if [[ -z "${CHANGED_FILES}" ]]; then @@ -203,7 +203,7 @@ jobs: - name: Run unit tests env: PROGRAMA_SKIP_ZIG_BUILD: ${{ matrix.skip_zig && '1' || '0' }} - PROGRAMA_UNIT_TEST_SCOPE: split-stateful + PROGRAMA_UNIT_TEST_SCOPE: serial run: | ./scripts/ci-run-unit-tests.sh diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2dc43cbcd88..f3636e6ecd5 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -66,7 +66,7 @@ jobs: BASE_SHA="${{ github.event.pull_request.base.sha }}" HEAD_SHA="${{ github.event.pull_request.head.sha }}" - git fetch --no-tags --depth=1 origin "${BASE_SHA}" "${HEAD_SHA}" + git fetch --no-tags origin "${BASE_SHA}" "${HEAD_SHA}" CHANGED_FILES="$(git diff --name-only "${BASE_SHA}...${HEAD_SHA}")" RUN_APP_JOBS=false RUN_REMOTE_DAEMON_JOBS=false @@ -300,7 +300,7 @@ jobs: - name: Run unit tests env: - PROGRAMA_UNIT_TEST_SCOPE: split-stateful + PROGRAMA_UNIT_TEST_SCOPE: serial run: ./scripts/ci-run-unit-tests.sh - name: Run bundled Ghostty theme picker helper regression diff --git a/scripts/ci-run-unit-tests.sh b/scripts/ci-run-unit-tests.sh index 83056107c5c..cee891db623 100755 --- a/scripts/ci-run-unit-tests.sh +++ b/scripts/ci-run-unit-tests.sh @@ -76,15 +76,16 @@ run_unit_tests_with_retry() { run_suite() { local mode="${1:-serial}" local label="${2:-Unit tests}" + local exit_code=0 - if run_unit_tests_with_retry "$mode"; then - return 0 - fi + # Capture the status directly; `$?` after a branchless `if` is always 0, + # which silently turned test failures into successes. + run_unit_tests_with_retry "$mode" || exit_code=$? - local exit_code=$? - # run_unit_tests_with_retry failures can carry non-zero statuses; keep that signal. - echo "${label} failed with exit code $exit_code" - exit "$exit_code" + if [[ "$exit_code" -ne 0 ]]; then + echo "${label} failed with exit code $exit_code" + exit "$exit_code" + fi } if [[ "$TEST_SCOPE" == "split-stateful" ]]; then diff --git a/tests/test_ci_unit_test_runner_behavior.sh b/tests/test_ci_unit_test_runner_behavior.sh index 2cd959a0c61..62eb8babdaf 100755 --- a/tests/test_ci_unit_test_runner_behavior.sh +++ b/tests/test_ci_unit_test_runner_behavior.sh @@ -33,8 +33,9 @@ log_call() { case "${TEST_SCENARIO:?}" in split-stateful) - log_call "$0 -skip-testing:${STATEFUL_TEST_CLASS} -parallel-testing-enabled YES" - log_call "$0 -only-testing:${STATEFUL_TEST_CLASS} -skip-testing:${STATEFUL_TEST_SKIP} -parallel-testing-enabled NO" + # Log the arguments the runner actually passed; the runner is expected to + # invoke xcodebuild once per pass (parallel, then stateful). + log_call "$0 $*" echo "Test Suite 'All tests' passed" exit 0 ;;