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

Tests fail in GoogleCloudPlatform / magic-modules with sdk release 2.24.0 #1104

Closed
zli82016 opened this issue Nov 17, 2022 · 11 comments
Closed
Assignees
Labels
bug Something isn't working

Comments

@zli82016
Copy link

SDK version

2.24.0

Relevant provider source code

https://github.com/GoogleCloudPlatform/magic-modules

Terraform Configuration Files

...

Debug Output

Expected Behavior

The following tests should pass.

TestAccContainerNodePool_basicWithClusterId|TestAccContainerNodePool_autoscaling|TestAccContainerNodePool_totalSize|TestAccContainerNodePool_regionalAutoscaling|TestAccContainerNodePool_basic|TestAccContainerCluster_withResourceUsageExportConfig|TestAccComputeVpnTunnel_vpnTunnelBetaExample|TestAccComputeAutoscaler_autoscalerSingleInstanceExample|TestAccProviderBasePath_setInvalidBasePath|TestAccProviderBasePath_setBasePath|TestAccSecurityScannerScanConfig_scanConfigBasicExample

Actual Behavior

The above tests fail.

Steps to Reproduce

References

@zli82016 zli82016 added the bug Something isn't working label Nov 17, 2022
@zli82016
Copy link
Author

It looks like the commit in sdk (ef65fde#diff-3894fabafd3f4b1861dd167c6194c6d79e5824d2bec30d37b257d80a824255c2R19 ) causes the tests fail in GoogleCloudPlatform / magic-modules.

@bflad bflad self-assigned this Nov 17, 2022
@bflad
Copy link
Member

bflad commented Nov 17, 2022

Hi @zli82016 👋 Thank you for raising this and sorry your provider is running into testing issues.

Two questions for you:

  • Can you please post the failed test output and relevant test code? The maintainers here cannot access the GCP acceptance testing links for the failed tests nor run the tests ourselves to triage this issue.
  • Does upgrading to 2.24.1 fix the issue(s)? If it relates to test configuration handling, this was a bug fix from that release:

helper/resource: Prevented provider configuration already given error when TestStep type Config field already contained provider configuration block (#1092)

Thank you so much.

@bflad bflad added the waiting-response An issue/pull request is waiting for a response from the community label Nov 17, 2022
@zli82016
Copy link
Author

zli82016 commented Nov 17, 2022

I checked the fix in 2.24.1. I do find the place to set the flag skipProviderBlock for our test cases.

@zli82016
Copy link
Author

V2.24.1 does not fix the tests.

@zli82016
Copy link
Author

Thanks @bflad for the fix in V2.24.1. It is weird that it does not fix our tests. If you need more information, feel free to let me know. Thanks.

@bflad
Copy link
Member

bflad commented Nov 18, 2022

If you have trace logging enabled, it should output the full Terraform configuration being applied with a message Setting Terraform configuration.

Looking at the test code itself, it is using the deprecated TestCase type Providers field (Providers: testAccProvidersOiCS,). There is some legacy logic in the testing code that implicitly adds provider configuration blocks, but only when using that field. We can try to determine if that is safe to skip in this case. Are you able to try switching the TestCase to using the ProviderFactories or ProtoV5ProviderFactories field instead to see if that resolves this issue for you?

@bflad bflad removed the waiting-response An issue/pull request is waiting for a response from the community label Nov 18, 2022
@zli82016
Copy link
Author

zli82016 commented Nov 18, 2022

Thanks, @bflad. I can see the Terraform configuration with enabled trace logging. It has two provider configuration block.

provider "google-beta" {}

provider "google-beta" {
region = "us-central1"
zone = "us-central1-a"
}

I switched to ProviderFactories and the test runs successfully.

It needs some work to switch to ProviderFactories for our system and I am not sure if we have the plan to do that.

Can you try to check if it is safe to skip the provider configuration block in this case? Thanks.

@zli82016
Copy link
Author

Hello, @bflad , sorry to check again. Do you think is it safe to skip the provider configuration block in this case? Thanks.

@bflad
Copy link
Member

bflad commented Nov 2, 2023

It looks like this was resolved last year, but if not, please feel free to submit a bug report with a full reproduction case.

@bflad bflad closed this as not planned Won't fix, can't repro, duplicate, stale Nov 2, 2023
Copy link

github-actions bot commented Dec 3, 2023

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 3, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants