Skip to content

[test] Migrate unit tests to Swift Testing #88

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 9 commits into
base: main
Choose a base branch
from

Conversation

sebsto
Copy link
Contributor

@sebsto sebsto commented Jun 29, 2025

Migrate all unti tests to Swift Testing

Motivation:

Allows to compile and run test on open source Swift toolchain 6

Modifications:

Migrate according to
https://developer.apple.com/documentation/testing/migratingfromxctest

Result:

􁁛  Test run with 101 tests passed after 0.012 seconds.

@sebsto sebsto requested a review from adam-fowler June 29, 2025 09:14
@sebsto sebsto added 🔨 semver/patch No public API change. semver/none No version bump required. labels Jun 29, 2025
@sebsto sebsto changed the title migrate unit test [test] Migrate unit tests to Swift Testing Jun 29, 2025
@sebsto sebsto added ⚠️ semver/major Breaks existing public API. and removed 🔨 semver/patch No public API change. semver/none No version bump required. labels Jun 29, 2025
Package.swift Outdated

import PackageDescription

let swiftSettings: [SwiftSetting] = [.enableExperimentalFeature("StrictConcurrency=complete")]

let package = Package(
name: "swift-aws-lambda-events",
platforms: [.macOS(.v15)],
Copy link
Member

Choose a reason for hiding this comment

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

Why do you need to add the platform requirement?

Copy link
Member

Choose a reason for hiding this comment

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

If it is needed for swift-testing you could add a @available at the top of each suite.

Also you could just wrap all the tests in a #if compiler(>=6.0) to avoid requiring swift 6

Copy link
Contributor Author

@sebsto sebsto Jun 29, 2025

Choose a reason for hiding this comment

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

I propose an alternative : I created a [email protected] with no test target and keep the tests running for Swift 6.x only.
The CI runs tests on 6.x anyway.

Would that work ?

@sebsto sebsto added 🆕 semver/minor Adds new public API. and removed ⚠️ semver/major Breaks existing public API. labels Jun 29, 2025
@sebsto sebsto requested a review from adam-fowler June 29, 2025 10:44
@sebsto
Copy link
Contributor Author

sebsto commented Jun 29, 2025

adjusted tag to semver/minor as there is no API change or change in min supported language version

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🆕 semver/minor Adds new public API.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants