Skip to content

Commit 0d37c85

Browse files
committed
fix json
1 parent d9e4903 commit 0d37c85

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

coderd/prometheusmetrics/prometheusmetrics_test.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package prometheusmetrics_test
22

33
import (
4+
"bytes"
45
"context"
56
"database/sql"
67
"encoding/json"
@@ -415,6 +416,7 @@ func TestAgentStats(t *testing.T) {
415416
// then
416417
goldenFile, err := os.ReadFile("testdata/agent-stats.json")
417418
require.NoError(t, err)
419+
goldenFile = bytes.TrimSpace(goldenFile)
418420

419421
collected := map[string]int{}
420422
var out []byte
@@ -448,7 +450,7 @@ func TestAgentStats(t *testing.T) {
448450
}
449451
}
450452

451-
out, err = json.MarshalIndent(collected, " ", " ")
453+
out, err = json.MarshalIndent(collected, "", " ")
452454
require.NoError(t, err)
453455

454456
return executionSeconds && string(goldenFile) == string(out)

0 commit comments

Comments
 (0)