Remove XCTest dependency from testing modules and convert tests to Swift Testing#391
Draft
blakemcanally wants to merge 1 commit intosquare:mainfrom
Draft
Conversation
…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>
d3c6acc to
6dd94a6
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
import XCTestandlinkerSettings: [.linkedFramework("XCTest")]from all 5 public testing modules (12 source files)Motivation
The public testing modules (
WorkflowTesting,WorkflowReactiveSwiftTesting,WorkflowRxSwiftTesting,WorkflowCombineTesting,WorkflowConcurrencyTesting) hadimport XCTestdespite not using any XCTest symbols — all failure reporting goes throughreportIssue()fromIssueReporting, 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 XCTestand.linkedFramework("XCTest")from all 5 testing targets.Test file conversions (commit 2)
Converts 5 representative test files covering every migration pattern:
XCTestCasesubclass@Suite structXCTAssertEqual/True/Nil#expectXCTUnwraptry #requireXCTFailIssue.recordoverride func setUp()init()XCTContext.runActivity@Suite.serializedtraitXCTestExpectation+waitwithCheckedContinuationoverride record(_ issue:)withKnownIssuethrow XCTSkip@Test(.enabled(if:))Test plan
swift build --build-testscompiles all test targetsswift testpasses — 92 XCTest tests + all Swift Testing suites (verified locally with temporary SPM test targets)TestingFrameworkCompatibilityTestsvalidates dual-framework supporttuist test --path Samples)🤖 Generated with Claude Code