Repository navigation
fix(desktop): derive launcher-test discovery skips so test.sh reaches its Python and Swift sections (#11747) - #11748
Merged
Conversation
… its Python and Swift sections (#11747) desktop/macos/test.sh — README.md:47 calls it "the full component/PR suite", and it is the desktop answer to Definition-of-Done item 2 — aborted inside its first section on every machine, so `=== Python Desktop Backend Tests ===` and `=== Swift App Tests ===` never ran. The launcher-test loop is deliberately discovery-based (for t in tests/test-*.sh), but two discovered scripts need something the loop cannot supply: test-mounted-navigation-latency.sh wants a running app's automation token (FAIL: automation token is unavailable for port 47777, exit 1) and test-named-bundle-resources.sh wants an installed named bundle path (usage: ..., exit 64 — with no argument it can never pass). Under set -euo pipefail the first of the two killed the run. CI never hit it: the "Desktop launcher script tests" step in .github/workflows/desktop-swift-ci.yml:183 skips exactly those two with a case/continue. The membership was hand-listed in one loop and absent from the other. Derive it instead, the canonical prevention for FC-hand-listed-test-isolation-membership — whose guard artifact covers swift-test-suites.sh and did not generalize to this second discovery loop. Each script that cannot run under the loop declares `# discovery-skip: <reason>` in its own header; test.sh derives its skips from that marker and prints a visible `skip: <reason>` rather than dropping the script silently. The CI step's inlined list is unchanged and is now verified rather than authoritative. scripts/check-launcher-test-skips.py (run by tests/test-launcher-test-skips.sh, so both discovery loops execute it) holds the two loops to the marked set: every marked script is in the CI step's list, that list contains nothing else, test.sh still derives from the marker, every named script exists, and a script whose $# guard exits non-zero must carry the marker — the property that made this reachable. Verification: - bash test.sh on this branch (python3 3.12, backend/.venv synced): the launcher section completes with the two marked scripts printing `skip: <reason>`, then `=== Python Desktop Backend Tests ===` is reached for the first time — 196 passed in 11.14s — and the Swift section runs. - Guard proven against the pre-fix state on a scratch copy, not just asserted: test.sh as on main (no skips, CI list intact) fails with "skip lists diverge — only in desktop-swift-ci.yml: [both scripts]"; a one-script divergence and a stale skip naming a deleted script each fail with their own message; removing the marker handling from test.sh's loop fails on the lost derivation; this branch passes. - The $#-guard rule produced no false positives across the existing tests/test-*.sh. - scripts/pre_push_ci_prediction.py selects desktop-swift-tests for this diff, so CI runs the new checker. Failure-Class: FC-hand-listed-test-isolation-membership
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #11747.
Bug
desktop/macos/test.sh—desktop/macos/README.md:47calls it "the full component/PR suite", and it is the desktop answer to Definition-of-Done item 2 — cannot reach its Python or Swift sections on any machine. It aborts inside its first section.Root cause
The launcher-test loop is deliberately discovery-based (
for t in tests/test-*.sh), but two discovered scripts need something the loop cannot supply:tests/test-mounted-navigation-latency.sh— a running app's automation token →FAIL: automation token is unavailable for port 47777, exit 1.tests/test-named-bundle-resources.sh— an installed named bundle path →usage: ... /Applications/your-named-omi.app, exit 64. With no argument it can never pass.test.shruns underset -euo pipefail, so the first of the two kills the run and=== Python Desktop Backend Tests ===/=== Swift App Tests ===never execute. CI does not hit this because the "Desktop launcher script tests" step in.github/workflows/desktop-swift-ci.yml:183has acase/continueskipping exactly those two. The membership was hand-listed in one loop and absent from the other.Fix
Derived, not hand-listed — the canonical prevention for
FC-hand-listed-test-isolation-membership, whose existing guard artifact coversswift-test-suites.shand did not generalize to this second discovery loop:# discovery-skip: <reason>in its own header, so it opts out where it lives rather than in a remote list.test.shderives its skips from that marker and prints a visibleskip: <reason>line — no silent drop, no second list to keep in sync.scripts/check-launcher-test-skips.py(run bytests/test-launcher-test-skips.sh, so both discovery loops execute it) holds the two loops to the marked set: every marked script is in the CI step's hand list, that list contains nothing else,test.shstill derives from the marker, every named script exists, and a script whose$#guard exits non-zero must carry the marker — the property that made this reachable.The CI step's inlined list is unchanged; it is now verified rather than authoritative.
Verification
Ran the real runner,
bash test.sh, on this branch (python3= 3.12;backend/.venvsynced):skip: <reason>. Previously it died here.=== Python Desktop Backend Tests ===— reached for the first time: 196 passed in 11.14s.=== Swift App Tests ===— reached and executing the per-suite isolated run.Guard proven against the pre-fix state, not just asserted (each run reproduced on a scratch copy so the real tree stayed intact):
test.shas onmain— no skips, CI list intactFAIL: launcher-test skip lists diverge — only in desktop-swift-ci.yml: [both scripts]FAIL: ... only in desktop-swift-ci.yml: [test-mounted-navigation-latency.sh]FAIL: skipped script does not exist: ...test.sh's loopFAIL: desktop/macos/test.sh no longer derives its launcher-test skips from '# discovery-skip:'launcher-test discovery skips are derived and agree (2 skipped: ...)The
$#-guard rule produced no false positives across the 40+ existingtests/test-*.sh. Lane selection confirmed withscripts/pre_push_ci_prediction.py: this diff selectsdesktop-swift-tests, so CI runs the new checker.Not fixed here, unrelated to this diff:
tests/test-context-bucket-benchmark.shcrashes under Python 3.9 (exc.read()on anHTTPErrorwithfp=NoneraisesKeyErrorfrom thetempfilewrapper, outside the caught exception tuple). It passes on 3.10+, which is what CI runs.Failure-Class: FC-hand-listed-test-isolation-membership
🤖 automated by hourly watchdog — tested and merged