Skip to content

Fix CI: unit-test failures reported green, change-detection dying on PRs#122

Open
arzafran wants to merge 3 commits into
mainfrom
fix/ci-guard-and-change-detection
Open

Fix CI: unit-test failures reported green, change-detection dying on PRs#122
arzafran wants to merge 3 commits into
mainfrom
fix/ci-guard-and-change-detection

Conversation

@arzafran

Copy link
Copy Markdown
Member

What this does

Main's CI is currently broken in two ways that this fixes. Unit test failures were being reported as passing, so a red suite could ship. And on every pull request, the new change-detection job crashed with 'no merge base', which made all the real jobs skip (first seen on #120).

Summary

  • scripts/ci-run-unit-tests.sh: run_suite read $? after a branchless if, which is always 0 — every XCTest failure exited 0. Now captures the status via || exit_code=$?.
  • tests/test_ci_unit_test_runner_behavior.sh: the xcodebuild stub's split-stateful case logged two fabricated call lines per invocation (4 total for the runner's 2 real passes). It now logs the actual arguments once per invocation, which the existing assertions check.
  • ci.yml + ci-macos-compat.yml change-detection: dropped --depth=1 from the base/head fetch — the shallow fetch grafted away parent history so git diff BASE...HEAD had no merge base. Checkout already uses fetch-depth: 0, so the plain fetch is effectively free.

Test Plan

  • ./tests/test_ci_unit_test_runner_behavior.sh passes locally (failed on main before)
  • Workflow YAML parses
  • change-detection green on this PR (exercises the fetch fix directly)

arzafran added 3 commits July 10, 2026 15:55
run_suite read $? after a branchless 'if', which is always 0, so any
XCTest failure exited 0 and CI reported red suites as green. Capture
the status directly with '|| exit_code=$?'.

Also fix the guard test's xcodebuild stub: its split-stateful case
fabricated two log lines per invocation, so the runner's two real
passes logged four calls and the guard failed even on correct behavior.
Log the actual arguments once per invocation instead.
The --depth=1 fetch of the base and head SHAs grafts away their parent
history, so 'git diff BASE...HEAD' dies with 'no merge base' on every
pull request and all gated jobs skip. The checkout already uses
fetch-depth: 0, so a plain fetch is correct and effectively free.
The split-stateful parallel mode landed in the same commit as the
exit-code bug that reported failing suites as green, so it has never
had an honestly-reported passing run. With failures propagating again,
the parallel pass fails dozens of AppKit-adjacent tests across multiple
test runner processes on both macos-15 and macos-26. Return to the
serial scope that was green before the split; re-enable parallelism
separately once the suite is parallel-safe.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant