Skip to content

Commit 342e951

Browse files
committed
Don't need to baseline counts anymore
1 parent cc255c6 commit 342e951

File tree

1 file changed

+4
-16
lines changed

1 file changed

+4
-16
lines changed

Tests/AppTests/MetricsTests.swift

Lines changed: 4 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -61,18 +61,6 @@ extension AllTests.MetricsTests {
6161
@Test func versions_added() async throws {
6262
try await withApp { app in
6363
// setup
64-
let initialAddedBranch = try #require(
65-
AppMetrics.analyzeVersionsAddedCount?.get(.versionLabels(kind: .branch))
66-
)
67-
let initialAddedTag = try #require(
68-
AppMetrics.analyzeVersionsAddedCount?.get(.versionLabels(kind: .tag))
69-
)
70-
let initialDeletedBranch = try #require(
71-
AppMetrics.analyzeVersionsDeletedCount?.get(.versionLabels(kind: .branch))
72-
)
73-
let initialDeletedTag = try #require(
74-
AppMetrics.analyzeVersionsDeletedCount?.get(.versionLabels(kind: .tag))
75-
)
7664
let pkg = try await savePackage(on: app.db, "1")
7765
let new = [
7866
try Version(package: pkg, reference: .branch("main")),
@@ -91,16 +79,16 @@ extension AllTests.MetricsTests {
9179

9280
// validation
9381
#expect(
94-
AppMetrics.analyzeVersionsAddedCount?.get(.versionLabels(kind: .branch)) == initialAddedBranch + 1
82+
AppMetrics.analyzeVersionsAddedCount?.get(.versionLabels(kind: .branch)) == 1
9583
)
9684
#expect(
97-
AppMetrics.analyzeVersionsAddedCount?.get(.versionLabels(kind: .tag)) == initialAddedTag + 2
85+
AppMetrics.analyzeVersionsAddedCount?.get(.versionLabels(kind: .tag)) == 2
9886
)
9987
#expect(
100-
AppMetrics.analyzeVersionsDeletedCount?.get(.versionLabels(kind: .branch)) == initialDeletedBranch + 1
88+
AppMetrics.analyzeVersionsDeletedCount?.get(.versionLabels(kind: .branch)) == 1
10189
)
10290
#expect(
103-
AppMetrics.analyzeVersionsDeletedCount?.get(.versionLabels(kind: .tag)) == initialDeletedTag + 1
91+
AppMetrics.analyzeVersionsDeletedCount?.get(.versionLabels(kind: .tag)) == 1
10492
)
10593
}
10694
}

0 commit comments

Comments
 (0)