Skip to content

Migrate from XCTest to Swift Testing#382

Merged
kukushechkin merged 5 commits intoapple:mainfrom
kukushechkin:swift-testing-migration
Oct 23, 2025
Merged

Migrate from XCTest to Swift Testing#382
kukushechkin merged 5 commits intoapple:mainfrom
kukushechkin:swift-testing-migration

Conversation

@kukushechkin
Copy link
Copy Markdown
Contributor

Migrating swift-log from XCTest to Swift Testing

Motivation

Swift Testing is a modern alternative to XCTest. Swift Server Ecosystem packages should serve as reference implementations for modern Swift features and best practices.

Modifications

  • 1-to-1 migration of test suites, tests, and assertions to Swift Testing syntax with XCTest import removed
  • XCTest references removed from documentation
  • .trace log level added to relevant tests
  • GlobalLoggerTest suite serialized to handle global LoggingSystem access (XCTest runs tests serially by default; Swift Testing runs in parallel, so serializing this suite avoids requiring swift test --no-parallel across all CI and development environments)

Result

Successfully executes 52 tests with swift test --disable-xctest.

@kukushechkin kukushechkin force-pushed the swift-testing-migration branch from d7a80a5 to 68a8dab Compare October 23, 2025 08:28
@rnro rnro added the 🔨 semver/patch No public API change. label Oct 23, 2025
Copy link
Copy Markdown
Contributor

@czechboy0 czechboy0 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @kukushechkin, added a few comments, but overall looks great 🙏

@kukushechkin kukushechkin force-pushed the swift-testing-migration branch from 5116fdf to d36686f Compare October 23, 2025 11:12
Copy link
Copy Markdown
Contributor

@czechboy0 czechboy0 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great, thanks 🙏

@kukushechkin kukushechkin merged commit a90a3d1 into apple:main Oct 23, 2025
46 checks passed
@kukushechkin kukushechkin deleted the swift-testing-migration branch November 5, 2025 13:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🔨 semver/patch No public API change.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants