Chore: Omit integration tests if short test flag is passed (#108777)

* omit integration tests if short test flag is passed

* Update pkg/services/ngalert/models/receivers_test.go

Co-authored-by: Matheus Macabu <macabu@users.noreply.github.com>

* Update pkg/tests/api/alerting/api_ruler_test.go

Co-authored-by: Matheus Macabu <macabu@users.noreply.github.com>

* Update pkg/tests/api/alerting/api_ruler_test.go

Co-authored-by: Matheus Macabu <macabu@users.noreply.github.com>

* Update pkg/tests/api/alerting/api_ruler_test.go

Co-authored-by: Matheus Macabu <macabu@users.noreply.github.com>

* Update pkg/tests/api/alerting/api_ruler_test.go

Co-authored-by: Matheus Macabu <macabu@users.noreply.github.com>

* Update pkg/tests/api/alerting/api_ruler_test.go

Co-authored-by: Matheus Macabu <macabu@users.noreply.github.com>

* Update pkg/services/ngalert/models/receivers_test.go

Co-authored-by: Matheus Macabu <macabu@users.noreply.github.com>

* Update pkg/cmd/grafana-cli/commands/datamigrations/to_unified_storage_test.go

Co-authored-by: Matheus Macabu <macabu@users.noreply.github.com>

* Update pkg/services/ngalert/models/receivers_test.go

Co-authored-by: Matheus Macabu <macabu@users.noreply.github.com>

* fix the rest

* false positive

---------

Co-authored-by: Matheus Macabu <macabu@users.noreply.github.com>
This commit is contained in:
Serge Zaitsev
2025-07-28 13:38:54 +02:00
committed by GitHub
co-authored by Matheus Macabu
parent 1a7a7f1d99
commit a95fb3a37c
103 changed files with 830 additions and 22 deletions
@@ -39,6 +39,9 @@ func newTestBackend(b testing.TB) resource.StorageBackend {
}
func TestIntegrationBenchmarkSQLStorageBackend(t *testing.T) {
if testing.Short() {
t.Skip("skipping integration test in short mode")
}
tests.SkipIntegrationTestInShortMode(t)
opts := test.DefaultBenchmarkOptions()
if db.IsTestDbSQLite() {
@@ -48,6 +51,9 @@ func TestIntegrationBenchmarkSQLStorageBackend(t *testing.T) {
}
func TestIntegrationBenchmarkResourceServer(t *testing.T) {
if testing.Short() {
t.Skip("skipping integration test in short mode")
}
tests.SkipIntegrationTestInShortMode(t)
ctx := context.Background()
@@ -36,6 +36,9 @@ func TestMain(m *testing.M) {
}
func TestIntegrationStorageServer(t *testing.T) {
if testing.Short() {
t.Skip("skipping integration test in short mode")
}
unitest.RunStorageServerTest(t, func(ctx context.Context) resource.StorageBackend {
dbstore := db.InitTestDB(t)
eDB, err := dbimpl.ProvideResourceDB(dbstore, setting.NewCfg(), nil)
@@ -56,6 +59,9 @@ func TestIntegrationStorageServer(t *testing.T) {
// TestStorageBackend is a test for the StorageBackend interface.
func TestIntegrationSQLStorageBackend(t *testing.T) {
if testing.Short() {
t.Skip("skipping integration test in short mode")
}
t.Run("IsHA (polling notifier)", func(t *testing.T) {
unitest.RunStorageBackendTest(t, func(ctx context.Context) resource.StorageBackend {
dbstore := db.InitTestDB(t)
@@ -96,6 +102,9 @@ func TestIntegrationSQLStorageBackend(t *testing.T) {
}
func TestIntegrationSearchAndStorage(t *testing.T) {
if testing.Short() {
t.Skip("skipping integration test in short mode")
}
tests.SkipIntegrationTestInShortMode(t)
ctx := context.Background()