@@ -61,18 +61,6 @@ extension AllTests.MetricsTests {
61
61
@Test func versions_added( ) async throws {
62
62
try await withApp { app in
63
63
// 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
- )
76
64
let pkg = try await savePackage ( on: app. db, " 1 " )
77
65
let new = [
78
66
try Version ( package : pkg, reference: . branch( " main " ) ) ,
@@ -91,16 +79,16 @@ extension AllTests.MetricsTests {
91
79
92
80
// validation
93
81
#expect(
94
- AppMetrics . analyzeVersionsAddedCount? . get ( . versionLabels( kind: . branch) ) == initialAddedBranch + 1
82
+ AppMetrics . analyzeVersionsAddedCount? . get ( . versionLabels( kind: . branch) ) == 1
95
83
)
96
84
#expect(
97
- AppMetrics . analyzeVersionsAddedCount? . get ( . versionLabels( kind: . tag) ) == initialAddedTag + 2
85
+ AppMetrics . analyzeVersionsAddedCount? . get ( . versionLabels( kind: . tag) ) == 2
98
86
)
99
87
#expect(
100
- AppMetrics . analyzeVersionsDeletedCount? . get ( . versionLabels( kind: . branch) ) == initialDeletedBranch + 1
88
+ AppMetrics . analyzeVersionsDeletedCount? . get ( . versionLabels( kind: . branch) ) == 1
101
89
)
102
90
#expect(
103
- AppMetrics . analyzeVersionsDeletedCount? . get ( . versionLabels( kind: . tag) ) == initialDeletedTag + 1
91
+ AppMetrics . analyzeVersionsDeletedCount? . get ( . versionLabels( kind: . tag) ) == 1
104
92
)
105
93
}
106
94
}
0 commit comments