Skip to content

Commit 77fcc6b

Browse files
committed
Correct the serverURL for swift.org and add an integration test to verify it
1 parent 90457aa commit 77fcc6b

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

Sources/SwiftlyCore/HTTPClient.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ internal class HTTPRequestExecutorImpl: HTTPRequestExecutor {
120120
let swiftlyUserAgent = SwiftlyUserAgentMiddleware()
121121

122122
let client = Client(
123-
serverURL: URL(string: "https://swift.org/api")!,
123+
serverURL: try Servers.Server1.url(),
124124
transport: AsyncHTTPClientTransport(configuration: config),
125125
middlewares: [swiftlyUserAgent]
126126
)

Tests/SwiftlyTests/HTTPClientTests.swift

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,12 @@ final class HTTPClientTests: SwiftlyTests {
4545
XCTAssertTrue(exceptionThrown)
4646
}
4747

48-
func testGetMetdataFromSwiftOrg() async throws {
48+
func testGetSwiftlyReleaseMetadataFromSwiftOrg() async throws {
49+
let currentRelease = try await SwiftlyCore.httpClient.getCurrentSwiftlyRelease()
50+
XCTAssertNoThrow(try currentRelease.swiftlyVersion)
51+
}
52+
53+
func testGetToolchainMetdataFromSwiftOrg() async throws {
4954
let supportedPlatforms = [
5055
PlatformDefinition.macOS,
5156
PlatformDefinition.ubuntu2404,

0 commit comments

Comments
 (0)