Skip to content

Isolate test Application state and fail CI on Linux or macOS#83

Draft
0xLeif wants to merge 8 commits into
mainfrom
cursor/test-isolation-platform-parity-3f71
Draft

Isolate test Application state and fail CI on Linux or macOS#83
0xLeif wants to merge 8 commits into
mainfrom
cursor/test-isolation-platform-parity-3f71

Conversation

@0xLeif

@0xLeif 0xLeif commented Jul 21, 2026

Copy link
Copy Markdown
Owner

Summary

Hardens APSTests so demo AppState is scoped per case (no order-dependent cross-talk), adds a swift test --parallel regression, and folds Linux into the CI matrix so either platform failure fails the gate.

Test isolation

  • Per-case temp FileManager.defaultFileStatePath, tearDown cleanup
  • Hermetic in-memory UserDefaults via Application.override(\.userDefaults)
  • DynamicKeyStorage.resetProcessMemory() + demo key / stats resets in setUp/tearDown
  • Actor gate (TestIsolationGate) so --parallel cannot interleave Application mutations (async-safe on macOS Swift 6.3)
  • New tests: testUserDefaultsStandardIsHermetic, testIsolationStartsWithCleanDemoState
  • Scripts/test-parallel.sh wired into fledge lanes verify

Linux / macOS parity

  • Scripts/build.sh + Scripts/test.sh apply the Linux Observation linker allowance via uname branch
  • ci.yml matrix: macos-latest + ubuntu-latest (test, parallel, smoke); workflow fails if either cell fails
  • linux-smoke.yml updated to the same scripts

SpecSync

Verify

  • fledge lanes run verify passed on Linux (Swift 6.0.3)
  • CI matrix green for macOS + Linux on the actor-gate revision
Open in Web Open in Cursor 

cursoragent and others added 8 commits July 21, 2026 13:49
Scope FileState to a unique temp directory, override UserDefaults with an
in-memory suite, reset DynamicKeyStorage memory and demo keys in setUp and
tearDown, and serialize Application access under swift test --parallel.

Co-authored-by: Leif <leif.algo@pm.me>
Scripts/build.sh and Scripts/test.sh apply the Observation linker
allowance on Linux. Scripts/test-parallel.sh runs swift test --parallel
and is wired into fledge lanes.verify.

Co-authored-by: Leif <leif.algo@pm.me>
ci.yml uses a matrix for macos-latest and ubuntu-latest (test, parallel
isolation, smoke). linux-smoke.yml reuses the portable scripts.

Co-authored-by: Leif <leif.algo@pm.me>
Update testing companions for hermetic/parallel expectations and accept
CHG-0038 (no canonical API deltas; follow-up #82 filed for DynamicKeyStorage).

Co-authored-by: Leif <leif.algo@pm.me>
Empty "${extra[@]}" under set -u fails on the macOS Trust runner. Branch
on uname instead of building an optional args array.

Co-authored-by: Leif <leif.algo@pm.me>
macOS Swift 6.3 rejects DispatchSemaphore.wait from async setUp/tearDown.
TestIsolationGate acquire/release keeps Application cases serialized under
swift test --parallel without blocking the cooperative pool.

Co-authored-by: Leif <leif.algo@pm.me>
Co-authored-by: Leif <leif.algo@pm.me>
CHG-0038 delivery evidence was stale after macOS portability fixes; reopen,
re-verify, and re-accept with exact evidence. CHG-0039 covers the same
Scripts/ and Tests/apsTests/ paths for the follow-up edits.

Co-authored-by: Leif <leif.algo@pm.me>
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.

2 participants