Skip to content

Commit f1d3572

Browse files
committed
Conditionally disable http client test on certain Linux platforms
1 parent 472bdf1 commit f1d3572

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

Tests/SwiftlyTests/HTTPClientTests.swift

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,10 @@ import Testing
2929
}
3030

3131
@Test func getSwiftToolchain() async throws {
32+
guard case let pd = try await Swiftly.currentPlatform.detectPlatform(SwiftlyTests.ctx, disableConfirmation: true, platform: nil), pd != PlatformDefinition.rhel9 && pd != PlatformDefinition.ubuntu2004 else {
33+
return
34+
}
35+
3236
let tmpFile = mktemp()
3337
try await create(file: tmpFile, contents: nil)
3438
let tmpFileSignature = mktemp(ext: ".sig")
@@ -58,6 +62,10 @@ import Testing
5862
}
5963

6064
@Test func getSwiftlyRelease() async throws {
65+
guard case let pd = try await Swiftly.currentPlatform.detectPlatform(SwiftlyTests.ctx, disableConfirmation: true, platform: nil), pd != PlatformDefinition.rhel9 && pd != PlatformDefinition.ubuntu2004 else {
66+
return
67+
}
68+
6169
let tmpFile = mktemp()
6270
try await create(file: tmpFile, contents: nil)
6371
let tmpFileSignature = mktemp(ext: ".sig")
@@ -87,6 +95,10 @@ import Testing
8795
}
8896

8997
@Test func getSwiftlyReleaseMetadataFromSwiftOrg() async throws {
98+
guard case let pd = try await Swiftly.currentPlatform.detectPlatform(SwiftlyTests.ctx, disableConfirmation: true, platform: nil), pd != PlatformDefinition.rhel9 && pd != PlatformDefinition.ubuntu2004 else {
99+
return
100+
}
101+
90102
let httpClient = SwiftlyHTTPClient(httpRequestExecutor: HTTPRequestExecutorImpl())
91103
do {
92104
let currentRelease = try await httpClient.getCurrentSwiftlyRelease()
@@ -102,6 +114,10 @@ import Testing
102114
[PlatformDefinition.macOS, .ubuntu2404, .ubuntu2204, .rhel9, .fedora39, .amazonlinux2, .debian12],
103115
[SwiftlyWebsiteAPI.Components.Schemas.Architecture.x8664, .aarch64]
104116
) func getToolchainMetdataFromSwiftOrg(_ platform: PlatformDefinition, _ arch: SwiftlyWebsiteAPI.Components.Schemas.Architecture) async throws {
117+
guard case let pd = try await Swiftly.currentPlatform.detectPlatform(SwiftlyTests.ctx, disableConfirmation: true, platform: nil), pd != PlatformDefinition.rhel9 && pd != PlatformDefinition.ubuntu2004 else {
118+
return
119+
}
120+
105121
let httpClient = SwiftlyHTTPClient(httpRequestExecutor: HTTPRequestExecutorImpl())
106122

107123
let branches: [ToolchainVersion.Snapshot.Branch] = [

0 commit comments

Comments
 (0)