diff --git a/internal/suites/scenario_backend_protection_test.go b/internal/suites/scenario_backend_protection_test.go index 2b2d8e397..b9832d97a 100644 --- a/internal/suites/scenario_backend_protection_test.go +++ b/internal/suites/scenario_backend_protection_test.go @@ -66,5 +66,9 @@ func (s *BackendProtectionScenario) TestInvalidEndpointsReturn404() { } func TestRunBackendProtection(t *testing.T) { + if testing.Short() { + t.Skip("skipping suite test in short mode") + } + suite.Run(t, NewBackendProtectionScenario()) } diff --git a/internal/suites/scenario_bypass_policy_test.go b/internal/suites/scenario_bypass_policy_test.go index bb774473e..85f3e041d 100644 --- a/internal/suites/scenario_bypass_policy_test.go +++ b/internal/suites/scenario_bypass_policy_test.go @@ -59,5 +59,9 @@ func (s *BypassPolicyScenario) TestShouldAccessPublicResource() { } func TestBypassPolicyScenario(t *testing.T) { + if testing.Short() { + t.Skip("skipping suite test in short mode") + } + suite.Run(t, NewBypassPolicyScenario()) } diff --git a/internal/suites/scenario_custom_headers_test.go b/internal/suites/scenario_custom_headers_test.go index 54a831a3f..ea5edcde4 100644 --- a/internal/suites/scenario_custom_headers_test.go +++ b/internal/suites/scenario_custom_headers_test.go @@ -125,5 +125,9 @@ func (s *CustomHeadersScenario) TestShouldForwardCustomHeaderForAuthenticatedUse } func TestCustomHeadersScenario(t *testing.T) { + if testing.Short() { + t.Skip("skipping suite test in short mode") + } + suite.Run(t, NewCustomHeadersScenario()) } diff --git a/internal/suites/scenario_default_redirection_url_test.go b/internal/suites/scenario_default_redirection_url_test.go index 60b184149..b4dd7c65b 100644 --- a/internal/suites/scenario_default_redirection_url_test.go +++ b/internal/suites/scenario_default_redirection_url_test.go @@ -65,5 +65,9 @@ func (drus *DefaultRedirectionURLScenario) TestUserIsRedirectedToDefaultURL() { } func TestShouldRunDefaultRedirectionURLScenario(t *testing.T) { + if testing.Short() { + t.Skip("skipping suite test in short mode") + } + suite.Run(t, NewDefaultRedirectionURLScenario()) } diff --git a/internal/suites/scenario_inactivity_test.go b/internal/suites/scenario_inactivity_test.go index 83ca67283..83cbdc14e 100644 --- a/internal/suites/scenario_inactivity_test.go +++ b/internal/suites/scenario_inactivity_test.go @@ -115,5 +115,9 @@ func (s *InactivityScenario) TestShouldDisableCookieExpirationAndInactivity() { } func TestInactivityScenario(t *testing.T) { + if testing.Short() { + t.Skip("skipping suite test in short mode") + } + suite.Run(t, NewInactivityScenario()) } diff --git a/internal/suites/scenario_one_factor_test.go b/internal/suites/scenario_one_factor_test.go index 3edc06261..febfae7b2 100644 --- a/internal/suites/scenario_one_factor_test.go +++ b/internal/suites/scenario_one_factor_test.go @@ -76,5 +76,9 @@ func (s *OneFactorSuite) TestShouldDenyAccessOnBadPassword() { } func TestRunOneFactor(t *testing.T) { + if testing.Short() { + t.Skip("skipping suite test in short mode") + } + suite.Run(t, NewOneFactorScenario()) } diff --git a/internal/suites/scenario_password_complexity_test.go b/internal/suites/scenario_password_complexity_test.go index 1a56a201b..493f6293a 100644 --- a/internal/suites/scenario_password_complexity_test.go +++ b/internal/suites/scenario_password_complexity_test.go @@ -57,5 +57,9 @@ func (s *PasswordComplexityScenario) TestShouldRejectPasswordReset() { } func TestRunPasswordComplexityScenario(t *testing.T) { + if testing.Short() { + t.Skip("skipping suite test in short mode") + } + suite.Run(t, NewPasswordComplexityScenario()) } diff --git a/internal/suites/scenario_redirection_check_test.go b/internal/suites/scenario_redirection_check_test.go index 2163a1e3b..57c7e335f 100644 --- a/internal/suites/scenario_redirection_check_test.go +++ b/internal/suites/scenario_redirection_check_test.go @@ -78,5 +78,9 @@ func (s *RedirectionCheckScenario) TestShouldRedirectOnlyWhenDomainIsHandledByAu } func TestRedirectionCheckScenario(t *testing.T) { + if testing.Short() { + t.Skip("skipping suite test in short mode") + } + suite.Run(t, NewRedirectionCheckScenario()) } diff --git a/internal/suites/scenario_redirection_url_test.go b/internal/suites/scenario_redirection_url_test.go index 3f20f017d..5224faa20 100644 --- a/internal/suites/scenario_redirection_url_test.go +++ b/internal/suites/scenario_redirection_url_test.go @@ -58,5 +58,9 @@ func (rus *RedirectionURLScenario) TestShouldVerifyCustomURLParametersArePropaga } func TestRedirectionURLScenario(t *testing.T) { + if testing.Short() { + t.Skip("skipping suite test in short mode") + } + suite.Run(t, NewRedirectionURLScenario()) } diff --git a/internal/suites/scenario_regulation_test.go b/internal/suites/scenario_regulation_test.go index 000ef5a7e..a350b8593 100644 --- a/internal/suites/scenario_regulation_test.go +++ b/internal/suites/scenario_regulation_test.go @@ -83,5 +83,9 @@ func (s *RegulationScenario) TestShouldBanUserAfterTooManyAttempt() { } func TestBlacklistingScenario(t *testing.T) { + if testing.Short() { + t.Skip("skipping suite test in short mode") + } + suite.Run(t, NewRegulationScenario()) } diff --git a/internal/suites/scenario_reset_password_test.go b/internal/suites/scenario_reset_password_test.go index 0dd713085..203546611 100644 --- a/internal/suites/scenario_reset_password_test.go +++ b/internal/suites/scenario_reset_password_test.go @@ -97,5 +97,9 @@ func (s *ResetPasswordScenario) TestShouldLetUserNoticeThereIsAPasswordMismatch( } func TestRunResetPasswordScenario(t *testing.T) { + if testing.Short() { + t.Skip("skipping suite test in short mode") + } + suite.Run(t, NewResetPasswordScenario()) } diff --git a/internal/suites/scenario_signin_email_test.go b/internal/suites/scenario_signin_email_test.go index fa667ed9e..9b1ea897f 100644 --- a/internal/suites/scenario_signin_email_test.go +++ b/internal/suites/scenario_signin_email_test.go @@ -59,5 +59,9 @@ func (s *SigninEmailScenario) TestShouldSignInWithUserEmail() { } func TestSigninEmailScenario(t *testing.T) { + if testing.Short() { + t.Skip("skipping suite test in short mode") + } + suite.Run(t, NewSigninEmailScenario()) } diff --git a/internal/suites/scenario_two_factor_test.go b/internal/suites/scenario_two_factor_test.go index 6a71c2bd0..9ff5c6e24 100644 --- a/internal/suites/scenario_two_factor_test.go +++ b/internal/suites/scenario_two_factor_test.go @@ -98,5 +98,9 @@ func (s *TwoFactorSuite) TestShouldFailTwoFactor() { } func TestRunTwoFactor(t *testing.T) { + if testing.Short() { + t.Skip("skipping suite test in short mode") + } + suite.Run(t, NewTwoFactorScenario()) } diff --git a/internal/suites/scenario_user_preferences_test.go b/internal/suites/scenario_user_preferences_test.go index 3863260c8..b9620dd8f 100644 --- a/internal/suites/scenario_user_preferences_test.go +++ b/internal/suites/scenario_user_preferences_test.go @@ -94,5 +94,9 @@ func (s *UserPreferencesScenario) TestShouldRememberLastUsed2FAMethod() { } func TestUserPreferencesScenario(t *testing.T) { + if testing.Short() { + t.Skip("skipping suite test in short mode") + } + suite.Run(t, NewUserPreferencesScenario()) } diff --git a/internal/suites/suite_activedirectory_test.go b/internal/suites/suite_activedirectory_test.go index 5d7228e88..c99bf479b 100644 --- a/internal/suites/suite_activedirectory_test.go +++ b/internal/suites/suite_activedirectory_test.go @@ -35,5 +35,9 @@ func (s *ActiveDirectorySuite) TestSigninEmailScenario() { } func TestActiveDirectorySuite(t *testing.T) { + if testing.Short() { + t.Skip("skipping suite test in short mode") + } + suite.Run(t, NewActiveDirectorySuite()) } diff --git a/internal/suites/suite_bypass_all_test.go b/internal/suites/suite_bypass_all_test.go index f47d46734..c6ae052b5 100644 --- a/internal/suites/suite_bypass_all_test.go +++ b/internal/suites/suite_bypass_all_test.go @@ -64,5 +64,9 @@ func (s *BypassAllSuite) TestCustomHeadersScenario() { } func TestBypassAllSuite(t *testing.T) { + if testing.Short() { + t.Skip("skipping suite test in short mode") + } + suite.Run(t, NewBypassAllSuite()) } diff --git a/internal/suites/suite_cli_test.go b/internal/suites/suite_cli_test.go index 8af92c827..9aaa16403 100644 --- a/internal/suites/suite_cli_test.go +++ b/internal/suites/suite_cli_test.go @@ -143,5 +143,9 @@ func (s *CLISuite) TestShouldGenerateCertificateECDSAP521() { } func TestCLISuite(t *testing.T) { + if testing.Short() { + t.Skip("skipping suite test in short mode") + } + suite.Run(t, NewCLISuite()) } diff --git a/internal/suites/suite_docker_test.go b/internal/suites/suite_docker_test.go index 95462645e..730735f9b 100644 --- a/internal/suites/suite_docker_test.go +++ b/internal/suites/suite_docker_test.go @@ -23,5 +23,9 @@ func (s *DockerSuite) TestTwoFactorScenario() { } func TestDockerSuite(t *testing.T) { + if testing.Short() { + t.Skip("skipping suite test in short mode") + } + suite.Run(t, NewDockerSuite()) } diff --git a/internal/suites/suite_duo_push_test.go b/internal/suites/suite_duo_push_test.go index cbe823657..3a7eaf255 100644 --- a/internal/suites/suite_duo_push_test.go +++ b/internal/suites/suite_duo_push_test.go @@ -145,5 +145,9 @@ func (s *DuoPushSuite) TestUserPreferencesScenario() { } func TestDuoPushSuite(t *testing.T) { + if testing.Short() { + t.Skip("skipping suite test in short mode") + } + suite.Run(t, NewDuoPushSuite()) } diff --git a/internal/suites/suite_haproxy_test.go b/internal/suites/suite_haproxy_test.go index cdc602f7e..276214a3e 100644 --- a/internal/suites/suite_haproxy_test.go +++ b/internal/suites/suite_haproxy_test.go @@ -27,5 +27,9 @@ func (s *HAProxySuite) TestCustomHeaders() { } func TestHAProxySuite(t *testing.T) { + if testing.Short() { + t.Skip("skipping suite test in short mode") + } + suite.Run(t, NewHAProxySuite()) } diff --git a/internal/suites/suite_high_availability_test.go b/internal/suites/suite_high_availability_test.go index f88f21a57..ce5f69136 100644 --- a/internal/suites/suite_high_availability_test.go +++ b/internal/suites/suite_high_availability_test.go @@ -183,38 +183,38 @@ var UserHarry = "harry" var Users = []string{UserJohn, UserBob, UserHarry} var expectedAuthorizations = map[string](map[string]bool){ - fmt.Sprintf("%s/secret.html", PublicBaseURL): map[string]bool{ + fmt.Sprintf("%s/secret.html", PublicBaseURL): { UserJohn: true, UserBob: true, UserHarry: true, }, - fmt.Sprintf("%s/secret.html", SecureBaseURL): map[string]bool{ + fmt.Sprintf("%s/secret.html", SecureBaseURL): { UserJohn: true, UserBob: true, UserHarry: true, }, - fmt.Sprintf("%s/secret.html", AdminBaseURL): map[string]bool{ + fmt.Sprintf("%s/secret.html", AdminBaseURL): { UserJohn: true, UserBob: false, UserHarry: false, }, - fmt.Sprintf("%s/secret.html", SingleFactorBaseURL): map[string]bool{ + fmt.Sprintf("%s/secret.html", SingleFactorBaseURL): { UserJohn: true, UserBob: true, UserHarry: true, }, - fmt.Sprintf("%s/secret.html", MX1MailBaseURL): map[string]bool{ + fmt.Sprintf("%s/secret.html", MX1MailBaseURL): { UserJohn: true, UserBob: true, UserHarry: false, }, - fmt.Sprintf("%s/secret.html", MX2MailBaseURL): map[string]bool{ + fmt.Sprintf("%s/secret.html", MX2MailBaseURL): { UserJohn: false, UserBob: true, UserHarry: false, }, - fmt.Sprintf("%s/groups/admin/secret.html", DevBaseURL): map[string]bool{ + fmt.Sprintf("%s/groups/admin/secret.html", DevBaseURL): { UserJohn: true, UserBob: false, UserHarry: false, }, - fmt.Sprintf("%s/groups/dev/secret.html", DevBaseURL): map[string]bool{ + fmt.Sprintf("%s/groups/dev/secret.html", DevBaseURL): { UserJohn: true, UserBob: true, UserHarry: false, }, - fmt.Sprintf("%s/users/john/secret.html", DevBaseURL): map[string]bool{ + fmt.Sprintf("%s/users/john/secret.html", DevBaseURL): { UserJohn: true, UserBob: false, UserHarry: false, }, - fmt.Sprintf("%s/users/harry/secret.html", DevBaseURL): map[string]bool{ + fmt.Sprintf("%s/users/harry/secret.html", DevBaseURL): { UserJohn: true, UserBob: false, UserHarry: true, }, - fmt.Sprintf("%s/users/bob/secret.html", DevBaseURL): map[string]bool{ + fmt.Sprintf("%s/users/bob/secret.html", DevBaseURL): { UserJohn: true, UserBob: true, UserHarry: false, }, } @@ -264,8 +264,8 @@ func NewHighAvailabilitySuite() *HighAvailabilitySuite { func DoGetWithAuth(t *testing.T, username, password string) int { client := NewHTTPClient() req, err := http.NewRequest("GET", fmt.Sprintf("%s/secret.html", SingleFactorBaseURL), nil) - req.SetBasicAuth(username, password) assert.NoError(t, err) + req.SetBasicAuth(username, password) res, err := client.Do(req) assert.NoError(t, err) @@ -304,9 +304,17 @@ func (s *HighAvailabilitySuite) TestHighAvailabilityWebDriverSuite() { } func TestHighAvailabilityWebDriverSuite(t *testing.T) { + if testing.Short() { + t.Skip("skipping suite test in short mode") + } + suite.Run(t, NewHighAvailabilityWebDriverSuite()) } func TestHighAvailabilitySuite(t *testing.T) { + if testing.Short() { + t.Skip("skipping suite test in short mode") + } + suite.Run(t, NewHighAvailabilitySuite()) } diff --git a/internal/suites/suite_kubernetes_test.go b/internal/suites/suite_kubernetes_test.go index 4f74e5751..8cb61c71b 100644 --- a/internal/suites/suite_kubernetes_test.go +++ b/internal/suites/suite_kubernetes_test.go @@ -27,5 +27,9 @@ func (s *KubernetesSuite) TestRedirectionURLScenario() { } func TestKubernetesSuite(t *testing.T) { + if testing.Short() { + t.Skip("skipping suite test in short mode") + } + suite.Run(t, NewKubernetesSuite()) } diff --git a/internal/suites/suite_ldap_test.go b/internal/suites/suite_ldap_test.go index 607ddbbd0..5859d936f 100644 --- a/internal/suites/suite_ldap_test.go +++ b/internal/suites/suite_ldap_test.go @@ -35,5 +35,9 @@ func (s *LDAPSuite) TestSigninEmailScenario() { } func TestLDAPSuite(t *testing.T) { + if testing.Short() { + t.Skip("skipping suite test in short mode") + } + suite.Run(t, NewLDAPSuite()) } diff --git a/internal/suites/suite_mariadb_test.go b/internal/suites/suite_mariadb_test.go index 1b29de7c9..cae16a501 100644 --- a/internal/suites/suite_mariadb_test.go +++ b/internal/suites/suite_mariadb_test.go @@ -23,5 +23,9 @@ func (s *MariadbSuite) TestTwoFactorScenario() { } func TestMariadbSuite(t *testing.T) { + if testing.Short() { + t.Skip("skipping suite test in short mode") + } + suite.Run(t, NewMariadbSuite()) } diff --git a/internal/suites/suite_mysql_test.go b/internal/suites/suite_mysql_test.go index b1813c6d8..e6e6c6f7f 100644 --- a/internal/suites/suite_mysql_test.go +++ b/internal/suites/suite_mysql_test.go @@ -23,5 +23,9 @@ func (s *MySQLSuite) TestTwoFactorScenario() { } func TestMySQLSuite(t *testing.T) { + if testing.Short() { + t.Skip("skipping suite test in short mode") + } + suite.Run(t, NewMySQLSuite()) } diff --git a/internal/suites/suite_network_acl_test.go b/internal/suites/suite_network_acl_test.go index 8bbc36c75..a8562a755 100644 --- a/internal/suites/suite_network_acl_test.go +++ b/internal/suites/suite_network_acl_test.go @@ -77,5 +77,9 @@ func (s *NetworkACLSuite) TestShouldAccessSecretUpon0FA() { } func TestNetworkACLSuite(t *testing.T) { + if testing.Short() { + t.Skip("skipping suite test in short mode") + } + suite.Run(t, NewNetworkACLSuite()) } diff --git a/internal/suites/suite_one_factor_only_test.go b/internal/suites/suite_one_factor_only_test.go index 5c6b8bcb3..02c382049 100644 --- a/internal/suites/suite_one_factor_only_test.go +++ b/internal/suites/suite_one_factor_only_test.go @@ -80,5 +80,9 @@ func (s *OneFactorOnlySuite) TestWeb() { } func TestOneFactorOnlySuite(t *testing.T) { + if testing.Short() { + t.Skip("skipping suite test in short mode") + } + suite.Run(t, new(OneFactorOnlySuite)) } diff --git a/internal/suites/suite_pathprefix_test.go b/internal/suites/suite_pathprefix_test.go index 21492f167..e2dd8a534 100644 --- a/internal/suites/suite_pathprefix_test.go +++ b/internal/suites/suite_pathprefix_test.go @@ -31,5 +31,9 @@ func (s *PathPrefixSuite) TestResetPasswordScenario() { } func TestPathPrefixSuite(t *testing.T) { + if testing.Short() { + t.Skip("skipping suite test in short mode") + } + suite.Run(t, NewPathPrefixSuite()) } diff --git a/internal/suites/suite_postgres_test.go b/internal/suites/suite_postgres_test.go index 805f20c60..8ee97c2f4 100644 --- a/internal/suites/suite_postgres_test.go +++ b/internal/suites/suite_postgres_test.go @@ -23,5 +23,9 @@ func (s *PostgresSuite) TestTwoFactorScenario() { } func TestPostgresSuite(t *testing.T) { + if testing.Short() { + t.Skip("skipping suite test in short mode") + } + suite.Run(t, NewPostgresSuite()) } diff --git a/internal/suites/suite_short_timeouts_test.go b/internal/suites/suite_short_timeouts_test.go index 73e22536c..49df7ccaa 100644 --- a/internal/suites/suite_short_timeouts_test.go +++ b/internal/suites/suite_short_timeouts_test.go @@ -27,5 +27,9 @@ func (s *ShortTimeoutsSuite) TestRegulationScenario() { } func TestShortTimeoutsSuite(t *testing.T) { + if testing.Short() { + t.Skip("skipping suite test in short mode") + } + suite.Run(t, NewShortTimeoutsSuite()) } diff --git a/internal/suites/suite_standalone_test.go b/internal/suites/suite_standalone_test.go index 2901d49c2..9d49bf61d 100644 --- a/internal/suites/suite_standalone_test.go +++ b/internal/suites/suite_standalone_test.go @@ -213,5 +213,9 @@ func (s *StandaloneSuite) TestRedirectionURLScenario() { } func TestStandaloneSuite(t *testing.T) { + if testing.Short() { + t.Skip("skipping suite test in short mode") + } + suite.Run(t, NewStandaloneSuite()) } diff --git a/internal/suites/suite_traefik2_test.go b/internal/suites/suite_traefik2_test.go index b96ceefcd..0f7e36d75 100644 --- a/internal/suites/suite_traefik2_test.go +++ b/internal/suites/suite_traefik2_test.go @@ -58,5 +58,9 @@ func (s *Traefik2Suite) TestShouldKeepSessionAfterRedisRestart() { } func TestTraefik2Suite(t *testing.T) { + if testing.Short() { + t.Skip("skipping suite test in short mode") + } + suite.Run(t, NewTraefik2Suite()) } diff --git a/internal/suites/suite_traefik_test.go b/internal/suites/suite_traefik_test.go index 83c6625d0..58147674e 100644 --- a/internal/suites/suite_traefik_test.go +++ b/internal/suites/suite_traefik_test.go @@ -31,5 +31,9 @@ func (s *TraefikSuite) TestCustomHeaders() { } func TestTraefikSuite(t *testing.T) { + if testing.Short() { + t.Skip("skipping suite test in short mode") + } + suite.Run(t, NewTraefikSuite()) }