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:04:19 +00:00
parent c2634d3538
commit ef2006d7b6
No known key found for this signature in database
GPG Key ID: DD14CC017E32BEB1

View File

@ -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)