Skip to content

Commit 1544443

Browse files
committed
Add swift-dependencies regression test
1 parent a21d31c commit 1544443

File tree

2 files changed

+24
-5
lines changed

2 files changed

+24
-5
lines changed

Tests/DocUploadBundleTests/DocUploadBundleTests.swift

Lines changed: 24 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -100,16 +100,35 @@ final class DocUploadBundleTests: XCTestCase {
100100
.init(bucket: "spi-prod-docs", path: "owner/name/feature-2.0.0"))
101101
}
102102

103-
func test_issue_3069() async throws {
103+
func test_issue_3069_swift_metrics() async throws {
104104
// https://github.com/SwiftPackageIndex/SwiftPackageIndex-Server/issues/3069
105105
try await withTempDir { tempDir in
106106
let url = fixtureUrl(for: "prod-apple-swift-metrics-main-e6a00d36.zip")
107107
XCTAssertNoThrow(
108-
try DocUploadBundle.unzip(bundle: url.path, outputPath: tempDir)
108+
try DocUploadBundle.unzip(bundle: url.path(), outputPath: tempDir)
109109
)
110-
XCTAssert(FileManager.default.fileExists(atPath: tempDir + "/metadata.json"))
111-
XCTAssert(FileManager.default.fileExists(atPath: tempDir + "/main/index.html"))
112-
XCTAssert(FileManager.default.fileExists(atPath: tempDir + "/main/index/index.json"))
110+
for pathComponent in ["metadata.json",
111+
"main/index.html",
112+
"main/index/index.json"] {
113+
let path = tempDir + "/" + pathComponent
114+
XCTAssertTrue(Foundation.FileManager.default.fileExists(atPath: path), "does not exist: \(path)")
115+
}
116+
}
117+
}
118+
119+
func test_issue_3069_swift_dependencies() async throws {
120+
// https://github.com/SwiftPackageIndex/SwiftPackageIndex-Server/issues/3069
121+
try await withTempDir { tempDir in
122+
let url = fixtureUrl(for: "dev-pointfreeco-swift-dependencies-1b9fc8fc0d7177b39d5f60ba86f70295b56d0589-cafecafe.zip")
123+
XCTAssertNoThrow(
124+
try DocUploadBundle.unzip(bundle: url.path(), outputPath: tempDir)
125+
)
126+
for pathComponent in ["metadata.json",
127+
"1b9fc8fc0d7177b39d5f60ba86f70295b56d0589/index.html",
128+
"1b9fc8fc0d7177b39d5f60ba86f70295b56d0589/index/index.json"] {
129+
let path = tempDir + "/" + pathComponent
130+
XCTAssertTrue(Foundation.FileManager.default.fileExists(atPath: path), "does not exist: \(path)")
131+
}
113132
}
114133
}
115134

0 commit comments

Comments
 (0)