ci(tests): the Swift suite runner's fake swift answers the binary-module guard
Summary
tests/test_swift_testing_suite_timeout.py (ci-guards.yml's app-host-execution step "Validate Swift Testing suite timeout guard") is red on feat-cmux-next, with 21 failures and 1 error. It broke when e6c6b4a2a506 and a9d9b47dc978 made scripts/ci/run-swift-testing-suites.sh run scripts/ci/swiftpm-binary-module-guard.sh before its build. The guard calls swift package resolve and swift --version, and the test's fake swift scripts were written before the guard existed:
- Hangs: fakes that hang on every call except the list call also hung the resolve, so the runner hit its 180 s deadline.
- Purged builds: fakes that exit non-zero on the resolve made the guard drop its digest and purge
.build. That deleted the direct tests' pre-built.xctestbundle ("no .xctest bundle", and the "Swift test suites:" summary went missing) and the settings export's warmSettings.bundle. - Recorded calls: fakes that record their calls saw the resolve as the first call (the debug-info test).
The fix is in the test only; the runner and guard are unchanged:
- Every fake
swiftis now a small wrapper. It answers--versionandpackage resolveitself and passes every other call to the test's own fake (write_fake_swift). - The tests that set up a warm
.buildstamp it with the fake toolchain's digest (keep_warm_build). That models a warm slot whose binary-target headers did not change, so the guard keeps their outputs.
Changelog
none
Testing
Focused command: python3 tests/test_swift_testing_suite_timeout.py
- Red on base: 21 failures and 1 error in the CI guard group of #23534, on both head and base: https://github.com/manaflow-ai/cmux/actions/runs/39629372978/job/119323093394
- This PR's CI: feat-cmux-next pull requests do not run the app-host-execution group until #23534 lands. After that, a change to this test routes app-host-execution by path and runs it, so this PR's own CI will not show it before then.
Observed / Not run
Observed: the file parses (ast) and the prepush gate passes. I checked the generated wrapper text statically.
Not run: the test itself. Python tests are not run on cosmic-gray; they run only on CI or Blacksmith Linux.
Agent session: cosmic-gray
🤖 Generated with Claude Code
Need help on this PR? Tag @codesmith-bot with what you need.
Summary by cubic
Fixes tests/test_swift_testing_suite_timeout.py, which fails on feat-cmux-next because the runner's pre-build guard now calls swift package resolve and swift --version, calls the test's fake swift scripts predate. Fakes that hang on non-list calls stalled the resolve until the 180-second deadline; fakes that exited non-zero triggered a .build purge that deleted pre-built test bundles and the settings export's Settings.bundle; fakes that recorded calls logged the resolve as the first call. The runner and guard are unchanged.
Each fake swift is now a wrapper answering the two guard calls itself and delegating every other call to the test's own fake, and tests that set up a warm build stamp it with the fake toolchain's digest so the guard keeps their outputs.