Skip to content

iamworkforcepool: make acceptance test resource names sweepable - #18979

Merged
SirGitsalot merged 1 commit into
GoogleCloudPlatform:mainfrom
SirGitsalot:fix-iamworkforcepool-sweepable
Sep 14, 2026
Merged

iamworkforcepool: make acceptance test resource names sweepable#18979
SirGitsalot merged 1 commit into
GoogleCloudPlatform:mainfrom
SirGitsalot:fix-iamworkforcepool-sweepable

Conversation

@SirGitsalot

Copy link
Copy Markdown
Member

The iamworkforcepool acceptance tests create resources with names that do not begin with tf-test, so the sweepers cannot recognize them and orphaned resources accumulate in the CI project when a test fails to clean up after itself. This prefixes 82 resource identifiers across 3 handwritten test files — workforce pool IDs, provider IDs, and provider key IDs.

One site is not a plain literal: a check helper reconstructs a provider URL by string interpolation (fmt.Sprintf("%s/providers/my-provider-%s", ...)). That is updated in lockstep with the resource it refers to, otherwise the test would look up the old name and fail.

Workforce pool and provider IDs are capped at 32 characters; the longest name here renders to 31, so every ID still fits.

This is test-only; no resource or provider behavior changes and no test coverage is removed.

Verification: both providers regenerate and build cleanly, go vet and gofmt pass, and the downstream diff is confined to services/iamworkforcepool. Every renamed site was rendered with its arguments substituted and checked for cross-step name instability and for duplicate names of the same resource type within a config.

Prefix workforce pool, provider and provider key IDs with tf-test so the
nightly sweepers can clean them up. All resulting IDs stay within the
documented 4-32 character [a-z0-9-] limit (longest is
tf-test-my-other-key- plus a 10 character suffix = 31).

Also updates the provider URL built in testAccCheckIamWorkforcePoolProvider
so the embedded provider ID still matches the renamed resource.
@modular-magician

modular-magician commented Sep 12, 2026

Copy link
Copy Markdown
Collaborator

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

Diff report

Your PR generated the following diffs in downstream repositories:

Repository Diff Link Changes
google provider View Diff 3 files changed, 82 insertions(+), 82 deletions(-)
google-beta provider View Diff 3 files changed, 82 insertions(+), 82 deletions(-)

Test report

Analytics

Total Tests Passed Skipped Affected
38 26 0 12
Affected Service Packages
  • iamworkforcepool

Learn how VCR tests work


Step 1: Replaying Mode

Action taken

Found 12 affected test(s) by replaying old test recordings. Starting RECORDING based on the most recent commit.

Click here to see the affected tests
  • TestAccIAMWorkforcePoolWorkforcePoolOidcProvider_extendedAttributesOauth2Client
  • TestAccIAMWorkforcePoolWorkforcePoolOidcProvider_extendedAttributesOauth2ClientWo
  • TestAccIAMWorkforcePoolWorkforcePoolOidcProvider_extraAttributesOauth2Client
  • TestAccIAMWorkforcePoolWorkforcePoolOidcProvider_extraAttributesOauth2ClientWo
  • TestAccIAMWorkforcePoolWorkforcePoolProviderKey_update
  • TestAccIAMWorkforcePoolWorkforcePoolProvider_oidc
  • TestAccIAMWorkforcePoolWorkforcePoolProvider_oidcWo
  • TestAccIAMWorkforcePoolWorkforcePoolProvider_saml
  • TestAccIAMWorkforcePoolWorkforcePoolSamlProvider_extendedAttributesOauth2Client
  • TestAccIAMWorkforcePoolWorkforcePoolSamlProvider_extraAttributesOauth2Client
  • TestAccIAMWorkforcePoolWorkforcePool_full
  • TestAccIAMWorkforcePoolWorkforcePool_minimal

View the replaying VCR build log


Step 2: Recording Mode

Recording Mode Replaying Rerun Test Name
✅ Log TestAccIAMWorkforcePoolWorkforcePoolOidcProvider_extendedAttributesOauth2Client
✅ Log TestAccIAMWorkforcePoolWorkforcePoolOidcProvider_extendedAttributesOauth2ClientWo
✅ Log TestAccIAMWorkforcePoolWorkforcePoolOidcProvider_extraAttributesOauth2Client
✅ Log TestAccIAMWorkforcePoolWorkforcePoolOidcProvider_extraAttributesOauth2ClientWo
✅ Log TestAccIAMWorkforcePoolWorkforcePoolProviderKey_update
✅ Log TestAccIAMWorkforcePoolWorkforcePoolProvider_oidc
✅ Log TestAccIAMWorkforcePoolWorkforcePoolProvider_oidcWo
✅ Log TestAccIAMWorkforcePoolWorkforcePoolProvider_saml
✅ Log TestAccIAMWorkforcePoolWorkforcePoolSamlProvider_extendedAttributesOauth2Client
✅ Log TestAccIAMWorkforcePoolWorkforcePoolSamlProvider_extraAttributesOauth2Client
✅ Log TestAccIAMWorkforcePoolWorkforcePool_full
✅ Log TestAccIAMWorkforcePoolWorkforcePool_minimal

🟢 All tests passed!

View the recording VCR build log or the debug logs folder for detailed results.

@SirGitsalot VCR tests complete for 19757ed!

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants