Files
grafana/pkg/services/sqlstore/migrations/ualert/testing.go
T
Grot (@grafanabot) 84da688400 [v9.4.x] Alerting: Pause dash alerts on migration (#62830)
Alerting: Pause dash alerts on migration (#62798)

* Alerting: Pause dash alerts on migration

(cherry picked from commit f49efa6e27)

Co-authored-by: George Robinson <george.robinson@grafana.com>
2023-02-02 22:07:06 +00:00

26 lines
528 B
Go

package ualert
import (
"testing"
"github.com/grafana/grafana/pkg/infra/log"
"github.com/grafana/grafana/pkg/services/sqlstore/migrator"
"github.com/prometheus/alertmanager/silence/silencepb"
)
// newTestMigration generates an empty migration to use in tests.
func newTestMigration(t *testing.T) *migration {
t.Helper()
return &migration{
mg: &migrator.Migrator{
Logger: log.New("test"),
},
seenUIDs: uidSet{
set: make(map[string]struct{}),
},
silences: make(map[int64][]*silencepb.MeshSilence),
}
}