mirror of
https://github.com/letic/terraform-provider-google.git
synced 2024-07-01 07:42:40 +00:00
Allow for running acceptance tests using the default credentials.
This change adds another option for supplying authentication credentials to acceptance tests: If GOOGLE_USE_DEFAULT_CREDENTIALS is set, the default credentials are used. When run from a compute engine instance, the compute engine default credentials are used. When run from the user's workstation, the user's credentials are used, if the user has authenticated with the GCloud CLI beforehand.
This commit is contained in:
parent
c48ef17ed7
commit
6e96e8473d
|
@ -53,6 +53,7 @@ func testAccPreCheck(t *testing.T) {
|
|||
"GOOGLE_CREDENTIALS",
|
||||
"GOOGLE_CLOUD_KEYFILE_JSON",
|
||||
"GCLOUD_KEYFILE_JSON",
|
||||
"GOOGLE_USE_DEFAULT_CREDENTIALS",
|
||||
}
|
||||
if v := multiEnvSearch(creds); v == "" {
|
||||
t.Fatalf("One of %s must be set for acceptance tests", strings.Join(creds, ", "))
|
||||
|
|
Loading…
Reference in New Issue
Block a user