Skip to content

Commit b1a10ea

Browse files
committed
Fix Implicit capture of 'self' requires that ... conforms to Sendable warnings
1 parent 48c3212 commit b1a10ea

File tree

7 files changed

+24
-0
lines changed

7 files changed

+24
-0
lines changed

Tests/AppTests/AnalyzerTests.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -198,6 +198,7 @@ class AnalyzerTests: AppTestCase {
198198
XCTAssertEqual(pkg2.score, 40)
199199

200200
// ensure stats, recent packages, and releases are refreshed
201+
let app = self.app!
201202
try await XCTAssertEqualAsync(try await Stats.fetch(on: app.db).get(), .init(packageCount: 2))
202203
try await XCTAssertEqualAsync(try await RecentPackage.fetch(on: app.db).count, 2)
203204
try await XCTAssertEqualAsync(try await RecentRelease.fetch(on: app.db).count, 2)
@@ -310,6 +311,7 @@ class AnalyzerTests: AppTestCase {
310311
Current.git.shortlog = { @Sendable _ in "" }
311312

312313
// Ensure candidate selection is as expected
314+
let app = self.app!
313315
try await XCTAssertEqualAsync( try await Package.fetchCandidates(app.db, for: .ingestion, limit: 10).count, 0)
314316
try await XCTAssertEqualAsync( try await Package.fetchCandidates(app.db, for: .analysis, limit: 10).count, 1)
315317

@@ -682,6 +684,7 @@ class AnalyzerTests: AppTestCase {
682684
))
683685

684686
do { // validate
687+
let app = self.app!
685688
try await XCTAssertEqualAsync(try await Version.query(on: app.db).count(), 1)
686689
let v = try await XCTUnwrapAsync(await Version.query(on: app.db).first())
687690
XCTAssertEqual(v.docArchives, [.init(name: "foo", title: "Foo")])
@@ -705,6 +708,7 @@ class AnalyzerTests: AppTestCase {
705708
))
706709

707710
do { // validate
711+
let app = self.app!
708712
try await XCTAssertEqualAsync(try await Version.query(on: app.db).count(), 2)
709713
let versions = try await XCTUnwrapAsync(await Version.query(on: app.db).sort(\.$commit).all())
710714
XCTAssertEqual(versions[0].docArchives, [.init(name: "foo", title: "Foo")])

Tests/AppTests/ApiTests.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -577,6 +577,7 @@ class ApiTests: AppTestCase {
577577
let buildId = try b.requireID()
578578
let dto: API.PostDocReportDTO = .init(status: .ok)
579579
let body: ByteBuffer = .init(data: try JSONEncoder().encode(dto))
580+
let app = self.app!
580581

581582
// MUT - no auth header
582583
try await app.test(

Tests/AppTests/BuildTriggerTests.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1026,6 +1026,7 @@ class BuildTriggerTests: AppTestCase {
10261026

10271027
// validate
10281028
XCTAssertEqual(deleteCount, 1)
1029+
let app = self.app!
10291030
try await XCTAssertEqualAsync(try await Build.query(on: app.db).all().map(\.id), [.id1, .id2])
10301031
}
10311032

@@ -1061,6 +1062,7 @@ class BuildTriggerTests: AppTestCase {
10611062

10621063
// validate
10631064
XCTAssertEqual(deleteCount, 2)
1065+
let app = self.app!
10641066
try await XCTAssertEqualAsync(try await Build.query(on: app.db).all().map(\.id), [.id1])
10651067
}
10661068

Tests/AppTests/DocUploadTests.swift

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,8 @@ final class DocUploadTests: AppTestCase {
6666
let docUploadId = UUID()
6767
try await DocUpload(id: docUploadId, status: .ok)
6868
.attach(to: b, on: app.db)
69+
let app = self.app!
70+
6971
try await XCTAssertEqualAsync(try await Version.query(on: app.db).count(), 1)
7072
try await XCTAssertEqualAsync(try await Build.query(on: app.db).count(), 1)
7173
try await XCTAssertEqualAsync(try await DocUpload.query(on: app.db).count(), 1)
@@ -95,6 +97,7 @@ final class DocUploadTests: AppTestCase {
9597
try await b.save(on: app.db)
9698
try await DocUpload(id: UUID(), status: .ok)
9799
.attach(to: b, on: app.db)
100+
let app = self.app!
98101

99102
try await XCTAssertEqualAsync(try await Version.query(on: app.db).count(), 1)
100103
try await XCTAssertEqualAsync(try await Build.query(on: app.db).count(), 1)
@@ -120,6 +123,8 @@ final class DocUploadTests: AppTestCase {
120123
try await b.save(on: app.db)
121124
try await DocUpload(id: UUID(), status: .ok)
122125
.attach(to: b, on: app.db)
126+
let app = self.app!
127+
123128
try await XCTAssertEqualAsync(try await Version.query(on: app.db).count(), 1)
124129
try await XCTAssertEqualAsync(try await Build.query(on: app.db).count(), 1)
125130
try await XCTAssertEqualAsync(try await DocUpload.query(on: app.db).count(), 1)

Tests/AppTests/GitLiveTests.swift

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,20 +54,24 @@ class GitLiveTests: XCTestCase {
5454
extension GitLiveTests {
5555

5656
func test_commitCount() async throws {
57+
let path = self.path
5758
try await XCTAssertEqualAsync(try await Git.commitCount(at: path), 57)
5859
}
5960

6061
func test_firstCommitDate() async throws {
62+
let path = self.path
6163
try await XCTAssertEqualAsync(try await Git.firstCommitDate(at: path),
6264
Date(timeIntervalSince1970: 1426918070)) // Sat, 21 March 2015
6365
}
6466

6567
func test_lastCommitDate() async throws {
68+
let path = self.path
6669
try await XCTAssertEqualAsync(try await Git.lastCommitDate(at: path),
6770
Date(timeIntervalSince1970: 1554248253)) // Sat, 21 March 2015
6871
}
6972

7073
func test_getTags() async throws {
74+
let path = self.path
7175
try await XCTAssertEqualAsync(
7276
try await Git.getTags(at: path),
7377
[.tag(0,2,0),
@@ -93,11 +97,13 @@ extension GitLiveTests {
9397
}
9498

9599
func test_hasBranch() async throws {
100+
let path = self.path
96101
try await XCTAssertEqualAsync(try await Git.hasBranch(.branch("master"), at: path), true)
97102
try await XCTAssertEqualAsync(try await Git.hasBranch(.branch("main"), at: path), false)
98103
}
99104

100105
func test_revisionInfo() async throws {
106+
let path = self.path
101107
try await XCTAssertEqualAsync(try await Git.revisionInfo(.tag(0,5,2), at: path),
102108
.init(commit: "178566b112afe6bef3770678f1bbab6e5c626993",
103109
date: .init(timeIntervalSince1970: 1554248253)))
@@ -107,6 +113,7 @@ extension GitLiveTests {
107113
}
108114

109115
func test_shortlog() async throws {
116+
let path = self.path
110117
try await XCTAssertEqualAsync(try await Git.shortlog(at: path), """
111118
36\tNeil Pankey
112119
21\tJacob Williams

Tests/AppTests/IngestorTests.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,7 @@ class IngestorTests: AppTestCase {
100100

101101
// validate
102102
do {
103+
let app = self.app!
103104
try await XCTAssertEqualAsync(try await Repository.query(on: app.db).count(), 1)
104105
let repo = try await Repository.query(on: app.db).first().unwrap()
105106
XCTAssertEqual(repo.summary, "This is package foo/bar")
@@ -158,6 +159,7 @@ class IngestorTests: AppTestCase {
158159

159160
// validate
160161
do {
162+
let app = self.app!
161163
try await XCTAssertEqualAsync(try await Repository.query(on: app.db).count(), 1)
162164
let repo = try await Repository.query(on: app.db).first().unwrap()
163165
XCTAssertEqual(repo.defaultBranch, "main")
@@ -400,6 +402,7 @@ class IngestorTests: AppTestCase {
400402

401403
func test_ingest_storeS3Readme() async throws {
402404
// setup
405+
let app = self.app!
403406
let pkg = Package(url: "https://github.com/foo/bar".url, processingStage: .reconciliation)
404407
try await pkg.save(on: app.db)
405408
Current.fetchMetadata = { _, owner, repository in .mock(owner: owner, repository: repository) }
@@ -542,6 +545,7 @@ class IngestorTests: AppTestCase {
542545
try await ingest(client: app.client, database: app.db, mode: .limit(1))
543546

544547
// validate
548+
let app = self.app!
545549
try await XCTAssertEqualAsync(await Repository.query(on: app.db).count(), 1)
546550
let repo = try await XCTUnwrapAsync(await Repository.query(on: app.db).first())
547551
XCTAssertEqual(storeCalls.value, 1)

Tests/AppTests/PackageController+routesTests.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -225,6 +225,7 @@ class PackageController_routesTests: SnapshotTestCase {
225225
</p>
226226
</turbo-frame>
227227
""")
228+
let app = self.app!
228229
try await XCTAssertEqualAsync(try await Repository.query(on: app.db).count(), 1)
229230
let s3Readme = try await XCTUnwrapAsync(try await Repository.query(on: app.db).first()?.s3Readme)
230231
XCTAssert(s3Readme.isError)

0 commit comments

Comments
 (0)