Skip to content

fix(desktop): derive launcher-test discovery skips so test.sh reaches its Python and Swift sections (#11747) - #11748

Merged
kodjima33 merged 1 commit into
mainfrom
watchdog/issue-11747-desktop-test-sh-unreachable
Aug 17, 2026
Merged

kodjima33 merged 1 commit into
mainfrom
watchdog/issue-11747-desktop-test-sh-unreachable

Conversation

@kodjima33

@kodjima33 kodjima33 commented Aug 17, 2026 •

Copy link
Copy Markdown
Collaborator

Fixes #11747.

Bug

desktop/macos/test.sh — desktop/macos/README.md:47 calls 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.sh runs under set -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:183 has a case/continue skipping 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 covers swift-test-suites.sh and did not generalize to this second discovery loop:

  1. Each script that cannot run under the loop declares # discovery-skip: <reason> in its own header, so it opts out where it lives rather than in a remote list.
  2. test.sh derives its skips from that marker and prints a visible skip: <reason> line — no silent drop, no second list to keep in sync.
  3. New 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 hand 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.

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/.venv synced):

  • Launcher section completes: every discovered test passes, the two marked ones print 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):

Scenario Result
test.sh as on main — no skips, CI list intact FAIL: launcher-test skip lists diverge — only in desktop-swift-ci.yml: [both scripts]
Partial divergence — one script skipped, one not FAIL: ... only in desktop-swift-ci.yml: [test-mounted-navigation-latency.sh]
Stale skip naming a deleted script FAIL: skipped script does not exist: ...
Marker removed from test.sh's loop FAIL: desktop/macos/test.sh no longer derives its launcher-test skips from '# discovery-skip:'
This branch launcher-test discovery skips are derived and agree (2 skipped: ...)

The $#-guard rule produced no false positives across the 40+ existing tests/test-*.sh. Lane selection confirmed with scripts/pre_push_ci_prediction.py: this diff selects desktop-swift-tests, so CI runs the new checker.

Not fixed here, unrelated to this diff: tests/test-context-bucket-benchmark.sh crashes under Python 3.9 (exc.read() on an HTTPError with fp=None raises KeyError from the tempfile wrapper, 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

Review in cubic

… 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
@kodjima33 kodjima33 added the no-changelog-needed Skip desktop changelog enforcement for internal-only changes label Aug 17, 2026
@kodjima33
kodjima33 merged commit 425efc4 into main Aug 17, 2026
35 checks passed
@kodjima33
kodjima33 deleted the watchdog/issue-11747-desktop-test-sh-unreachable branch August 17, 2026 14:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

no-changelog-needed Skip desktop changelog enforcement for internal-only changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

desktop/macos/test.sh never reaches its Python or Swift sections: two discovered launcher tests need an argument the loop cannot supply

1 participant