Skip to content

Commit

Permalink
fix(ci): Don't run AKV provider tests in GH action.
Browse files Browse the repository at this point in the history
  • Loading branch information
spbsoluble committed Nov 18, 2024
1 parent 09e07b3 commit c497f8b
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions auth_providers/azure_keyvault_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,18 @@ import (
)

func TestConfigProviderAzureKeyVault_Authenticate(t *testing.T) {
if isRunningInGithubAction() {
t.Skip("Testing via Github Actions not supported, skipping test")
}
provider := auth_providers.NewConfigProviderAzureKeyVault()
err := provider.Authenticate()
assert.NoError(t, err, "expected no error during authentication")
}

func TestConfigProviderAzureKeyVault_LoadConfigFromAzureKeyVault(t *testing.T) {
if isRunningInGithubAction() {
t.Skip("Testing via Github Actions not supported, skipping test")
}
vaultName := os.Getenv(auth_providers.EnvAzureVaultName)
secretName := os.Getenv(auth_providers.EnvAzureSecretName)

Expand Down Expand Up @@ -132,3 +138,8 @@ func hasManagedIdentity() (bool, error) {
}
return false, nil
}

func isRunningInGithubAction() bool {
_, exists := os.LookupEnv("GITHUB_RUN_ID")
return exists
}

0 comments on commit c497f8b

Please sign in to comment.