Skip to content

Add acceptance tests for how provider handles scopes argument #11860

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

Conversation

SarahFrench
Copy link
Contributor

@SarahFrench SarahFrench commented Sep 27, 2024

This PR adds acceptance tests for usage of scopes that demonstrate:

  • how the provider behaves when provider configuration arguments come from different sources ( config vs ENVs)
    • There are no ENVs for scopes
    • There is a default set of scopes used if the argument isn't supplied
  • schema-level validation that's in place
    • There isn't any validation about empty lists, instead the empty list is ignored
  • use cases: how does this argument impact the providers behaviour in plan/apply
    • I've implemented a test case where setting the scopes to incorrect values causes provisioning to fail.

Release Note Template for Downstream PRs (will be copied)


@modular-magician

This comment was marked as outdated.

@modular-magician

This comment was marked as outdated.

@modular-magician
Copy link
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 ( 2 files changed, 288 insertions(+))
google-beta provider: Diff ( 2 files changed, 345 insertions(+))

@SarahFrench
Copy link
Contributor Author

TeamCity tests:

@SarahFrench SarahFrench marked this pull request as ready for review September 27, 2024 18:40
@SarahFrench SarahFrench requested a review from c2thorn September 27, 2024 18:40
@modular-magician
Copy link
Collaborator

Tests analytics

Total tests: 4101
Passed tests: 3688
Skipped tests: 413
Affected tests: 0

Click here to see the affected service packages

All service packages are affected

$\textcolor{red}{\textsf{Errors occurred during REPLAYING mode. Please fix them to complete your PR.}}$

View the build log

@SarahFrench
Copy link
Contributor Author

I'm not sure what's going on in the failure above, very hard to search in the logs

@SarahFrench
Copy link
Contributor Author

/gcbrun

@modular-magician
Copy link
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 ( 2 files changed, 288 insertions(+))
google-beta provider: Diff ( 2 files changed, 345 insertions(+))

@modular-magician
Copy link
Collaborator

Tests analytics

Total tests: 4107
Passed tests: 3694
Skipped tests: 413
Affected tests: 0

Click here to see the affected service packages

All service packages are affected

$\textcolor{green}{\textsf{All tests passed!}}$

View the build log

//no ENVs to test

// Schema-level validation
"when scopes is set to an empty array in the config the value is ignored and default scopes are used": testAccSdkProvider_scopes_emptyArray,
Copy link
Member

Choose a reason for hiding this comment

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

nice capturing this case!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks 😁 We could add some validation in future to make the scenario more explicit, i.e. block empty arrays so users aren't lulled into a false sense of using no scopes, but that'd be a breaking change. And I don't even know if setting zero scopes is something users would attempt to do, but I can imagine there's someone out there doing it!

@SarahFrench SarahFrench merged commit 2c7fe8a into GoogleCloudPlatform:main Sep 30, 2024
13 checks passed
anavada pushed a commit to anavada/magic-modules that referenced this pull request Sep 30, 2024
karolgorc pushed a commit to karolgorc/magic-modules that referenced this pull request Oct 4, 2024
niharika-98 pushed a commit to niharika-98/magic-modules that referenced this pull request Oct 7, 2024
trodge pushed a commit to trodge/magic-modules that referenced this pull request Oct 10, 2024
karolgorc pushed a commit to karolgorc/magic-modules that referenced this pull request Oct 11, 2024
BBBmau pushed a commit to BBBmau/magic-modules that referenced this pull request Oct 23, 2024
BBBmau pushed a commit to BBBmau/magic-modules that referenced this pull request Oct 24, 2024
Philip-Jonany pushed a commit to Philip-Jonany/magic-modules that referenced this pull request Nov 4, 2024
BBBmau pushed a commit to BBBmau/magic-modules that referenced this pull request Nov 5, 2024
akshat-jindal-nit pushed a commit to akshat-jindal-nit/magic-modules that referenced this pull request Nov 18, 2024
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.

3 participants