From 7312a2dab0c9fad6faee29bb6133a0485df11b4b Mon Sep 17 00:00:00 2001 From: Joe Blubaugh Date: Mon, 10 Oct 2022 13:54:54 +0800 Subject: [PATCH] Alerting: Mark all tests that interact with the database as Integration tests. (#54875) Previously, two tests were not explicitly marked as integration tests and so were not run against all 3 supported databases in the CI environment. --- pkg/services/ngalert/store/alert_rule_test.go | 5 ++--- pkg/services/ngalert/store/provisioning_store_test.go | 2 +- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/pkg/services/ngalert/store/alert_rule_test.go b/pkg/services/ngalert/store/alert_rule_test.go index 41a48df7021..3a23bf66358 100644 --- a/pkg/services/ngalert/store/alert_rule_test.go +++ b/pkg/services/ngalert/store/alert_rule_test.go @@ -17,7 +17,7 @@ import ( "github.com/grafana/grafana/pkg/util" ) -func TestUpdateAlertRules(t *testing.T) { +func TestIntegrationUpdateAlertRules(t *testing.T) { sqlStore := sqlstore.InitTestDB(t) store := DBstore{ SQLStore: sqlStore, @@ -26,7 +26,6 @@ func TestUpdateAlertRules(t *testing.T) { }, } createRule := func(t *testing.T) *models.AlertRule { - t.Helper() rule := models.AlertRuleGen(withIntervalMatching(store.Cfg.BaseInterval))() err := sqlStore.WithDbSession(context.Background(), func(sess *sqlstore.DBSession) error { _, err := sess.Table(models.AlertRule{}).InsertOne(rule) @@ -94,7 +93,7 @@ func withIntervalMatching(baseInterval time.Duration) func(*models.AlertRule) { } } -func Test_getFilterByOrgsString(t *testing.T) { +func TestIntegration_getFilterByOrgsString(t *testing.T) { testCases := []struct { testName string orgs map[int64]struct{} diff --git a/pkg/services/ngalert/store/provisioning_store_test.go b/pkg/services/ngalert/store/provisioning_store_test.go index f8c8cac2cc6..356079ae022 100644 --- a/pkg/services/ngalert/store/provisioning_store_test.go +++ b/pkg/services/ngalert/store/provisioning_store_test.go @@ -14,7 +14,7 @@ import ( const testAlertingIntervalSeconds = 10 -func TestProvisioningStore(t *testing.T) { +func TestIntegrationProvisioningStore(t *testing.T) { store := createProvisioningStoreSut(tests.SetupTestEnv(t, testAlertingIntervalSeconds)) t.Run("Default provenance of a known type is None", func(t *testing.T) {