Skip to content

Fix nightly test failures for external credentials upgrade#17063

Open
shuyama1 wants to merge 2 commits intoGoogleCloudPlatform:mainfrom
shuyama1:fix_TestAccProvider_external_credentials_upgrade
Open

Fix nightly test failures for external credentials upgrade#17063
shuyama1 wants to merge 2 commits intoGoogleCloudPlatform:mainfrom
shuyama1:fix_TestAccProvider_external_credentials_upgrade

Conversation

@shuyama1
Copy link
Copy Markdown
Member

@shuyama1 shuyama1 commented Apr 9, 2026

fixes hashicorp/terraform-provider-google#26748

Release Note Template for Downstream PRs (will be copied)

See Write release notes for guidance.


@modular-magician
Copy link
Copy Markdown
Collaborator

Hi there, I'm the Modular magician. I've detected the following information about your changes:

Diff report

Your PR generated some diffs in downstreams - here they are.

google provider: Diff ( 1 file changed, 1 insertion(+), 2 deletions(-))
google-beta provider: Diff ( 1 file changed, 1 insertion(+), 2 deletions(-))

@modular-magician
Copy link
Copy Markdown
Collaborator

Tests analytics

Total tests: 6292
Passed tests: 5628
Skipped tests: 651
Affected tests: 13

Click here to see the affected service packages

All service packages are affected

Action taken

Found 13 affected test(s) by replaying old test recordings. Starting RECORDING based on the most recent commit. Click here to see the affected tests
  • TestAccAccessContextManager__access_policy_iam_policy
  • TestAccApigeeOrganization_apigeeOrganizationCloudBasicDisableVpcPeeringTestExample
  • TestAccApigeeOrganization_apigeeOrganizationCloudFullDisableVpcPeeringTestExample
  • TestAccArtifactRegistryRepository_artifactRegistryRepositoryCleanupExample
  • TestAccArtifactRegistryRepository_cleanup
  • TestAccBeyondcorpAppConnection_beyondcorpAppConnectionBasicExample
  • TestAccCloudRunService_cloudRunServiceGpuExample
  • TestAccContainerCluster_withAutopilotResourceManagerTags
  • TestAccDataSourceGoogleBackupDRManagementServer_basic
  • TestAccDataformRepository_dataformRepositoryWithCloudsourceRepoAndSshExample
  • TestAccDiscoveryEngineDataStore_discoveryengineDatastoreKmsKeyNameExample
  • TestAccManagedKafkaConnector_managedkafkaConnectorBasicExample
  • TestAccPubsubSubscription_pubsubSubscriptionTagsExample

Get to know how VCR tests work

@modular-magician
Copy link
Copy Markdown
Collaborator

🟢 Tests passed during RECORDING mode:
TestAccAccessContextManager__access_level_condition [Debug log]
TestAccAccessContextManager__access_level_custom [Debug log]
TestAccAccessContextManager__access_level_full [Debug log]
TestAccAccessContextManager__access_levels [Debug log]
TestAccAccessContextManager__authorized_orgs_desc [Debug log]
TestAccAccessContextManager__data_source_access_policy_basic [Debug log]
TestAccAccessContextManager__gcp_user_access_binding [Debug log]
TestAccAccessContextManager__service_perimeter_dry_run_egress_policy [Debug log]
TestAccAccessContextManager__service_perimeter_dry_run_ingress_policy [Debug log]
TestAccAccessContextManager__service_perimeter_dry_run_resource [Debug log]
TestAccAccessContextManager__service_perimeter_egress_policy [Debug log]
TestAccAccessContextManager__service_perimeter_ingress_policy [Debug log]
TestAccAccessContextManager__service_perimeter_update [Debug log]
TestAccAccessContextManager__service_perimeters [Debug log]

🟢 No issues found for passed tests after REPLAYING rerun.


