Skip to content

Commit a6a15f2

Browse files
committed
fix tests, remove reports
1 parent d380287 commit a6a15f2

File tree

5 files changed

+5
-162
lines changed

5 files changed

+5
-162
lines changed

wasp/benchspy/direct_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -237,13 +237,13 @@ func TestBenchSpy_DirectQueryExecutor_Execute(t *testing.T) {
237237
// expected median latency: (150ms, 151ms>
238238
resultsAsFloats, err := ResultsAs(0.0, executor, string(MedianLatency), string(Percentile95Latency), string(Percentile99Latency), string(ErrorRate))
239239
assert.NoError(t, err)
240-
require.Equal(t, 3, len(resultsAsFloats))
240+
require.Equal(t, 4, len(resultsAsFloats))
241241
require.InDelta(t, 151.0, resultsAsFloats[string(MedianLatency)], 1.0)
242242

243243
// since we have 2-3 responses with 200-201ms latency, the 95th percentile should be (200ms, 201ms>
244244
require.InDelta(t, 201.0, resultsAsFloats[string(Percentile95Latency)], 1.0)
245-
// since we have 2-3 responses with 200-201ms latency, the 99th percentile should be (200ms, 202ms>
246-
require.InDelta(t, 202.0, resultsAsFloats[string(Percentile99Latency)], 1.0)
245+
// since we have 2-3 responses with 200-201ms latency, the 99th percentile should be (199ms, 203ms>
246+
require.InDelta(t, 201.0, resultsAsFloats[string(Percentile99Latency)], 2.0)
247247

248248
errorRate, exists := resultsAsFloats[string(ErrorRate)]
249249
assert.True(t, exists)

wasp/benchspy/report.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ func CompareDirectWithThresholds(medianThreshold, p95Threshold, p99Threshold, ma
178178
Str("Previous report", previousReport.CommitOrTag).
179179
Float64("Median threshold", medianThreshold).
180180
Float64("P95 threshold", p95Threshold).
181-
Float64("P95 threshold", p99Threshold).
181+
Float64("P99 threshold", p99Threshold).
182182
Float64("Max threshold", maxThreshold).
183183
Float64("Error rate threshold", errorRateThreshold).
184184
Msg("Comparing Direct metrics with thresholds")

wasp/benchspy/report_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1621,7 +1621,7 @@ func TestBenchSpy_CompareDirectWithThresholds(t *testing.T) {
16211621
assert.True(t, failed)
16221622
assert.NotNil(t, err)
16231623
assert.Contains(t, err.Error(), fmt.Sprintf("[test-gen] %s metric results were missing from previous report", string(Percentile95Latency)))
1624-
assert.Contains(t, err.Error(), fmt.Sprintf("[test-gen] %s metric results were missing from current report", string(Percentile99Latency)))
1624+
assert.Contains(t, err.Error(), fmt.Sprintf("[test-gen] %s metric results were missing from previous report", string(Percentile99Latency)))
16251625
assert.Contains(t, err.Error(), fmt.Sprintf("[test-gen] %s metric results were missing from previous report", string(MaxLatency)))
16261626
assert.Contains(t, err.Error(), fmt.Sprintf("[test-gen] %s metric results were missing from previous report", string(ErrorRate)))
16271627
})

wasp/examples/benchspy/direct_query_executor/test_performance_reports/TestBenchSpy_Standard_Direct_Metrics-v1.json

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

wasp/examples/benchspy/direct_query_executor/test_performance_reports/TestBenchSpy_Standard_Direct_Metrics_Two_Generators-v1.json

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

0 commit comments

Comments
 (0)