Skip some recently added integration tests when LDAP is unavailable

Also refactor to use shared test helper for skipping LDAP and AD tests.
This commit is contained in:
Ryan Richard
2022-06-08 12:57:00 -07:00
parent dd61ada540
commit ec533cd781
4 changed files with 41 additions and 47 deletions

View File

@@ -103,9 +103,7 @@ func TestSupervisorWarnings_Browser(t *testing.T) {
)
t.Run("LDAP group refresh flow", func(t *testing.T) {
if len(env.ToolsNamespace) == 0 && !env.HasCapability(testlib.CanReachInternetLDAPPorts) {
t.Skip("LDAP integration test requires connectivity to an LDAP server")
}
testlib.SkipTestWhenLDAPIsUnavailable(t, env)
expectedUsername := env.SupervisorUpstreamLDAP.TestUserMailAttributeValue
@@ -242,13 +240,9 @@ func TestSupervisorWarnings_Browser(t *testing.T) {
t.Logf("second kubectl command took %s", time.Since(startTime2).String())
})
t.Run("Active Directory group refresh flow", func(t *testing.T) {
if len(env.ToolsNamespace) == 0 && !env.HasCapability(testlib.CanReachInternetLDAPPorts) {
t.Skip("LDAP integration test requires connectivity to an LDAP server")
}
if env.SupervisorUpstreamActiveDirectory.Host == "" {
t.Skip("Active Directory hostname not specified")
}
testlib.SkipTestWhenActiveDirectoryIsUnavailable(t, env)
expectedUsername, password := testlib.CreateFreshADTestUser(t, env)
t.Cleanup(func() {