-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Fix TestAccEventarcGoogleChannelConfig_cryptoKeyUpdate to properly clean up #7479
Conversation
Hi there, I'm the Modular magician. I've detected the following information about your changes: Diff reportYour PR generated some diffs in downstreams - here they are. Terraform GA: Diff ( 1 file changed, 13 insertions(+)) |
Tests analyticsTotal tests: Action takenFound 3 affected test(s) by replaying old test recordings. Starting RECORDING based on the most recent commit. Click here to see the affected testsTestAccEventarcGoogleChannelConfig_cryptoKeyUpdate|TestAccHealthcareFhirStore_healthcareFhirStoreStreamingConfigExample|TestAccDataSourceDnsManagedZone_basic |
Tests passed during RECORDING mode: Tests failed during RECORDING mode: Please fix these to complete your PR |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I remember that crypto_keys could not be deleted at the end of the tests, and instead we had to create a new project and delete that project for clean-up purposes.
I assume that by setting this specific deletion step, there is a way for this particular API to take an empty value and make the deletion right? Just want to make sure.
Yep, I was able to test and verify manually. For this eventarc "channel" API, you can set the crypto key that is used by sending a name, and clear it be sending |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds good, thanks for the confirmation.
fixes hashicorp/terraform-provider-google#12908
After making updates to the way we manage permissions during tests, we still saw issues with a few
TestAccCloudfunctions2function*
tests. It turns outTestAccEventarcGoogleChannelConfig_cryptoKeyUpdate
was leaving a region-wide configuration on the project that enforced CMEK on all eventarc channels, which were being used in these cloudfunction tests. See https://cloud.google.com/eventarc/docs/use-cmek.To fix our tests, I've updated
TestAccEventarcGoogleChannelConfig_cryptoKeyUpdate
to clean up its region-wide CMEK when it is finished. Note that this apparently does not happen automatically on destroy, which is why I needed an additional step to clear the config with an update.If this PR is for Terraform, I acknowledge that I have:
make test
andmake lint
in the generated providers to ensure it passes unit and linter tests.Release Note Template for Downstream PRs (will be copied)