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
+3
View File
@@ -419,6 +419,9 @@ func TestHTTPServer_GetDashboardVersions_AccessControl(t *testing.T) {
}
func TestIntegrationDashboardAPIEndpoint(t *testing.T) {
if testing.Short() {
t.Skip("skipping integration test in short mode")
}
t.Run("Given two dashboards with the same title in different folders", func(t *testing.T) {
dashOne := dashboards.NewDashboard("dash")
dashOne.ID = 2
+12
View File
@@ -114,6 +114,9 @@ func setupTestEnvironment(t *testing.T, cfg *setting.Cfg, features featuremgmt.F
}
func TestIntegrationHTTPServer_GetFrontendSettings_hideVersionAnonymous(t *testing.T) {
if testing.Short() {
t.Skip("skipping integration test in short mode")
}
type buildInfo struct {
Version string `json:"version"`
Commit string `json:"commit"`
@@ -183,6 +186,9 @@ func TestIntegrationHTTPServer_GetFrontendSettings_hideVersionAnonymous(t *testi
}
func TestIntegrationHTTPServer_GetFrontendSettings_pluginsCDNBaseURL(t *testing.T) {
if testing.Short() {
t.Skip("skipping integration test in short mode")
}
type settings struct {
PluginsCDNBaseURL string `json:"pluginsCDNBaseURL"`
}
@@ -233,6 +239,9 @@ func TestIntegrationHTTPServer_GetFrontendSettings_pluginsCDNBaseURL(t *testing.
}
func TestIntegrationHTTPServer_GetFrontendSettings_apps(t *testing.T) {
if testing.Short() {
t.Skip("skipping integration test in short mode")
}
type settings struct {
Apps map[string]*plugins.AppDTO `json:"apps"`
}
@@ -463,6 +472,9 @@ func newAppSettings(id string, enabled bool) map[string]*pluginsettings.DTO {
}
func TestIntegrationHTTPServer_GetFrontendSettings_translations(t *testing.T) {
if testing.Short() {
t.Skip("skipping integration test in short mode")
}
type settings struct {
Datasources map[string]plugins.DataSourceDTO `json:"datasources"`
Panels map[string]*plugins.PanelDTO `json:"panels"`
+3
View File
@@ -65,6 +65,9 @@ func setUpGetOrgUsersDB(t *testing.T, sqlStore db.DB, cfg *setting.Cfg) {
}
func TestIntegrationOrgUsersAPIEndpoint_userLoggedIn(t *testing.T) {
if testing.Short() {
t.Skip("skipping integration test in short mode")
}
hs := setupSimpleHTTPServer(featuremgmt.WithFeatures())
settings := hs.Cfg
+3
View File
@@ -42,6 +42,9 @@ import (
)
func TestIntegrationCallResource(t *testing.T) {
if testing.Short() {
t.Skip("skipping integration test in short mode")
}
staticRootPath, err := filepath.Abs("../../public/")
require.NoError(t, err)
+3
View File
@@ -61,6 +61,9 @@ func TestMain(m *testing.M) {
}
func TestIntegrationDataSourceProxy_routeRule(t *testing.T) {
if testing.Short() {
t.Skip("skipping integration test in short mode")
}
cfg := &setting.Cfg{}
t.Run("Plugin with routes", func(t *testing.T) {
+12
View File
@@ -58,6 +58,9 @@ import (
const newEmail = "newemail@localhost"
func TestIntegrationUserAPIEndpoint_userLoggedIn(t *testing.T) {
if testing.Short() {
t.Skip("skipping integration test in short mode")
}
settings := setting.NewCfg()
sqlStore := db.InitTestDB(t, sqlstore.InitTestDBOpt{Cfg: settings})
hs := &HTTPServer{
@@ -405,6 +408,9 @@ func Test_GetUserByID(t *testing.T) {
}
func TestIntegrationHTTPServer_UpdateUser(t *testing.T) {
if testing.Short() {
t.Skip("skipping integration test in short mode")
}
settings := setting.NewCfg()
sqlStore := db.InitTestDB(t)
@@ -479,6 +485,9 @@ func setupUpdateEmailTests(t *testing.T, cfg *setting.Cfg) (*user.User, *HTTPSer
}
func TestIntegrationUser_UpdateEmail(t *testing.T) {
if testing.Short() {
t.Skip("skipping integration test in short mode")
}
cases := []struct {
Name string
Field user.UpdateEmailActionType
@@ -1154,6 +1163,9 @@ func updateUserScenario(t *testing.T, ctx updateUserContext, hs *HTTPServer) {
}
func TestIntegrationHTTPServer_UpdateSignedInUser(t *testing.T) {
if testing.Short() {
t.Skip("skipping integration test in short mode")
}
settings := setting.NewCfg()
sqlStore := db.InitTestDB(t)