skip clouddns test when gcloud isn't initialized

If gcloud hasn't been installed, or if it has but the default application credential file
at .config/gcloud/application_default_credentials.json hasn't been configured, this test
would segfault since the assertion at the start fails but doesn't stop the test

Signed-off-by: Ashley Davis <ashley.davis@jetstack.io>
This commit is contained in:
Ashley Davis
2021-03-09 14:54:12 +00:00
parent c2634d3538
commit ef2006d7b6
@@ -109,6 +109,10 @@ func TestLiveGoogleCloudCleanUp(t *testing.T) {
}
func TestDNSProvider_getHostedZone(t *testing.T) {
if !gcloudLiveTest {
t.Skip("skipping live test")
}
testProvider, err := NewDNSProviderCredentials("my-project", util.RecursiveNameservers, "test-zone")
assert.NoError(t, err)