🔴 Tests failed during RECORDING mode:
TestAccAccessContextManager__access_level [Error message] [Debug log]
TestAccAccessContextManager__access_policy [Error message] [Debug log]
TestAccAccessContextManager__access_policy_iam_binding [Error message] [Debug log]
TestAccAccessContextManager__access_policy_iam_member [Error message] [Debug log]
TestAccAccessContextManager__access_policy_iam_policy [Error message] [Debug log]
TestAccAccessContextManager__access_policy_scoped [Error message] [Debug log]
TestAccAccessContextManager__data_source_access_policy_scoped [Error message] [Debug log]
TestAccAccessContextManager__service_perimeter [Error message] [Debug log]
TestAccAccessContextManager__service_perimeter_resource [Error message] [Debug log]
TestAccApigeeOrganization_apigeeOrganizationCloudBasicDisableVpcPeeringTestExample [Error message] [Debug log]
TestAccApigeeOrganization_apigeeOrganizationCloudFullDisableVpcPeeringTestExample [Error message] [Debug log]
TestAccArtifactRegistryRepository_artifactRegistryRepositoryCleanupExample [Error message] [Debug log]
TestAccArtifactRegistryRepository_cleanup [Error message] [Debug log]
TestAccBeyondcorpAppConnection_beyondcorpAppConnectionBasicExample [Error message] [Debug log]
TestAccCloudRunService_cloudRunServiceGpuExample [Error message] [Debug log]
TestAccContainerCluster_withAutopilotResourceManagerTags [Error message] [Debug log]
TestAccDataSourceGoogleBackupDRManagementServer_basic [Error message] [Debug log]
TestAccDataformRepository_dataformRepositoryWithCloudsourceRepoAndSshExample [Error message] [Debug log]
TestAccDiscoveryEngineDataStore_discoveryengineDatastoreKmsKeyNameExample [Error message] [Debug log]
TestAccManagedKafkaConnector_managedkafkaConnectorBasicExample [Error message] [Debug log]
TestAccPubsubSubscription_pubsubSubscriptionTagsExample [Error message] [Debug log]

🔴 Errors occurred during RECORDING mode. Please fix them to complete your PR.

View the build log or the debug log for each test

@shuyama1 shuyama1 force-pushed the fix_TestAccProvider_external_credentials_upgrade branch from 9aadacd to 0c3476b Compare April 10, 2026 19:18
@modular-magician
Copy link
Copy Markdown
Collaborator

Hi there, I'm the Modular magician. I've detected the following information about your changes:

Diff report

Your PR generated some diffs in downstreams - here they are.

google provider: Diff ( 1 file changed, 17 insertions(+), 10 deletions(-))
google-beta provider: Diff ( 1 file changed, 17 insertions(+), 10 deletions(-))

@shuyama1
Copy link
Copy Markdown
Member Author

/gcbrun

failed during token rotation

@shuyama1
Copy link
Copy Markdown
Member Author

Test passed on TC

@shuyama1 shuyama1 requested a review from BBBmau April 10, 2026 22:51
@modular-magician
Copy link
Copy Markdown
Collaborator

Hi there, I'm the Modular magician. I've detected the following information about your changes:

Diff report

Your PR generated some diffs in downstreams - here they are.

google provider: Diff ( 1 file changed, 17 insertions(+), 10 deletions(-))
google-beta provider: Diff ( 1 file changed, 17 insertions(+), 10 deletions(-))

@modular-magician
Copy link
Copy Markdown
Collaborator

Tests analytics

Total tests: 6294
Passed tests: 5630
Skipped tests: 651
Affected tests: 13

Click here to see the affected service packages

All service packages are affected

Action taken

Found 13 affected test(s) by replaying old test recordings. Starting RECORDING based on the most recent commit. Click here to see the affected tests
  • TestAccAccessContextManager__access_policy_iam_policy
  • TestAccApigeeOrganization_apigeeOrganizationCloudBasicDisableVpcPeeringTestExample
  • TestAccApigeeOrganization_apigeeOrganizationCloudFullDisableVpcPeeringTestExample
  • TestAccArtifactRegistryRepository_artifactRegistryRepositoryCleanupExample
  • TestAccArtifactRegistryRepository_cleanup
  • TestAccBeyondcorpAppConnection_beyondcorpAppConnectionBasicExample
  • TestAccCloudRunService_cloudRunServiceGpuExample
  • TestAccContainerCluster_withAutopilotResourceManagerTags
  • TestAccDataSourceGoogleBackupDRManagementServer_basic
  • TestAccDataformRepository_dataformRepositoryWithCloudsourceRepoAndSshExample
  • TestAccDiscoveryEngineDataStore_discoveryengineDatastoreKmsKeyNameExample
  • TestAccManagedKafkaConnector_managedkafkaConnectorBasicExample
  • TestAccPubsubSubscription_pubsubSubscriptionTagsExample

Get to know how VCR tests work

@modular-magician
Copy link
Copy Markdown
Collaborator

