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:
co-authored by
Matheus Macabu
parent
1a7a7f1d99
commit
a95fb3a37c
@@ -50,6 +50,9 @@ func setupTestEnv(t testing.TB) *Service {
|
||||
}
|
||||
|
||||
func TestIntegrationUsageMetrics(t *testing.T) {
|
||||
if testing.Short() {
|
||||
t.Skip("skipping integration test in short mode")
|
||||
}
|
||||
tests := []struct {
|
||||
name string
|
||||
expectedValue int
|
||||
@@ -81,6 +84,9 @@ func TestIntegrationUsageMetrics(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestIntegrationService_DeclareFixedRoles(t *testing.T) {
|
||||
if testing.Short() {
|
||||
t.Skip("skipping integration test in short mode")
|
||||
}
|
||||
tests := []struct {
|
||||
name string
|
||||
registrations []accesscontrol.RoleRegistration
|
||||
@@ -166,6 +172,9 @@ func TestIntegrationService_DeclareFixedRoles(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestIntegrationService_DeclarePluginRoles(t *testing.T) {
|
||||
if testing.Short() {
|
||||
t.Skip("skipping integration test in short mode")
|
||||
}
|
||||
tests := []struct {
|
||||
name string
|
||||
pluginID string
|
||||
@@ -279,6 +288,9 @@ func TestIntegrationService_DeclarePluginRoles(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestIntegrationService_RegisterFixedRoles(t *testing.T) {
|
||||
if testing.Short() {
|
||||
t.Skip("skipping integration test in short mode")
|
||||
}
|
||||
tests := []struct {
|
||||
name string
|
||||
token licensing.Licensing
|
||||
@@ -381,6 +393,9 @@ func TestIntegrationService_RegisterFixedRoles(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestIntegrationService_SearchUsersPermissions(t *testing.T) {
|
||||
if testing.Short() {
|
||||
t.Skip("skipping integration test in short mode")
|
||||
}
|
||||
searchOption := accesscontrol.SearchOptions{ActionPrefix: "teams"}
|
||||
ctx := context.Background()
|
||||
listAllPerms := map[string][]string{accesscontrol.ActionUsersPermissionsRead: {"users:*"}}
|
||||
@@ -602,6 +617,9 @@ func TestIntegrationService_SearchUsersPermissions(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestIntegrationService_SearchUserPermissions(t *testing.T) {
|
||||
if testing.Short() {
|
||||
t.Skip("skipping integration test in short mode")
|
||||
}
|
||||
ctx := context.Background()
|
||||
tests := []struct {
|
||||
name string
|
||||
@@ -833,6 +851,9 @@ func TestIntegrationService_SearchUserPermissions(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestIntegrationService_SaveExternalServiceRole(t *testing.T) {
|
||||
if testing.Short() {
|
||||
t.Skip("skipping integration test in short mode")
|
||||
}
|
||||
type run struct {
|
||||
cmd accesscontrol.SaveExternalServiceRoleCommand
|
||||
wantErr bool
|
||||
@@ -919,6 +940,9 @@ func TestIntegrationService_SaveExternalServiceRole(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestIntegrationService_DeleteExternalServiceRole(t *testing.T) {
|
||||
if testing.Short() {
|
||||
t.Skip("skipping integration test in short mode")
|
||||
}
|
||||
tests := []struct {
|
||||
name string
|
||||
initCmd *accesscontrol.SaveExternalServiceRoleCommand
|
||||
@@ -972,6 +996,9 @@ func TestIntegrationService_DeleteExternalServiceRole(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestIntegrationService_GetRoleByName(t *testing.T) {
|
||||
if testing.Short() {
|
||||
t.Skip("skipping integration test in short mode")
|
||||
}
|
||||
t.Parallel()
|
||||
|
||||
ctx := context.Background()
|
||||
|
||||
Reference in New Issue
Block a user