← Back to Pull requests

Run every test runner in the Android emulator tests #327

Closed
unknown closed this pull request without merging on Oct 27, 2026 08:18 UTC
View on GitHub
unknown unknown commented on Oct 17, 2026 12:27 UTC
Author

Fixes #277.

With Swift Build, each test target gets its own -test-runner. android-emulator-tests.sh ran them with ./-test-runner --testing-library …, so the shell passed the other runners as arguments to the first one, and only the first test target ran.

In swift-foundation, the staging directory has three runners, but only FoundationEssentialsTests ran on the emulator. FoundationInternationalizationTests (485 tests, including Calendar and the ICU-based tests) and FoundationMacrosTests (45 tests) never ran on Android. This includes the formatting tests for the Swift implementations that replace ICU, like the ListFormatStyle suite from swiftlang/swift-foundation#1991 and the date pattern tests in swiftlang/swift-foundation#2330.

This runs the test runners one at a time, with the same xctest and swift-testing passes and the same handling of exit code 69 as before. A failure in one runner or pass doesn't stop the others: every runner runs both passes, and the job fails at the end if any of them failed. If there are no -test-runner files, it falls back to .xctest as before, so the native build system still works. It also adds a second test target to tests/TestPackage, so this repository's own Android check covers more than one runner.

About going back to a single runner, as asked in #277: running each runner works with both build systems and doesn't need a change in SwiftPM.

Effect on other packages. The scripts are checked out from main, so this applies right away to every package that uses enable_android_sdk_checks. In packages with more than one test target, test targets that didn't run before will run, so failures that were hidden can show up, and the Android job takes longer. I ran the same fork check on two of them:

  • swift-collections (13 test runners): before, the first runner got the other runners' paths as arguments, and XCTest took them as test filters, so 0 tests ran. With this change, 834 tests run and pass with Swift 6.4, nightly-6.4.x and nightly-main.

  • swift-algorithms (1 test runner): 224 tests before and after.
  • One more difference: exit code 69 is now accepted only from the swift-testing pass, as the comment says. Before, because of how && and || combine, it was also accepted from the xctest pass. In these runs, the xctest pass returns 0 when it finds no tests.

    Testing:

  • swift-foundation's pull request workflow in a fork, pointed at this branch, on the Android emulator (x86_64, NDK r30): all three runners ran, with 1598, 485 and 45 tests passing. Before this change, the same workflow ran only the first runner (1598 tests).

  • A local check of the generated shell command with fake runners in sh, bash --posix and dash: all runners run; exit code 69 from swift-testing doesn't fail the run; a failing runner or pass fails the run, and everything after it still runs.

  • This repository's pull request workflow in a fork, on the Android emulator (6.4, nightly-6.4.x and nightly-main, NDK r30): with a test that fails on purpose in Target1Tests, Target2Tests still ran and passed, and the job failed; without it, both runners passed and the job passed.

  • swift test for tests/TestPackage runs both test targets. shellcheck reports nothing for the script.
  • Diff: 410 lines (+307 / -103) across 5 files Reviewer: niktishakov Review duration: 14151m
    All Vouch review confidence checks passed
    Residual risk 0.18 = Change Risk (0.45) × (1 − Review Confidence (0.60)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.45 · 410 lines diff across 5 files
    0.45
    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.360
    Shallow Review Depth shallow_review_depth
    0.289
    Real PR Conversation Timeline
    1 comments
    "Review active on #327"
    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: 44.9% (MEDIUM) · Higher = larger blast radius
    44.9%
    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: 17.7% · Safe to merge
    17.7%