More elaborate example e2e test case

This commit is contained in:
Fabian Reinartz 2015-09-30 14:55:19 +02:00
parent 251f3ec57c
commit ab2a3b1c6a
1 changed files with 11 additions and 3 deletions

View File

@ -7,16 +7,21 @@ import (
var somethingConfig = `
routes:
- send_to: "default"
group_wait: 1s
group_interval: 1s
notification_configs:
- name: "default"
send_resolved: true
webhook_configs:
- url: 'http://localhost:8088'
`
func TestSomething(T *testing.T) {
t := NewE2ETest(T, &E2ETestOpts{
timeFactor: 0.5,
timeFactor: 1,
tolerance: 0.2,
conf: somethingConfig,
})
@ -25,9 +30,12 @@ func TestSomething(T *testing.T) {
go runMockWebhook(":8088", co)
am.push(at(1), alert("alertname", "test"))
am.push(at(1), alert("alertname", "test").active(1))
am.push(at(3.5), alert("alertname", "test").active(1, 3))
co.want(between(2, 4), alert("alertname", "test"))
co.want(between(2, 2.5), alert("alertname", "test").active(1))
co.want(between(3, 3.5), alert("alertname", "test").active(1))
co.want(between(3.5, 4.5), alert("alertname", "test").active(1, 3))
t.Run()
}