-
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
Add acceptance tests for how provider handles impersonate_service_account
argument
#11641
Add acceptance tests for how provider handles impersonate_service_account
argument
#11641
Conversation
9cf6bd1
to
50c0e6c
Compare
This comment was marked as outdated.
This comment was marked as outdated.
2 similar comments
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
2a23bca
to
0c8a3cb
Compare
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
…ng impersonate_service_account on PF provider
e1cd694
to
3eb5766
Compare
3eb5766
to
a4a04bc
Compare
impersonate_service_account
argument, remove old unit testsimpersonate_service_account
argument
This comment was marked as outdated.
This comment was marked as outdated.
2 similar comments
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
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.
Some comments to assist in review
// Usage | ||
// We need to wait for a non-Firebase resource to be migrated to the plugin-framework to enable writing this test | ||
// "impersonate_service_account controls which service account is used for actions" |
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 think waiting for an 'easier' resource to use would be best - given that Firebase is the only PF-impemented resources/data source available to us and it's Beta-only.
Config: testAccSdkProvider_impersonate_service_account_testViaFailure(context), | ||
ExpectError: regexp.MustCompile("Error creating Topic: googleapi: Error 403: User not authorized"), |
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.
The error can only arise if Terraform is using the impersonated service account that has no permissions
This comment was marked as outdated.
This comment was marked as outdated.
1 similar comment
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
Some TeamCity builds running these tests: |
Marking this as ready for review - happy to save merging for after the rewrite is released (will reduce the diffs in this PR) but would be nice to get feedback on the tests in the meantime I've self-reviewed a little here and have triggered the tests in TeamCity here. |
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.
LGTM overall. Can't think of more cases to cover with impersonate_service_account
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.
Thanks for the review!
Before merging I'm going to remove these outputs that are unused.
mmv1/third_party/terraform/provider/provider_impersonate_service_account_test.go
Outdated
Show resolved
Hide resolved
mmv1/third_party/terraform/provider/provider_impersonate_service_account_test.go
Outdated
Show resolved
Hide resolved
mmv1/third_party/terraform/fwprovider/framework_provider_impersonate_service_account_test.go
Outdated
Show resolved
Hide resolved
mmv1/third_party/terraform/fwprovider/framework_provider_impersonate_service_account_test.go
Outdated
Show resolved
Hide resolved
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.
|
Tests analyticsTotal tests: 4098 Click here to see the affected service packages
View the build log |
Hi Sarah, this test is failing in teamcity at 50% frequency I suspect because the actual SA's we are attempting to impersonate do not exist |
Thanks for letting me know! That failure is actually related to #11785 |
This PR adds acceptance tests for usage of
impersonate_service_account
that demonstrate:Note: this PR does not include testing usage of impersonate_service_account when using PF-implemented resource/data source as doing this in the context of Firebase (the only service with PF-implemented stuff) is very complex.
Release Note Template for Downstream PRs (will be copied)