Skip to content

Migrate workspace tests#10050

Draft
thePianoKid wants to merge 6 commits into
swiftlang:mainfrom
thePianoKid:migrate-workspace-tests
Draft

Migrate workspace tests#10050
thePianoKid wants to merge 6 commits into
swiftlang:mainfrom
thePianoKid:migrate-workspace-tests

Conversation

@thePianoKid
Copy link
Copy Markdown
Contributor

@thePianoKid thePianoKid commented May 12, 2026

I made two big changes in this PR:

1. Migrate from XCTest to Swift Testing

  • func test<test name> -> @Test func <test name>
  • XCTAssertNoDiagnostics -> expectNoDiagnostics
  • PackageGraphTesterXCTest -> try PackageGraphTester
  • Change implementation of checkPackageGraphFailure:

Before:

await workspace.checkPackageGraphFailure(roots: ["Foo", "Nested/Foo"]) { diagnostics in
            testDiagnostics(diagnostics) { result in

After:

try await workspace.checkPackageGraphFailure(roots: ["Foo", "Nested/Foo"]) { diagnostics in
            try expectDiagnostics(diagnostics) { result in
  • XCTAssertMatch -> #expect(<expected>.matches(<actual>))

This commit shows a clean diff of what was refactored.

2. Parameterized Tests

I recently wrote these tests. In these tests, the same logic is being applied to different inputs. They should be parameterized. I make this refactor in this commit.

Blocked by #9966

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