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
@@ -63,6 +63,9 @@ func (d *dataSourceMockRetriever) GetDataSource(ctx context.Context, query *data
}
func TestIntegrationService_AddDataSource(t *testing.T) {
if testing.Short() {
t.Skip("skipping integration test in short mode")
}
t.Run("should not fail if the plugin is not installed", func(t *testing.T) {
dsService := initDSService(t)
dsService.pluginStore = &pluginstore.FakePluginStore{
@@ -354,6 +357,9 @@ func TestService_getAvailableName(t *testing.T) {
}
func TestIntegrationService_UpdateDataSource(t *testing.T) {
if testing.Short() {
t.Skip("skipping integration test in short mode")
}
t.Run("should return not found error if datasource not found", func(t *testing.T) {
dsService := initDSService(t)
@@ -804,6 +810,9 @@ func TestIntegrationService_UpdateDataSource(t *testing.T) {
}
func TestIntegrationService_DeleteDataSource(t *testing.T) {
if testing.Short() {
t.Skip("skipping integration test in short mode")
}
t.Run("should not return an error if data source doesn't exist", func(t *testing.T) {
sqlStore := db.InitTestDB(t)
secretsService := secretsmng.SetupTestService(t, fakes.NewFakeSecretsStore())
@@ -1081,6 +1090,9 @@ func TestService_awsServiceNamespace(t *testing.T) {
//nolint:goconst
func TestIntegrationService_GetHttpTransport(t *testing.T) {
if testing.Short() {
t.Skip("skipping integration test in short mode")
}
cfg := &setting.Cfg{}
t.Run("Should use cached proxy", func(t *testing.T) {
@@ -1493,6 +1505,9 @@ func TestIntegrationService_GetHttpTransport(t *testing.T) {
}
func TestIntegrationService_getProxySettings(t *testing.T) {
if testing.Short() {
t.Skip("skipping integration test in short mode")
}
sqlStore := db.InitTestDB(t)
secretsService := secretsmng.SetupTestService(t, fakes.NewFakeSecretsStore())
secretsStore := secretskvs.NewSQLSecretsKVStore(sqlStore, secretsService, log.New("test.logger"))
@@ -1571,6 +1586,9 @@ func TestIntegrationService_getProxySettings(t *testing.T) {
}
func TestIntegrationService_getTimeout(t *testing.T) {
if testing.Short() {
t.Skip("skipping integration test in short mode")
}
cfg := &setting.Cfg{}
originalTimeout := sdkhttpclient.DefaultTimeoutOptions.Timeout
sdkhttpclient.DefaultTimeoutOptions.Timeout = time.Minute
@@ -1605,6 +1623,9 @@ func TestIntegrationService_getTimeout(t *testing.T) {
}
func TestIntegrationService_GetDecryptedValues(t *testing.T) {
if testing.Short() {
t.Skip("skipping integration test in short mode")
}
t.Run("should migrate and retrieve values from secure json data", func(t *testing.T) {
ds := &datasources.DataSource{
ID: 1,
@@ -1664,6 +1685,9 @@ func TestIntegrationService_GetDecryptedValues(t *testing.T) {
}
func TestIntegrationDataSource_CustomHeaders(t *testing.T) {
if testing.Short() {
t.Skip("skipping integration test in short mode")
}
sqlStore := db.InitTestDB(t)
secretsService := secretsmng.SetupTestService(t, fakes.NewFakeSecretsStore())
secretsStore := secretskvs.NewSQLSecretsKVStore(sqlStore, secretsService, log.New("test.logger"))