Skip to content

Conversation

@jkmassel
Copy link
Contributor

@jkmassel jkmassel commented Nov 14, 2024

Updates the project to Swift 6, which brings a few benefits:

  1. We can remove our Linux shims – Foundation is now the same across platforms.
  2. We can use swift-testing, which makes our test suite a lot simpler


#if !os(Linux)
// Skip on Linux, because `XCTExpectFailure` is unavailable on Linux
func testTimeout() async throws {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This test was in the project twice, so I removed it here

private let missingStub: Result<WpNetworkResponse, Error>?

var missingStub: Result<WpNetworkResponse, Error>?
init(stubs: [Stub] = [], missingStub: Result<WpNetworkResponse, Error>? = nil) {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Because SafeRequestExecutor needs to be Sendable, we need our stubs to be too.

The easiest way to do that is to just make them immutable, which doesn't change the code all that much

@jkmassel jkmassel marked this pull request as ready for review November 14, 2024 04:08
@jkmassel jkmassel enabled auto-merge (squash) November 14, 2024 04:10
Now all tests can run on Linux!
Foundation is now the same across all platforms, so we can use `URLSession.data(for:) async throws` on Linux now
Copy link
Contributor

@crazytonyli crazytonyli left a comment

Choose a reason for hiding this comment

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

🥳

@jkmassel jkmassel merged commit b54a394 into trunk Nov 14, 2024
22 checks passed
@jkmassel jkmassel deleted the upgrade/to-swift-6 branch November 14, 2024 10:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants