Skip to content

Commit

Permalink
Fix Failing test(s): TestAccLoggingBucketConfigProject_* (GoogleCloud…
Browse files Browse the repository at this point in the history
…Platform#9674)

* change _Default bucket_id usage

* remove from unrelated tests

* remove indexconfigs change

* add billing_acccount to failing tests

* add billingaccount variable to project tfconfig
  • Loading branch information
BBBmau authored Jan 3, 2024
1 parent 163480b commit 72363f1
Showing 1 changed file with 12 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,10 @@ func TestAccLoggingBucketConfigProject_basic(t *testing.T) {
t.Parallel()

context := map[string]interface{}{
"random_suffix": acctest.RandString(t, 10),
"project_name": "tf-test-" + acctest.RandString(t, 10),
"org_id": envvar.GetTestOrgFromEnv(t),
"random_suffix": acctest.RandString(t, 10),
"project_name": "tf-test-" + acctest.RandString(t, 10),
"billing_account": envvar.GetTestBillingAccountFromEnv(t),
"org_id": envvar.GetTestOrgFromEnv(t),
}

acctest.VcrTest(t, resource.TestCase{
Expand Down Expand Up @@ -92,9 +93,10 @@ func TestAccLoggingBucketConfigProject_analyticsEnabled(t *testing.T) {
t.Parallel()

context := map[string]interface{}{
"random_suffix": acctest.RandString(t, 10),
"project_name": "tf-test-" + acctest.RandString(t, 10),
"org_id": envvar.GetTestOrgFromEnv(t),
"random_suffix": acctest.RandString(t, 10),
"project_name": "tf-test-" + acctest.RandString(t, 10),
"billing_account": envvar.GetTestBillingAccountFromEnv(t),
"org_id": envvar.GetTestOrgFromEnv(t),
}

acctest.VcrTest(t, resource.TestCase{
Expand Down Expand Up @@ -255,14 +257,15 @@ resource "google_project" "default" {
project_id = "%{project_name}"
name = "%{project_name}"
org_id = "%{org_id}"
billing_account = "%{billing_account}"
}
resource "google_logging_project_bucket_config" "basic" {
project = google_project.default.name
location = "global"
retention_days = %d
description = "retention test %d days"
bucket_id = "_Default"
bucket_id = "test-bucket"
}
`, context), retention, retention)
}
Expand All @@ -273,13 +276,14 @@ resource "google_project" "default" {
project_id = "%{project_name}"
name = "%{project_name}"
org_id = "%{org_id}"
billing_account = "%{billing_account}"
}
resource "google_logging_project_bucket_config" "basic" {
project = google_project.default.name
location = "global"
enable_analytics = %t
bucket_id = "_Default"
bucket_id = "test-bucket"
}
`, context), analytics)
}
Expand Down

0 comments on commit 72363f1

Please sign in to comment.