mirror of https://github.com/statping/statping
test fix
parent
1b3750e165
commit
386d9a49b9
|
@ -248,8 +248,6 @@ func TestMainApiRoutes(t *testing.T) {
|
||||||
ExpectedContains: []string{
|
ExpectedContains: []string{
|
||||||
`go_goroutines`,
|
`go_goroutines`,
|
||||||
`go_memstats_alloc_bytes`,
|
`go_memstats_alloc_bytes`,
|
||||||
`process_cpu_seconds_total`,
|
|
||||||
`promhttp_metric_handler_requests_total`,
|
|
||||||
`go_threads`,
|
`go_threads`,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
|
@ -432,7 +432,7 @@ func TestServices(t *testing.T) {
|
||||||
item, err := Find(1)
|
item, err := Find(1)
|
||||||
require.Nil(t, err)
|
require.Nil(t, err)
|
||||||
amount := item.Downtime().Seconds()
|
amount := item.Downtime().Seconds()
|
||||||
assert.Equal(t, "25", fmt.Sprintf("%0.f", amount))
|
assert.Equal(t, "75", fmt.Sprintf("%0.f", amount))
|
||||||
})
|
})
|
||||||
|
|
||||||
t.Run("Test Failures Since", func(t *testing.T) {
|
t.Run("Test Failures Since", func(t *testing.T) {
|
||||||
|
|
|
@ -89,9 +89,9 @@ func TestDeleteFile(t *testing.T) {
|
||||||
|
|
||||||
func TestFormatDuration(t *testing.T) {
|
func TestFormatDuration(t *testing.T) {
|
||||||
dur, _ := time.ParseDuration("158s")
|
dur, _ := time.ParseDuration("158s")
|
||||||
assert.Equal(t, "3 minutes", FormatDuration(dur))
|
assert.Equal(t, "2 minutes 38 seconds", FormatDuration(dur))
|
||||||
dur, _ = time.ParseDuration("-65s")
|
dur, _ = time.ParseDuration("-65s")
|
||||||
assert.Equal(t, "1 minute", FormatDuration(dur))
|
assert.Equal(t, "-1 minute 5 seconds", FormatDuration(dur))
|
||||||
dur, _ = time.ParseDuration("3s")
|
dur, _ = time.ParseDuration("3s")
|
||||||
assert.Equal(t, "3 seconds", FormatDuration(dur))
|
assert.Equal(t, "3 seconds", FormatDuration(dur))
|
||||||
dur, _ = time.ParseDuration("48h")
|
dur, _ = time.ParseDuration("48h")
|
||||||
|
|
Loading…
Reference in New Issue