Skip to content

test(desktop): guard the DEBUG-only turn-evidence seam so the release-mode test build compiles (#13458) - #13467

Merged
Git-on-my-level merged 1 commit into
mainfrom
fix/desktop-release-test-build-13458
Sep 11, 2026
Merged

Git-on-my-level merged 1 commit into
mainfrom
fix/desktop-release-test-build-13458

Conversation

@Git-on-my-level

@Git-on-my-level Git-on-my-level commented Sep 11, 2026 •

Copy link
Copy Markdown
Member

Summary

Closes #13458.

  • swift test -c release compiles the whole desktop test target. RealtimeTurnEvidenceLedger.testingAttachRealtimeUserEvidence is declared under #if DEBUG (fix(desktop): defer native PTT evidence attach until its journal row exists #13235), but the three RealtimeTurnEvidenceTests methods that assign it were not guarded, so the "Test UserNotifications callback regression in release mode" step has failed on every PR that touched desktop/macos/Desktop/Tests/*.swift since 2026-09-09.
  • Main looked green because that step is path-filtered (should_notification_release_regression) and every main push since skipped the whole job.
  • This PR guards the DEBUG-only test seams so the release-mode test build compiles again. Workflow un-skipping is left to the maintainer (no .github/workflows change 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 assign testingAttachRealtimeUserEvidence are wrapped in #if DEBUG … #endif, matching the seam's declaration in RealtimeTurnEvidence.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.
  • Audit of the whole test target: 75 #if DEBUG regions across 32 source files; every other DEBUG-only seam referenced from Desktop/Tests is already guarded (file-level omi-release-compile wrappers or local #if DEBUG). No other unguarded reference found.

Verification

From desktop/macos on 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 failures

Note for the maintainer: should_notification_release_regression fires only for paths whose name contains Notification (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 every Desktop/Tests/*.swift change, 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

Review in cubic

…-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]>

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 1 file

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

Re-trigger cubic

@Git-on-my-level
Git-on-my-level merged commit 29200f5 into main Sep 11, 2026
31 checks passed
@Git-on-my-level
Git-on-my-level deleted the fix/desktop-release-test-build-13458 branch September 11, 2026 06:03
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
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.

Desktop release-mode test build broken on main since #13235: RealtimeTurnEvidenceTests uses a #if DEBUG seam unguarded

1 participant