Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failing test(s): TestAccBigQueryDataset_withProvider5 #20005

Closed
SarahFrench opened this issue Oct 24, 2024 · 7 comments
Closed

Failing test(s): TestAccBigQueryDataset_withProvider5 #20005

SarahFrench opened this issue Oct 24, 2024 · 7 comments

Comments

@SarahFrench
Copy link
Member

SarahFrench commented Oct 24, 2024

Impacted tests

  • TestAccBigQueryDataset_withProvider5

Affected Resource(s)

  • google_bigquery_dataset

Failure rates

  • 100% since 2024-08-23

Message(s)

------- Stdout: -------
=== RUN   TestAccBigQueryDataset_withProvider5
=== PAUSE TestAccBigQueryDataset_withProvider5
=== CONT  TestAccBigQueryDataset_withProvider5
    resource_bigquery_dataset_test.go:166: Step 1/2 error: Error running pre-apply refresh: exit status 1
        Error: Unsupported argument
          on terraform_plugin_test.tf line 14, in provider "google":
          14:   add_terraform_attribution_label = false
        An argument named "add_terraform_attribution_label" is not expected here.
--- FAIL: TestAccBigQueryDataset_withProvider5 (4.24s)
FAIL

Nightly build test history

https://hashicorp.teamcity.com/test/-9079369578491790535?currentProjectId=TerraformProviders_GoogleCloud_GOOGLE_NIGHTLYTESTS&expandTestHistoryChartSection=true

b/375372322

@SarahFrench
Copy link
Member Author

This test looks like it dates from the 5.0.0 major release

@github-actions github-actions bot added forward/review In review; remove label to forward service/bigquery labels Oct 24, 2024
@SarahFrench
Copy link
Member Author

The problem is due to the test trying to use a new provider-level argument that was added in 5.0.0 with a 4.x.x version of the provider:

func TestAccBigQueryDataset_withProvider5(t *testing.T) {
acctest.SkipIfVcr(t)
t.Parallel()
datasetID := fmt.Sprintf("tf_test_%s", acctest.RandString(t, 10))
oldVersion := map[string]resource.ExternalProvider{
"google": {
VersionConstraint: "4.75.0", // a version that doesn't separate user defined labels and system labels
Source: "registry.terraform.io/hashicorp/google",
},
}
acctest.VcrTest(t, resource.TestCase{
PreCheck: func() { acctest.AccTestPreCheck(t) },
CheckDestroy: testAccCheckBigQueryDatasetDestroyProducer(t),
Steps: []resource.TestStep{
{
Config: testAccBigQueryDataset_withoutLabels(datasetID),
ExternalProviders: oldVersion,
Check: resource.ComposeTestCheckFunc(
resource.TestCheckNoResourceAttr("google_bigquery_dataset.test", "labels.%"),
resource.TestCheckNoResourceAttr("google_bigquery_dataset.test", "effective_labels.%"),
),
},
{
Config: testAccBigQueryDataset(datasetID),
ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories(t),
Check: resource.ComposeTestCheckFunc(
resource.TestCheckResourceAttr("google_bigquery_dataset.test", "labels.%", "2"),
resource.TestCheckResourceAttr("google_bigquery_dataset.test", "labels.env", "foo"),
resource.TestCheckResourceAttr("google_bigquery_dataset.test", "labels.default_table_expiration_ms", "3600000"),
resource.TestCheckResourceAttr("google_bigquery_dataset.test", "effective_labels.%", "2"),
resource.TestCheckResourceAttr("google_bigquery_dataset.test", "effective_labels.env", "foo"),
resource.TestCheckResourceAttr("google_bigquery_dataset.test", "effective_labels.default_table_expiration_ms", "3600000"),
),
},
},
})
}

@SarahFrench SarahFrench removed the forward/review In review; remove label to forward label Oct 24, 2024
@SarahFrench SarahFrench added this to the Goals milestone Oct 24, 2024
@wj-chen
Copy link

wj-chen commented Oct 25, 2024

The v5.0.0 provider-level argument add_terraform_attribution_label was added to that test config in GoogleCloudPlatform/magic-modules@0b62ec9#diff-57b4fef051ae11c7000919221447c3ce38472429666af9e5d925a6df266ed075. Most tests that use that config are running with v5.0.0+ except this specific test that requires an older version. This test already existed when the attribute was added but appeared to not have run as part of GoogleCloudPlatform/magic-modules#11439.

@SirGitsalot and @c2thorn could you comment on add_terraform_attribution_label and fix this test?

@SirGitsalot
Copy link
Collaborator

GoogleCloudPlatform/magic-modules#12146

@wj-chen
Copy link

wj-chen commented Oct 30, 2024

Thanks @SirGitsalot for the fix. I don't have access to the test run results but after the fix this should be good to close now?

@SarahFrench
Copy link
Member Author

Screenshot 2024-10-31 at 16 18 56

This test passed the last two nights; closing issue

Copy link

github-actions bot commented Dec 7, 2024

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.
If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Dec 7, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

5 participants