Skip to content

Commit 71e2d79

Browse files
authored
tests: Run tests on Linux CI (#146)
* QueryEngine: Calculate stable hashes for Foundation.URL and FoundationEssentials.URL Until Swift 6.0, the fully-qualified name of the URL type was `Foundation.URL`. After the adoption of FoundationEssentials, the name changed to `FoundationEssentials.URL`. This difference causes the hashes to change, so for backwards compatibility we pin the type name to `Foundation.URL`. Fixes #45 * tests: Run tests on Linux CI The EndToEnd tests cannot currently be run: * they deadlock when run under `swift test` (#143) * the CI requires the use of an HTTP proxy to download from the Internet, but SDK generator does not support proxies (#145) The tests are not compiled on macOS, but this commit marks them with `XCTSkip` so they are not run on Linux either. Future commits will loosen these restrictions. Fixes #45
1 parent bde8791 commit 71e2d79

File tree

4 files changed

+10
-22
lines changed

4 files changed

+10
-22
lines changed

Docker/docker-compose.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ services:
2525

2626
test:
2727
<<: *common
28-
command: /bin/bash -xcl "./Utilities/test.sh $${WARN_AS_ERROR_ARG-} $${SANITIZER_ARG-} $${IMPORT_CHECK_ARG-}"
28+
command: /bin/bash -xcl "swift test $${WARN_AS_ERROR_ARG-} $${SANITIZER_ARG-} $${IMPORT_CHECK_ARG-}"
2929

3030
# util
3131

Sources/Helpers/Vendor/QueryEngine/CacheKey.swift

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,11 @@ extension FilePath.Component: LeafCacheKey {
167167

168168
extension URL: LeafCacheKey {
169169
func hash(with hashFunction: inout some HashFunction) {
170-
String(reflecting: Self.self).hash(with: &hashFunction)
170+
// Until Swift 6.0, the fully-qualified name of the URL type was `Foundation.URL`.
171+
// After the adoption of FoundationEssentials, the name changed to `FoundationEssentials.URL`.
172+
// This difference causes the hashes to change, so for backwards compatibility we pin the
173+
// type name to `Foundation.URL`.
174+
"Foundation.URL".hash(with: &hashFunction)
171175
self.description.hash(with: &hashFunction)
172176
}
173177
}

Tests/SwiftSDKGeneratorTests/EndToEndTests.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,8 @@ final class EndToEndTests: XCTestCase {
3939

4040
#if !os(macOS)
4141
func testPackageInitExecutable() async throws {
42+
throw XCTSkip("EndToEnd tests currently deadlock under `swift test`: https://github.com/swiftlang/swift-sdk-generator/issues/143")
43+
4244
let fm = FileManager.default
4345

4446
var packageDirectory = FilePath(#filePath)
@@ -102,6 +104,8 @@ final class EndToEndTests: XCTestCase {
102104
}
103105

104106
func testRepeatedSDKBuilds() async throws {
107+
throw XCTSkip("EndToEnd tests currently deadlock under `swift test`: https://github.com/swiftlang/swift-sdk-generator/issues/143")
108+
105109
let fm = FileManager.default
106110

107111
var packageDirectory = FilePath(#filePath)

Utilities/test.sh

Lines changed: 0 additions & 20 deletions
This file was deleted.

0 commit comments

Comments
 (0)