Skip to content

Remove dependency on XCTest #516

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

Merged
merged 8 commits into from
Jun 28, 2025
Merged

Conversation

sebsto
Copy link
Contributor

@sebsto sebsto commented Jun 28, 2025

Remove dependency on XCTest

Motivation:

As 6.1 does not include XCTest anymore, finish the migration to Swift testing

Modifications:

Replace XCTest by Swift Testing in two files

Result:

swift test works on 6.1.2

@sebsto sebsto requested a review from Copilot June 28, 2025 10:23
@sebsto sebsto self-assigned this Jun 28, 2025
@sebsto sebsto added the semver/none No version bump required. label Jun 28, 2025
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This pull request migrates the testing framework from XCTest to a new Testing package, removing the dependency on XCTest and updating test syntax across multiple files. Key modifications include replacing XCTest assertions with #expect statements, transforming test classes into structs with @test annotations, and updating logging levels in the mock server and client tests.

Reviewed Changes

Copilot reviewed 6 out of 7 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
scripts/check-format.sh Added script to run swift-format on changed files
scripts/check-format-linux.sh Added Linux-compatible format checking script
Tests/AWSLambdaRuntimeTests/UtilsTest.swift Updated test suite from XCTest to Testing syntax
Tests/AWSLambdaRuntimeTests/MockLambdaServer.swift Changed logging levels from info to trace
Tests/AWSLambdaRuntimeTests/LambdaRuntimeClientTests.swift Commented out logger configuration for trace logging
Tests/AWSLambdaRuntimeTests/ControlPlaneRequestEncoderTests.swift Refactored test setup and assertions to new syntax
Comments suppressed due to low confidence (1)

Tests/AWSLambdaRuntimeTests/UtilsTest.swift:25

  • Double-check that using a struct for the test suite is supported and intended in the new Testing framework, as some frameworks traditionally expect a class.
struct UtilsTest {

@sebsto sebsto merged commit 935ea0f into swift-server:main Jun 28, 2025
63 of 64 checks passed
@sebsto sebsto deleted the sebsto/remove_xctest branch June 28, 2025 11:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
semver/none No version bump required.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant