hashicorp / terraform-provider-google

Terraform Provider for Google Cloud Platform
https://registry.terraform.io/providers/hashicorp/google/latest/docs
Mozilla Public License 2.0
2.33k stars 1.73k forks source link

Failing test(s): TestAccCloudFunctionsFunction_buildServiceAccount #18956

Closed SarahFrench closed 3 weeks ago

SarahFrench commented 2 months ago

Impacted tests

Affected Resource(s)

Failure rates

Message(s)

------- Stdout: -------
=== RUN   TestAccCloudFunctionsFunction_buildServiceAccount
=== PAUSE TestAccCloudFunctionsFunction_buildServiceAccount
=== CONT  TestAccCloudFunctionsFunction_buildServiceAccount
    vcr_utils.go:152: Step 1/4 error: Error running apply: exit status 1
        Error: Error waiting for Creating CloudFunctions Function: Error code 3, message: Build failed: failed to Fetch: failed to download archive gs://gcf-sources-653407317329-us-central1/tf-test-zi89ai0x2i-9123a416-18d1-4c1e-9908-b7cc44c2e07a/version-1/function-source.zip: Access to bucket gcf-sources-653407317329-us-central1 denied. You must grant Storage Object Viewer permission to tf-test-build1-feri8bfna7@ci-test-project-nightly-beta.iam.gserviceaccount.com. If you are using VPC Service Controls, you must also grant it access to your service perimeter.
          with google_cloudfunctions_function.function,
          on terraform_plugin_test.tf line 49, in resource "google_cloudfunctions_function" "function":
          49: resource "google_cloudfunctions_function" "function" {
--- FAIL: TestAccCloudFunctionsFunction_buildServiceAccount (126.12s)
FAIL

Nightly build test history

https://hashicorp.teamcity.com/test/-3603872467180741944?currentProjectId=TerraformProviders_GoogleCloud_GOOGLE_BETA_NIGHTLYTESTS&expandTestHistoryChartSection=true

b/357621492

SarahFrench commented 2 months ago

You must grant Storage Object Viewer permission to tf-test-build1-feri8bfna7@ci-test-project-nightly-beta.iam.gserviceaccount.com. If you are using VPC Service Controls, you must also grant it access to your service perimeter.

These permissions are granted in the test : https://github.com/GoogleCloudPlatform/magic-modules/blob/b5b2fa22cba8d31184a35774e92c8e4dc55267c5/mmv1/third_party/terraform/services/cloudfunctions/resource_cloudfunctions_function_test.go.erb#L1365-L1369

It may be an eventual consistency issue?

ScottSuarez commented 3 weeks ago

fixed with https://github.com/GoogleCloudPlatform/magic-modules/pull/11909