Skip to content

Commit c6dc9b3

Browse files
committed
Update to VaporTesting
1 parent 49a8d0d commit c6dc9b3

File tree

65 files changed

+581
-580
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

65 files changed

+581
-580
lines changed

Package.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ let package = Package(
9595
.product(name: "DependenciesTestSupport", package: "swift-dependencies"),
9696
.product(name: "SnapshotTesting", package: "swift-snapshot-testing"),
9797
.product(name: "InlineSnapshotTesting", package: "swift-snapshot-testing"),
98-
.product(name: "XCTVapor", package: "vapor"),
98+
.product(name: "VaporTesting", package: "vapor"),
9999
.target(name: "App"),
100100
],
101101
exclude: ["__Snapshots__", "Fixtures"],

Tests/AppTests/API+PackageController+GetRoute+ModelTests.swift

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ extension AllTests.API_PackageController_GetRoute_ModelTests {
2626

2727
@Test func init_no_packageName() async throws {
2828
// Tests behaviour when we're lacking data
29-
try await withApp { app in
29+
try await withSPIApp { app in
3030
// setup package without package name
3131
let pkg = try await savePackage(on: app.db, "1".url)
3232
try await Repository(package: pkg, name: "bar", owner: "foo").save(on: app.db)
@@ -56,7 +56,7 @@ extension AllTests.API_PackageController_GetRoute_ModelTests {
5656
}
5757

5858
@Test func init_packageIdentity() async throws {
59-
try await withApp { app in
59+
try await withSPIApp { app in
6060
let pkg = try await savePackage(on: app.db, URL(string: "https://github.com/foo/swift-bar.git")!)
6161
try await Repository(package: pkg, name: "bar", owner: "foo").save(on: app.db)
6262
let version = try App.Version(package: pkg, latest: .defaultBranch, packageName: nil, reference: .branch("main"))
@@ -81,7 +81,7 @@ extension AllTests.API_PackageController_GetRoute_ModelTests {
8181
}
8282

8383
@Test func init_generated_documentation() async throws {
84-
try await withApp { app in
84+
try await withSPIApp { app in
8585
let pkg = try await savePackage(on: app.db, "1".url)
8686
try await Repository(package: pkg, name: "bar", owner: "foo").save(on: app.db)
8787
let version = try App.Version(package: pkg, latest: .defaultBranch, packageName: nil, reference: .branch("main"))
@@ -107,7 +107,7 @@ extension AllTests.API_PackageController_GetRoute_ModelTests {
107107
}
108108

109109
@Test func init_external_documentation() async throws {
110-
try await withApp { app in
110+
try await withSPIApp { app in
111111
let pkg = try await savePackage(on: app.db, "1".url)
112112
try await Repository(package: pkg, name: "bar", owner: "foo").save(on: app.db)
113113
let version = try App.Version(package: pkg, latest: .defaultBranch, packageName: nil, reference: .branch("main"))
@@ -137,7 +137,7 @@ extension AllTests.API_PackageController_GetRoute_ModelTests {
137137
}
138138

139139
@Test func ForkedFromInfo_query() async throws {
140-
try await withApp { app in
140+
try await withSPIApp { app in
141141
let originalPkg = try await savePackage(on: app.db, id: .id0, "https://github.com/original/original")
142142
try await Repository(package: originalPkg,
143143
name: "original",
@@ -159,7 +159,7 @@ extension AllTests.API_PackageController_GetRoute_ModelTests {
159159

160160
@Test func ForkedFromInfo_query_fallback() async throws {
161161
// when the package can't be found resort to fallback URL
162-
try await withApp { app in
162+
try await withSPIApp { app in
163163
// MUT
164164
let forkedFrom = await API.PackageController.GetRoute.Model.ForkedFromInfo.query(on: app.db, packageId: .id0, fallbackURL: "https://github.com/original/original.git")
165165

@@ -544,7 +544,7 @@ extension AllTests.API_PackageController_GetRoute_ModelTests {
544544
}
545545

546546
@Test func groupBuildInfo() async throws {
547-
try await withApp { app in
547+
try await withSPIApp { app in
548548
let result1: BuildResults = .init(results: [.v5_8: .compatible,
549549
.v5_9: .compatible,
550550
.v5_10: .compatible,
@@ -595,7 +595,7 @@ extension AllTests.API_PackageController_GetRoute_ModelTests {
595595
}
596596

597597
@Test func languagePlatformInfo() async throws {
598-
try await withApp { app in
598+
try await withSPIApp { app in
599599
// setup
600600
let pkg = try await savePackage(on: app.db, "1")
601601
try await Repository(package: pkg,

Tests/AppTests/API+PackageController+GetRouteTests.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ extension AllTests.API_PackageController_GetRouteTests {
2222
typealias PackageResult = PackageController.PackageResult
2323

2424
@Test func releaseInfo() async throws {
25-
try await withApp { app in
25+
try await withSPIApp { app in
2626
// setup
2727
let pkg = try await savePackage(on: app.db, "1")
2828
try await Repository(package: pkg,
@@ -70,7 +70,7 @@ extension AllTests.API_PackageController_GetRouteTests {
7070

7171
@Test func releaseInfo_exclude_non_latest() async throws {
7272
// Test to ensure that we don't include versions with `latest IS NULL`
73-
try await withApp { app in
73+
try await withSPIApp { app in
7474
// setup
7575
let pkg = try await savePackage(on: app.db, "1")
7676
try await Repository(package: pkg,

Tests/AppTests/API+PackageControllerTests.swift

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ extension AllTests.API_PackageControllerTests {
2727
try await withDependencies {
2828
$0.date.now = .december15_2020
2929
} operation: {
30-
try await withApp { app in
30+
try await withSPIApp { app in
3131
let pkg = try await savePackage(on: app.db, "1")
3232
try await Repository(package: pkg,
3333
commitCount: 1433,
@@ -66,7 +66,7 @@ extension AllTests.API_PackageControllerTests {
6666
try await withDependencies {
6767
$0.date.now = .december15_2020
6868
} operation: {
69-
try await withApp { app in
69+
try await withSPIApp { app in
7070
let pkg = try await savePackage(on: app.db, "1")
7171
try await Repository(package: pkg,
7272
commitCount: 1433,
@@ -137,7 +137,7 @@ extension AllTests.API_PackageControllerTests {
137137

138138
@Test func ProductCount_query() async throws {
139139
// setup
140-
try await withApp { app in
140+
try await withSPIApp { app in
141141
let pkg = try await savePackage(on: app.db, "1")
142142
try await Repository(package: pkg,
143143
defaultBranch: "main",
@@ -285,7 +285,7 @@ extension AllTests.API_PackageControllerTests {
285285

286286
@Test func BuildInfo_query() async throws {
287287
// setup
288-
try await withApp { app in
288+
try await withSPIApp { app in
289289
do {
290290
let pkg = try await savePackage(on: app.db, "1".url)
291291
try await Repository(package: pkg,
@@ -353,7 +353,7 @@ extension AllTests.API_PackageControllerTests {
353353

354354
@Test func GetRoute_query() async throws {
355355
// ensure GetRoute.query is wired up correctly (detailed tests are elsewhere)
356-
try await withApp { app in
356+
try await withSPIApp { app in
357357
// setup
358358
let pkg = try await savePackage(on: app.db, "1")
359359
try await Repository(package: pkg, name: "bar", owner: "foo")

Tests/AppTests/API_DependencyControllerTests.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ import Vapor
2121
extension AllTests.API_DependencyControllerTests {
2222

2323
@Test func query() async throws {
24-
try await withApp { app in
24+
try await withSPIApp { app in
2525
// setup
2626
let pkg = try await savePackage(on: app.db, id: .id0, "http://github.com/foo/bar")
2727
try await Repository(package: pkg,

Tests/AppTests/AnalyzeErrorTests.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ extension AllTests.AnalyzeErrorTests {
6262

6363
@Test func analyze_refreshCheckout_failed() async throws {
6464
let capturingLogger = CapturingLogger()
65-
try await withApp(setup, defaultDependencies) { app in
65+
try await withSPIApp(setup, defaultDependencies) { app in
6666
try await withDependencies {
6767
$0.environment.loadSPIManifest = { _ in nil }
6868
$0.fileManager.fileExists = { @Sendable _ in true }
@@ -96,7 +96,7 @@ extension AllTests.AnalyzeErrorTests {
9696

9797
@Test func analyze_updateRepository_invalidPackageCachePath() async throws {
9898
let capturingLogger = CapturingLogger()
99-
try await withApp(setup, defaultDependencies) { app in
99+
try await withSPIApp(setup, defaultDependencies) { app in
100100
try await withDependencies {
101101
$0.environment.loadSPIManifest = { _ in nil }
102102
$0.fileManager.fileExists = { @Sendable _ in true }
@@ -126,7 +126,7 @@ extension AllTests.AnalyzeErrorTests {
126126

127127
@Test func analyze_getPackageInfo_gitCheckout_error() async throws {
128128
let capturingLogger = CapturingLogger()
129-
try await withApp(setup, defaultDependencies) { app in
129+
try await withSPIApp(setup, defaultDependencies) { app in
130130
try await withDependencies {
131131
$0.environment.loadSPIManifest = { _ in nil }
132132
$0.fileManager.fileExists = { @Sendable _ in true }
@@ -157,7 +157,7 @@ extension AllTests.AnalyzeErrorTests {
157157

158158
@Test func analyze_dumpPackage_missing_manifest() async throws {
159159
let capturingLogger = CapturingLogger()
160-
try await withApp(setup, defaultDependencies) { app in
160+
try await withSPIApp(setup, defaultDependencies) { app in
161161
try await withDependencies {
162162
$0.environment.loadSPIManifest = { _ in nil }
163163
$0.fileManager.fileExists = { @Sendable path in

0 commit comments

Comments
 (0)