Skip to content

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

Draft
blakemcanally wants to merge 1 commit intosquare:mainfrom
blakemcanally:bmcanally/remove-xctest-from-testing-modules
Draft

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

Conversation

@blakemcanally
Copy link
Copy Markdown
Contributor

@blakemcanally blakemcanally commented Apr 24, 2026

Summary

  • Remove import XCTest and linkerSettings: [.linkedFramework("XCTest")] from all 5 public testing modules (12 source files)
  • Convert 5 test files across 3 modules from XCTest to Swift Testing, demonstrating every migration pattern needed for the remaining files

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.

Changes

Public module unlinkage (commit 1)

Zero behavioral change. Removes unused import XCTest and .linkedFramework("XCTest") from all 5 testing targets.

Test file conversions (commit 2)

Converts 5 representative test files covering every migration pattern:

Pattern XCTest Swift Testing Example file
Test class XCTestCase subclass @Suite struct All files
Assertions XCTAssertEqual/True/Nil #expect WorkflowActionTesterTests
Unwrap XCTUnwrap try #require WorkflowRenderTesterTests
Fail XCTFail Issue.record WorkflowRenderTesterTests
setUp override func setUp() init() WorkflowObserverTests
Named activities XCTContext.runActivity Nested @Suite WorkflowObserverTests
Shared state implicit .serialized trait WorkflowObserverTests
Expectations XCTestExpectation + wait withCheckedContinuation WorkerTests
Expected failures override record(_ issue:) withKnownIssue WorkflowRenderTesterFailureTests
Skip throw XCTSkip @Test(.enabled(if:)) (not yet converted, pattern documented)

Test plan

  • All 5 public testing modules build without XCTest linkage
  • swift build --build-tests compiles all test targets
  • swift test passes — 92 XCTest tests + all Swift Testing suites (verified locally with temporary SPM test targets)
  • TestingFrameworkCompatibilityTests validates dual-framework support
  • CI validation via Tuist (tuist test --path Samples)

🤖 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
…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 5 test files across 3 modules from XCTest to Swift Testing:
- WorkflowActionTesterTests: XCTestCase → @suite struct, XCTAssert → #expect
- WorkflowRenderTesterTests: XCTUnwrap → try #require, XCTFail → Issue.record
- WorkflowObserverTests: setUp → init, XCTContext.runActivity → nested @suite
- WorkerTests: XCTestExpectation + wait → withCheckedContinuation
- WorkflowRenderTesterFailureTests: override record(_:) → withKnownIssue

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 d3c6acc to 6dd94a6 Compare April 24, 2026 19:19
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.

1 participant