Terraform Validator is not an officially supported Google product; it is a library for conversion of Terraform plan data to CAI Assets. If you have been using terraform-validator directly in the past, we recommend migrating to `gcloud beta terraform vet`.
This sweeper was mistakenly deleting all SQL instances, instead of only deleting instances whose name matched IsSweepableTestResource(). In practice, this meant that our bootstrapped instance was being deleted on every run in GA.
Besides reducing churn and test run time, this change greatly reduces the chance of test failures that occur when relying on the bootstrapped instance immediately after it is created. Specifically, it appears that some of our tests will mistakenly try to clone the bootstrapped instance based off of a backup that is automatically created before the instance is actually done being created, and then they fail. This should not occur after the bootstrapped instance has had time to create other backups.
If this PR is for Terraform, I acknowledge that I have:
[x] Searched through the issue tracker for an open issue that this either resolves or contributes to, commented on it to claim it, and written "fixes {url}" or "part of {url}" in this PR description. If there were no relevant open issues, I opened one and commented that I would like to work on it (not necessary for very small changes).
[x] Ensured that all new fields I added that can be set by a user appear in at least one example (for generated resources) or third_party test (for handwritten resources or update tests).
[ ] Ran relevant acceptance tests using my own Google Cloud project and credentials (If the acceptance tests do not yet pass or you are unable to run them, please let your reviewer know).
This sweeper was mistakenly deleting all SQL instances, instead of only deleting instances whose name matched
IsSweepableTestResource()
. In practice, this meant that our bootstrapped instance was being deleted on every run in GA.Besides reducing churn and test run time, this change greatly reduces the chance of test failures that occur when relying on the bootstrapped instance immediately after it is created. Specifically, it appears that some of our tests will mistakenly try to clone the bootstrapped instance based off of a backup that is automatically created before the instance is actually done being created, and then they fail. This should not occur after the bootstrapped instance has had time to create other backups.
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)
Derived from https://github.com/GoogleCloudPlatform/magic-modules/pull/7602