Skip to content
This repository was archived by the owner on Dec 28, 2024. It is now read-only.

Commit

Permalink
Fix flaky metrics test
Browse files Browse the repository at this point in the history
  • Loading branch information
palkan committed Mar 7, 2018
1 parent aff1e41 commit 1e93997
Showing 1 changed file with 18 additions and 4 deletions.
22 changes: 18 additions & 4 deletions metrics/prometheus_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,23 +17,37 @@ func TestPrometheus(t *testing.T) {
m.Gauge("tests").Set(123)
m.Counter("test_total").Add(3)

expected := `
actual := m.Prometheus()

assert.Contains(t, actual,
`
# HELP anycable_go_test_total Total number of smth
# TYPE anycable_go_test_total counter
anycable_go_test_total 3
`,
)

assert.Contains(t, actual,
`
# HELP anycable_go_any_total Total number of anything
# TYPE anycable_go_any_total counter
anycable_go_any_total 0
`,
)

assert.Contains(t, actual,
`
# HELP anycable_go_tests Number of active smth
# TYPE anycable_go_tests gauge
anycable_go_tests 123
`,
)

assert.Contains(t, actual,
`
# HELP anycable_go_any_tests Number of active anything
# TYPE anycable_go_any_tests gauge
anycable_go_any_tests 0
`

assert.Equal(t, expected, m.Prometheus())
`,
)
}

0 comments on commit 1e93997

Please sign in to comment.