🟢 Tests passed during RECORDING mode:
TestAccAccessContextManager__access_level [Debug log]
TestAccAccessContextManager__access_level_condition [Debug log]
TestAccAccessContextManager__access_level_custom [Debug log]
TestAccAccessContextManager__access_level_full [Debug log]
TestAccAccessContextManager__access_levels [Debug log]
TestAccAccessContextManager__access_policy [Debug log]
TestAccAccessContextManager__authorized_orgs_desc [Debug log]
TestAccAccessContextManager__data_source_access_policy_basic [Debug log]
TestAccAccessContextManager__gcp_user_access_binding [Debug log]
TestAccAccessContextManager__service_perimeter [Debug log]
TestAccAccessContextManager__service_perimeter_dry_run_egress_policy [Debug log]
TestAccAccessContextManager__service_perimeter_dry_run_ingress_policy [Debug log]
TestAccAccessContextManager__service_perimeter_dry_run_resource [Debug log]
TestAccAccessContextManager__service_perimeter_egress_policy [Debug log]
TestAccAccessContextManager__service_perimeter_ingress_policy [Debug log]
TestAccAccessContextManager__service_perimeter_resource [Debug log]
TestAccAccessContextManager__service_perimeter_update [Debug log]
TestAccAccessContextManager__service_perimeters [Debug log]

🟢 No issues found for passed tests after REPLAYING rerun.


🔴 Tests failed during RECORDING mode:
TestAccAccessContextManager__access_policy_iam_binding [Error message] [Debug log]
TestAccAccessContextManager__access_policy_iam_member [Error message] [Debug log]
TestAccAccessContextManager__access_policy_iam_policy [Error message] [Debug log]
TestAccAccessContextManager__access_policy_scoped [Error message] [Debug log]
TestAccAccessContextManager__data_source_access_policy_scoped [Error message] [Debug log]
TestAccApigeeOrganization_apigeeOrganizationCloudBasicDisableVpcPeeringTestExample [Error message] [Debug log]
TestAccApigeeOrganization_apigeeOrganizationCloudFullDisableVpcPeeringTestExample [Error message] [Debug log]
TestAccArtifactRegistryRepository_artifactRegistryRepositoryCleanupExample [Error message] [Debug log]
TestAccArtifactRegistryRepository_cleanup [Error message] [Debug log]
TestAccBeyondcorpAppConnection_beyondcorpAppConnectionBasicExample [Error message] [Debug log]
TestAccCloudRunService_cloudRunServiceGpuExample [Error message] [Debug log]
TestAccContainerCluster_withAutopilotResourceManagerTags [Error message] [Debug log]
TestAccDataSourceGoogleBackupDRManagementServer_basic [Error message] [Debug log]
TestAccDataformRepository_dataformRepositoryWithCloudsourceRepoAndSshExample [Error message] [Debug log]
TestAccDiscoveryEngineDataStore_discoveryengineDatastoreKmsKeyNameExample [Error message] [Debug log]
TestAccManagedKafkaConnector_managedkafkaConnectorBasicExample [Error message] [Debug log]
TestAccPubsubSubscription_pubsubSubscriptionTagsExample [Error message] [Debug log]

🔴 Errors occurred during RECORDING mode. Please fix them to complete your PR.

View the build log or the debug log for each test

Copy link
Copy Markdown
Collaborator

@BBBmau BBBmau left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good, the changes make sense in the context of the plugin-testing changes introduced in 1.14.1 just a minoir quesiton on the removal of a check step

Comment on lines -236 to +237
Check: resource.ComposeTestCheckFunc(
resource.TestCheckResourceAttr("data.google_provider_config_sdk.default", "credentials", credentials),
),
// google_provider_config_sdk is not available in 6.10.0, so we cannot verify credentials here.
// The fact that this step succeeds implies the provider accepted the credentials.
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

im not sure i follow, the first step uses the old version while also following the config apply with a checkAttribute on data.google_provider_config_sdk.default

https://github.com/shuyama1/magic-modules/blob/0c3476b87bc6e640419a1edf7d39fce9fa36c62e/mmv1/third_party/terraform/provider/provider_test.go.tmpl#L206-L209

so we should be able to leave the check step here. removing the need for testAccProviderExternalCredentialsUpgrade_CredentialsConfigNew also

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The issue is that we can't use google_provider_config_sdk datasource with the real provider. It's a test-specific data source, not publicly available testhttps://github.com/GoogleCloudPlatform/magic-modules/blob/main/mmv1/third_party/terraform/acctest/vcr_utils.go#L392

Therefore, need to remove it from testAccProviderExternalCredentialsUpgrade_CredentialsConfig and add the new testAccProviderExternalCredentialsUpgrade_CredentialsConfigNew to include it, so we can check that in step 4

Check: resource.ComposeTestCheckFunc(
resource.TestCheckResourceAttr("data.google_provider_config_sdk.default", "credentials", credentials),
),
// google_provider_config_sdk is not available in 6.10.0, so we cannot verify credentials here.
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// google_provider_config_sdk is not available in 6.10.0, so we cannot verify credentials here.
// google_provider_config_sdk is test-specific datasource
// not available in the real provider, so we cannot verify credentials here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Failing test(s): TestAccProvider_external_credentials_upgrade

3 participants