← Back to Pull requests

fix macOS CI Swiftly XCTest handling #923

Closed
unknown closed this pull request without merging on Sep 25, 2026 09:00 UTC
View on GitHub
unknown unknown commented on Sep 24, 2026 15:04 UTC
Author

Summary

Make the macOS Swift CI job reliable: keep Swiftly for the Swift 6.3 production build and use the Xcode toolchain for both test modes.

Problem

The original job failed during Swift Build:

SwiftSyntaxMacrosTestSupport/Assertions.swift:19:16: error: no such module 'XCTest'

Failed job: https://github.com/swiftlang/swift-java/actions/runs/35585778520/job/107554476812?pr=922

| | PR #921 | PR #922 |
|---|---|---|
| Result | Passed | Failed |
| macOS | 26.5.2 | 26.6.2 |
| Runner | 2.336.0 | 2.337.0 |
| Swiftly | Swift 6.3.3 | Swift 6.3.3 |
| Swift Build | swift build --build-tests | swift build --build-tests |

Both runs used the same Swiftly version and build command, but XCTest discovery behaved differently. This shows that relying on XCTest discovery from the Swiftly standalone toolchain is environment-dependent.

Changes

  • Keep the macOS Install Swiftly step.

  • Build production targets with Swiftly:

  • swift build --disable-sandbox
  • Prepend Xcode Swift to PATH before tests so SwiftPM build plugins use the same toolchain.

  • Run Swift Testing with the Xcode toolchain:

  • xcrun swift test --disable-xctest
  • Run XCTest with the Xcode toolchain:

  • xcrun swift test --disable-experimental-swift-testing

    The Swift Build step no longer uses --build-tests. SwiftPM still compiles XCTest test targets when --disable-xctest is set, so both test modes use Xcode Swift to make XCTest available. The build plugin also invokes swift through PATH; putting Xcode Swift first prevents it from writing a Swiftly configuration error instead of static-build-config.json.

    Validation

  • Reproduced no such module 'XCTest' with Swiftly 6.3.3 and swift test --disable-xctest in a small package containing XCTest and Swift Testing targets. Both Xcode test modes passed on that package.

  • Reproduced the build plugin writing a Swiftly configuration error instead of JSON when xcrun swift test inherited a Swiftly-first PATH; verified that an Xcode-first PATH produces valid JSON.

  • Completed a clean local rebuild with Xcode Swift first in PATH: xcrun swift test --disable-xctest passed 691 Swift Testing tests; xcrun swift test --disable-experimental-swift-testing passed 117 XCTest tests (1 skipped). Gradle 9.4.0 bootstrapped successfully for the Java integration tests.
  • Diff: 310 lines (+232 / -78) across 3 files Reviewer: ktoso Review duration: 1076m
    All Vouch review confidence checks passed
    Residual risk 0.16 = Change Risk (0.40) × (1 − Review Confidence (0.60)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.40 · 310 lines diff across 3 files
    0.40
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.17 · 1 substantive comment(s)
    0.17
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    60%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Diff Size diff_size
    0.343
    Shallow Review Depth shallow_review_depth
    0.289
    Real PR Conversation Timeline
    1 comments
    "Review active on #923"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 60.5% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 40.3% (MEDIUM) · Higher = larger blast radius
    40.3%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 60.5% · Lower = rushed or shallow review
    60.5%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 15.9% · Safe to merge
    15.9%