@@ -9,6 +9,11 @@ import (
99)
1010
1111func TestOAuthAuthenticator_GetHttpClient (t * testing.T ) {
12+ // Skip test if TEST_KEYFACTOR_AD_AUTH is set to 1 or true
13+ if os .Getenv ("TEST_KEYFACTOR_AD_AUTH" ) == "1" || os .Getenv ("TEST_KEYFACTOR_AD_AUTH" ) == "true" {
14+ t .Skip ("Skipping TestOAuthAuthenticator_GetHttpClient" )
15+ return
16+ }
1217 auth := & auth_providers.OAuthAuthenticator {
1318 Client : & http.Client {},
1419 }
@@ -24,6 +29,11 @@ func TestOAuthAuthenticator_GetHttpClient(t *testing.T) {
2429}
2530
2631func TestCommandConfigOauth_ValidateAuthConfig (t * testing.T ) {
32+ // Skip test if TEST_KEYFACTOR_AD_AUTH is set to 1 or true
33+ if os .Getenv ("TEST_KEYFACTOR_AD_AUTH" ) == "1" || os .Getenv ("TEST_KEYFACTOR_AD_AUTH" ) == "true" {
34+ t .Skip ("Skipping TestOAuthAuthenticator_GetHttpClient" )
35+ return
36+ }
2737 config := & auth_providers.CommandConfigOauth {
2838 ClientID : os .Getenv (auth_providers .EnvKeyfactorClientID ),
2939 ClientSecret : os .Getenv (auth_providers .EnvKeyfactorClientSecret ),
@@ -37,6 +47,11 @@ func TestCommandConfigOauth_ValidateAuthConfig(t *testing.T) {
3747}
3848
3949func TestCommandConfigOauth_GetHttpClient (t * testing.T ) {
50+ // Skip test if TEST_KEYFACTOR_AD_AUTH is set to 1 or true
51+ if os .Getenv ("TEST_KEYFACTOR_AD_AUTH" ) == "1" || os .Getenv ("TEST_KEYFACTOR_AD_AUTH" ) == "true" {
52+ t .Skip ("Skipping TestOAuthAuthenticator_GetHttpClient" )
53+ return
54+ }
4055 config := & auth_providers.CommandConfigOauth {
4156 ClientID : os .Getenv (auth_providers .EnvKeyfactorClientID ),
4257 ClientSecret : os .Getenv (auth_providers .EnvKeyfactorClientSecret ),
@@ -55,6 +70,11 @@ func TestCommandConfigOauth_GetHttpClient(t *testing.T) {
5570}
5671
5772func TestCommandConfigOauth_Authenticate (t * testing.T ) {
73+ // Skip test if TEST_KEYFACTOR_AD_AUTH is set to 1 or true
74+ if os .Getenv ("TEST_KEYFACTOR_AD_AUTH" ) == "1" || os .Getenv ("TEST_KEYFACTOR_AD_AUTH" ) == "true" {
75+ t .Skip ("Skipping TestOAuthAuthenticator_GetHttpClient" )
76+ return
77+ }
5878 config := & auth_providers.CommandConfigOauth {
5979 ClientID : os .Getenv (auth_providers .EnvKeyfactorClientID ),
6080 ClientSecret : os .Getenv (auth_providers .EnvKeyfactorClientSecret ),
@@ -69,6 +89,11 @@ func TestCommandConfigOauth_Authenticate(t *testing.T) {
6989}
7090
7191func TestCommandConfigOauth_Build (t * testing.T ) {
92+ // Skip test if TEST_KEYFACTOR_AD_AUTH is set to 1 or true
93+ if os .Getenv ("TEST_KEYFACTOR_AD_AUTH" ) == "1" || os .Getenv ("TEST_KEYFACTOR_AD_AUTH" ) == "true" {
94+ t .Skip ("Skipping TestOAuthAuthenticator_GetHttpClient" )
95+ return
96+ }
7297 config := & auth_providers.CommandConfigOauth {
7398 ClientID : os .Getenv (auth_providers .EnvKeyfactorClientID ),
7499 ClientSecret : os .Getenv (auth_providers .EnvKeyfactorClientSecret ),
0 commit comments