Skip to content

Commit e950a0b

Browse files
Merge pull request #3718 from SwiftPackageIndex/issue-3655-swift-testing-cleanup
Issue 3655 swift testing cleanup
2 parents ebbe9cc + f21aa51 commit e950a0b

16 files changed

+270
-791
lines changed

Package.resolved

Lines changed: 1 addition & 19 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Package.swift

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@ let package = Package(
3636
.package(url: "https://github.com/SwiftPackageIndex/SemanticVersion.git", from: "0.3.0"),
3737
.package(url: "https://github.com/SwiftPackageIndex/ShellOut.git", from: "3.1.4"),
3838
.package(url: "https://github.com/swiftlang/swift-package-manager.git", branch: "release/5.10"),
39-
.package(url: "https://github.com/dankinsoid/VaporToOpenAPI.git", from: "4.4.4"),
4039
.package(url: "https://github.com/pointfreeco/swift-custom-dump.git", from: "1.0.0"),
4140
.package(url: "https://github.com/pointfreeco/swift-dependencies", from: "1.8.0"),
4241
.package(url: "https://github.com/pointfreeco/swift-parsing.git", from: "0.12.0"),
@@ -75,7 +74,6 @@ let package = Package(
7574
.product(name: "SwiftPMDataModel-auto", package: "swift-package-manager"),
7675
.product(name: "SwiftPMPackageCollections", package: "swift-package-manager"),
7776
.product(name: "Vapor", package: "vapor"),
78-
.product(name: "VaporToOpenAPI", package: "VaporToOpenAPI"),
7977
.product(name: "SotoCognitoAuthentication", package: "soto-cognito-authentication")
8078
],
8179
swiftSettings: swiftSettings,

Sources/App/Controllers/API/Types+WithExample.swift

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

Sources/App/Core/AppMetrics.swift

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,17 +15,18 @@
1515
import Dependencies
1616
import Metrics
1717
import Prometheus
18+
import Synchronization
1819
import Vapor
1920

2021

2122
enum AppMetrics {
2223

23-
nonisolated(unsafe) static var initialized = false
24+
static let initialized = Mutex(false)
2425

2526
static func bootstrap() {
2627
// prevent tests from boostrapping multiple times
27-
guard !initialized else { return }
28-
defer { initialized = true }
28+
guard !initialized.withLock({ $0 }) else { return }
29+
defer { initialized.withLock{ $0 = true } }
2930
let client = PrometheusClient()
3031
MetricsSystem.bootstrap(PrometheusMetricsFactory(client: client))
3132
}

Sources/App/Core/Authentication/User.swift

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ import Authentication
1616
import Dependencies
1717
import JWTKit
1818
import Vapor
19-
import VaporToOpenAPI
2019

2120

2221
struct User: Authenticatable, Equatable {
@@ -67,15 +66,3 @@ extension User {
6766
}
6867
}
6968
}
70-
71-
72-
extension AuthSchemeObject {
73-
static var apiBearerToken: Self {
74-
.bearer(id: "api_token",
75-
description: "Token used for API access.")
76-
}
77-
static var builderBearerToken: Self {
78-
.bearer(id: "builder_token",
79-
description: "Token used for build result reporting.")
80-
}
81-
}

0 commit comments

Comments
 (0)