// Test cases
func TestMain(M *testing.M) {
- alarmManager = NewAlarmManager("localhost:9093", 500)
+ alarmManager = NewAlarmManager("localhost:9093", 500, false)
alarmManager.alertInterval = 20000
go alarmManager.Run(false)
time.Sleep(time.Duration(10) * time.Second)
commandReady := make(chan bool, 1)
command := "cli/alarm-cli"
- args := []string {"gapam", "--active", "true", "--inhibited", "true", "--silenced", "--unprocessed", "true", "true", "--host", "localhost", "--port", "9093", "flushall"}
+ args := []string{"gapam", "--active", "true", "--inhibited", "true", "--silenced", "--unprocessed", "true", "true", "--host", "localhost", "--port", "9093", "flushall"}
ExecCLICommand(commandReady, command, args...)
<-commandReady
w.WriteHeader(200)
// Read alerts from file
payload, err := readJSONFromFile("../testresources/prometheus-alerts.json")
- if err != nil {
- t.Error("Failed to send response: ", err)
+ if err != nil {
+ t.Error("Failed to send response: ", err)
}
_, err = w.Write(payload)
if err != nil {