|
|
|
@ -8,6 +8,7 @@ import ( |
|
|
|
|
"testing" |
|
|
|
|
"time" |
|
|
|
|
|
|
|
|
|
"github.com/benbjohnson/clock" |
|
|
|
|
"github.com/grafana/grafana-plugin-sdk-go/data" |
|
|
|
|
"github.com/prometheus/client_golang/prometheus" |
|
|
|
|
"github.com/stretchr/testify/assert" |
|
|
|
@ -35,7 +36,7 @@ func TestDashboardAnnotations(t *testing.T) { |
|
|
|
|
ctx := context.Background() |
|
|
|
|
_, dbstore := tests.SetupTestEnv(t, 1) |
|
|
|
|
|
|
|
|
|
st := state.NewManager(log.New("test_stale_results_handler"), testMetrics.GetStateMetrics(), nil, dbstore, dbstore, &dashboards.FakeDashboardService{}, &image.NoopImageService{}) |
|
|
|
|
st := state.NewManager(log.New("test_stale_results_handler"), testMetrics.GetStateMetrics(), nil, dbstore, dbstore, &dashboards.FakeDashboardService{}, &image.NoopImageService{}, clock.New()) |
|
|
|
|
|
|
|
|
|
fakeAnnoRepo := store.NewFakeAnnotationsRepo() |
|
|
|
|
annotations.SetRepository(fakeAnnoRepo) |
|
|
|
@ -1880,7 +1881,7 @@ func TestProcessEvalResults(t *testing.T) { |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
for _, tc := range testCases { |
|
|
|
|
st := state.NewManager(log.New("test_state_manager"), testMetrics.GetStateMetrics(), nil, nil, &store.FakeInstanceStore{}, &dashboards.FakeDashboardService{}, &image.NotAvailableImageService{}) |
|
|
|
|
st := state.NewManager(log.New("test_state_manager"), testMetrics.GetStateMetrics(), nil, nil, &store.FakeInstanceStore{}, &dashboards.FakeDashboardService{}, &image.NotAvailableImageService{}, clock.New()) |
|
|
|
|
t.Run(tc.desc, func(t *testing.T) { |
|
|
|
|
fakeAnnoRepo := store.NewFakeAnnotationsRepo() |
|
|
|
|
annotations.SetRepository(fakeAnnoRepo) |
|
|
|
@ -1998,7 +1999,7 @@ func TestStaleResultsHandler(t *testing.T) { |
|
|
|
|
|
|
|
|
|
for _, tc := range testCases { |
|
|
|
|
ctx := context.Background() |
|
|
|
|
st := state.NewManager(log.New("test_stale_results_handler"), testMetrics.GetStateMetrics(), nil, dbstore, dbstore, &dashboards.FakeDashboardService{}, &image.NoopImageService{}) |
|
|
|
|
st := state.NewManager(log.New("test_stale_results_handler"), testMetrics.GetStateMetrics(), nil, dbstore, dbstore, &dashboards.FakeDashboardService{}, &image.NoopImageService{}, clock.New()) |
|
|
|
|
st.Warm(ctx) |
|
|
|
|
existingStatesForRule := st.GetStatesForRuleUID(rule.OrgID, rule.UID) |
|
|
|
|
|
|
|
|
|