Repository navigation
test(desktop): guard the DEBUG-only turn-evidence seam so the release-mode test build compiles (#13458) - #13467
Merged
Conversation
…-mode test build compiles CI's 'Test UserNotifications callback regression in release mode' step runs swift test -c release, which compiles the whole test target. Three tests here assign RealtimeTurnEvidenceLedger.testingAttachRealtimeUserEvidence, a seam declared under #if DEBUG (since #13235), so the release build fails on any PR that touches desktop tests. Main stayed green only because the step is skipped on pushes that do not touch Desktop/Tests. Wrap the three tests in #if DEBUG to match the seam. Tracked as #13458. Audit of Desktop/Sources #if DEBUG seams vs Desktop/Tests: 75 DEBUG-only regions in 32 source files. Distinctive DEBUG-only types and testing*/ *ForTesting APIs are already #if DEBUG-guarded in Tests (or are string-literal source-inspection, which still compiles). No further unguarded member accesses. Verification (cwd desktop/macos, Xcode 26.6 / Swift 6.3.3): xcrun swift build --build-tests --package-path Desktop Build complete! (268.91s) xcrun swift test --package-path Desktop --filter RealtimeTurnEvidenceTests/ Executed 26 tests, with 0 failures (including the three DEBUG-guarded attach tests: testOCRBeforeJournalRowDoesNotAttachAndLaterAdmissionCarriesEvidence, testOCRAfterBoundUserRowAndFinalizedStreamingAttachesOnce, testOCRWhileStreamingLedgerContainsKeyWaitsForRecordTask) xcrun swift test -c release --package-path Desktop --filter UserNotificationCallbackBridgeTests/ Build complete! (491.09s) Executed 11 tests, with 0 failures (0 unexpected) Co-Authored-By: Claude Fable 5.1 <[email protected]> Co-authored-by: Cursor <[email protected]>
Git-on-my-level
added a commit
that referenced
this pull request
Sep 13, 2026
* fix(ci): compile all desktop release tests and reuse their build Select package-wide release test compilation for PR/push target changes and unconditionally for scheduled/manual health checks. Build the app and tests once with explicit testability and shared release/triple options, then run the notification regression with --skip-build. Keep pre-push debug-only and the existing hosted job ceiling. Regressions cover #13123/#13467; build reuse addresses the duplicate compilation reported in #13481. Validation: make setup; make preflight (22 checks); metadata and failure-class validation; 29 selector and 36 workflow tests; executable runner CLI fixtures; actionlint with repository CI flags. Xcode 26.6 release build-tests -j4 passed in 703.57s; 11 filtered notification tests passed with --skip-build in 6.22s. All 2707 compiled artifact size/mtime pairs were unchanged. Pinned Xcode16.4 and hosted timing remain CI verification; no app/backend launch performed. Failure-Class: FC-path-filter-masks-default-branch-health * chore(desktop): record internal release-check change * fix(ci): select desktop contracts for suite runner and pre-push The desktop Swift CI contract reads swift-test-suites.sh and scripts/pre-push, so changes to either must select that check in the shared local/CI manifest. Add the two missing triggers without changing release coverage or budgets. Validation: 36 desktop Swift CI contract tests, 4 manifest route tests, 52 check runner tests; CLI selection verified both inputs in local and CI; make preflight passed all 22 checks (29.95s). Failure-Class: FC-path-filter-masks-default-branch-health
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.
Summary
Closes #13458.
swift test -c releasecompiles the whole desktop test target.RealtimeTurnEvidenceLedger.testingAttachRealtimeUserEvidenceis declared under#if DEBUG(fix(desktop): defer native PTT evidence attach until its journal row exists #13235), but the threeRealtimeTurnEvidenceTestsmethods that assign it were not guarded, so the "Test UserNotifications callback regression in release mode" step has failed on every PR that toucheddesktop/macos/Desktop/Tests/*.swiftsince 2026-09-09.should_notification_release_regression) and every main push since skipped the whole job..github/workflowschange here).Product invariants affected
None. Test-target guards only; no source behaviour changes.
Failure-Class
Failure-Class: FC-path-filter-masks-default-branch-health
Same class as #12275 / #12931: a path-filtered job hid a compile failure on main behind newer green runs.
What changed
desktop/macos/Desktop/Tests/RealtimeTurnEvidenceTests.swift— the three tests that assigntestingAttachRealtimeUserEvidenceare wrapped in#if DEBUG … #endif, matching the seam's declaration inRealtimeTurnEvidence.swift. Same commit as carried on feat(desktop): opt-in on-device embeddings with FTS hybrid retrieval; backend keyword fallback for screen search #13456 (0fcadb3536), cherry-picked onto main.#if DEBUGregions across 32 source files; every other DEBUG-only seam referenced fromDesktop/Testsis already guarded (file-levelomi-release-compilewrappers or local#if DEBUG). No other unguarded reference found.Verification
From
desktop/macoson Xcode 26.6 / Swift 6.3.3:xcrun swift build --build-tests --package-path Desktop→ Build complete (268.9 s)xcrun swift test --package-path Desktop --filter RealtimeTurnEvidenceTests/→ 26 tests, 0 failures (the three guarded tests still run in debug)xcrun swift test -c release --package-path Desktop --filter UserNotificationCallbackBridgeTests/(CI's exact release step) → Build complete (491.1 s); 11 tests, 0 failuresNote for the maintainer:
should_notification_release_regressionfires only for paths whose name containsNotification(scripts/pre_push_ci_prediction.py_is_desktop_notification_input), so this PR's CI will skip the step this fix repairs; the local run above is the evidence. Widening that selector to everyDesktop/Tests/*.swiftchange, or running the step whenever the Release Compile job already runs, would make the gate match the failure class. Not changed here.🤖 Generated with Claude Code