Skip to content

Remove XCTest dependency from testing modules and convert tests to Swift Testing#391

Merged
blakemcanally merged 1 commit intosquare:mainfrom
blakemcanally:bmcanally/remove-xctest-from-testing-modules
Apr 30, 2026
Merged

Remove XCTest dependency from testing modules and convert tests to Swift Testing#391
blakemcanally merged 1 commit intosquare:mainfrom
blakemcanally:bmcanally/remove-xctest-from-testing-modules

Conversation

@blakemcanally
Copy link
Copy Markdown
Collaborator

@blakemcanally blakemcanally commented Apr 24, 2026

Summary

  • Remove import XCTest and linkerSettings: [.linkedFramework("XCTest")] from all 5 public testing modules (12 source files, Package.swift)
  • Convert 2 test files to Swift Testing (WorkflowActionTesterTests, WorkflowRenderTesterTests)

Motivation

The public testing modules (WorkflowTesting, WorkflowReactiveSwiftTesting, WorkflowRxSwiftTesting, WorkflowCombineTesting, WorkflowConcurrencyTesting) had import XCTest despite not using any XCTest symbols — all failure reporting goes through reportIssue() from IssueReporting, which auto-bridges to both frameworks at runtime. Removing the hard dependency unblocks downstream consumers who want to write tests using Swift Testing.

xcodebuild compatibility notes

Three test files were prototyped as Swift Testing but kept as XCTest due to xcodebuild issues:

  • WorkflowObserverTests: .serialized trait with nested @Suite structs causes xcodebuild to report TEST FAILED even when all tests pass
  • WorkflowRenderTesterFailureTests: withKnownIssue causes xcodebuild exit code 65 on known issues
  • WorkerTests: withCheckedContinuation replacing XCTestExpectation hangs under xcodebuild when awaiting ReactiveSwift signals

These can be revisited as xcodebuild's Swift Testing support matures.

Test plan

  • All 5 public testing modules build without XCTest linkage
  • swift build --build-tests compiles all test targets
  • tuist test --path Samples UnitTests passes locally
  • TestingFrameworkCompatibilityTests validates dual-framework support

🤖 Generated with Claude Code

@blakemcanally blakemcanally changed the title Remove unused XCTest dependency from public testing modules Remove XCTest dependency from testing modules and convert tests to Swift Testing Apr 24, 2026
@blakemcanally blakemcanally force-pushed the bmcanally/remove-xctest-from-testing-modules branch 2 times, most recently from 0099e7f to 54d0e15 Compare April 28, 2026 01:36
…ift Testing

Remove `import XCTest` and `linkerSettings: [.linkedFramework("XCTest")]` from
all 5 public testing modules. None of these files used any XCTest symbols — all
failure reporting goes through `reportIssue()` from IssueReporting, which
auto-bridges to both XCTest and Swift Testing at runtime. This unblocks
downstream consumers who want to use RenderTester, WorkflowActionTester, and
expectWorker from Swift Testing @test functions.

Convert 2 test files to Swift Testing:
- WorkflowActionTesterTests: XCTestCase → struct, XCTAssert → #expect
- WorkflowRenderTesterTests: XCTUnwrap → try #require, XCTFail → Issue.record

Tests kept as XCTest due to xcodebuild compatibility issues:
- WorkflowObserverTests: .serialized + nested @suite causes xcodebuild to
  report TEST FAILED even when all tests pass
- WorkflowRenderTesterFailureTests: withKnownIssue causes xcodebuild exit
  code 65 on known issues
- WorkerTests: withCheckedContinuation hangs under xcodebuild test runner
  when awaiting ReactiveSwift signals

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@blakemcanally blakemcanally force-pushed the bmcanally/remove-xctest-from-testing-modules branch from 0aff964 to 3396ffc Compare April 29, 2026 20:00
@blakemcanally blakemcanally marked this pull request as ready for review April 30, 2026 02:29
@blakemcanally blakemcanally requested a review from a team as a code owner April 30, 2026 02:29
@blakemcanally blakemcanally enabled auto-merge (squash) April 30, 2026 02:29
@blakemcanally blakemcanally merged commit f6cfcae into square:main Apr 30, 2026
10 checks passed
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