Skip to content

Add tests around how plugin framework provider configuration code handles scopes values#8874

Merged
SarahFrench merged 22 commits into
mainfrom
add-pf-scopes-tests
Sep 12, 2023
Merged

Add tests around how plugin framework provider configuration code handles scopes values#8874
SarahFrench merged 22 commits into
mainfrom
add-pf-scopes-tests

Conversation

@SarahFrench

@SarahFrench SarahFrench commented Sep 6, 2023

Copy link
Copy Markdown
Contributor

This comment shares context about why we are adding these tests: #8818 (comment)

I recommend hiding whitespace changes when reviewing this PR!

In this PR, I:

  • Add test cases to match existing scopes SDK tests
  • Ensure tests present about handling empty values (e.g. empty strings, empty arrays)
  • Ensure tests present about handling Unknown values
  • Did some small refactoring:
    • (FrameworkProviderConfig).Scopes is now using types.List instead of []string
    • I removed a redundant var called defaultClientScopes

Release Note Template for Downstream PRs (will be copied)


SarahFrench and others added 18 commits August 31, 2023 01:00
…ig struct after `LoadAndValidateFramework` runs
…ata model, so mutations to the data within the function change the original struct

This enables tests to track how the data is mutated
@modular-magician

Copy link
Copy Markdown
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.

Terraform GA: Diff ( 6 files changed, 511 insertions(+), 33 deletions(-))
Terraform Beta: Diff ( 6 files changed, 511 insertions(+), 33 deletions(-))

@modular-magician

Copy link
Copy Markdown
Collaborator

Tests analytics

Total tests: 3011
Passed tests 2715
Skipped tests: 296
Affected tests: 0

$\textcolor{green}{\textsf{All tests passed in REPLAYING mode.}}$
View the build log

@SarahFrench SarahFrench marked this pull request as ready for review September 7, 2023 10:18
@SarahFrench SarahFrench requested a review from trodge September 7, 2023 10:18
@modular-magician

Copy link
Copy Markdown
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.

Terraform GA: Diff ( 3 files changed, 104 insertions(+), 22 deletions(-))
Terraform Beta: Diff ( 3 files changed, 104 insertions(+), 22 deletions(-))

@modular-magician

Copy link
Copy Markdown
Collaborator

Tests analytics

Total tests: 3014
Passed tests 2718
Skipped tests: 296
Affected tests: 0

$\textcolor{green}{\textsf{All tests passed in REPLAYING mode.}}$
View the build log

@modular-magician

Copy link
Copy Markdown
Collaborator

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

Breaking Change Detection Failed

The breaking change detector crashed during execution. This is usually due to the downstream provider(s) failing to compile. Please investigate or follow up with your reviewer.

Diff report

Your PR generated some diffs in downstreams - here they are.

Terraform GA: Diff ( 3 files changed, 105 insertions(+), 23 deletions(-))
Terraform Beta: Diff ( 3 files changed, 105 insertions(+), 23 deletions(-))

@SarahFrench

Copy link
Copy Markdown
Contributor Author

☝️ Problem due to a change lost when addressing merge conflicts

Comment on lines -55 to -57
var defaultClientScopes = []string{
"https://www.googleapis.com/auth/cloud-platform",
"https://www.googleapis.com/auth/userinfo.email",

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This defaultClientScopes was removed because it's a duplicate of transport_tpg.DefaultClientScopes

@modular-magician

Copy link
Copy Markdown
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.

Terraform GA: Diff ( 3 files changed, 104 insertions(+), 22 deletions(-))
Terraform Beta: Diff ( 3 files changed, 104 insertions(+), 22 deletions(-))

@modular-magician

Copy link
Copy Markdown
Collaborator

Tests analytics

Total tests: 3020
Passed tests 2723
Skipped tests: 297
Affected tests: 0

$\textcolor{green}{\textsf{All tests passed in REPLAYING mode.}}$
View the build log

@modular-magician

Copy link
Copy Markdown
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.

Terraform GA: Diff ( 3 files changed, 104 insertions(+), 22 deletions(-))
Terraform Beta: Diff ( 3 files changed, 104 insertions(+), 22 deletions(-))

@modular-magician

Copy link
Copy Markdown
Collaborator

Tests analytics

Total tests: 3027
Passed tests 2730
Skipped tests: 297
Affected tests: 0

$\textcolor{green}{\textsf{All tests passed in REPLAYING mode.}}$
View the build log

@SarahFrench SarahFrench merged commit 6fa353c into main Sep 12, 2023
RileyHYZ pushed a commit to RileyHYZ/magic-modules that referenced this pull request Sep 15, 2023
…dles `scopes` values (GoogleCloudPlatform#8874)

* Add initial version of plugin framework provider config test affected by inaccessible functions

* Refactor provider config tests to use plugin-framework types

* Add test case about handling of Unknown values for `project`

* Update tests to check values in BOTH the data model and provider config struct after `LoadAndValidateFramework` runs

* Add some tests for `credentials` in plugin framework provider, including test case that fails

* Update `LoadAndValidateFramework` to take a pointer to the provider data model, so mutations to the data within the function change the original struct

This enables tests to track how the data is mutated

* Add remaining `credentials` test cases to check PF/SDK config parity

* Make tests unset ADC ENV automatically, update comments to tests setting ADC ENV

* Add test for behaviour when credentials value is unknown

* Add comment referring devs to where unknown value test is implemented

* Remove duplicated test case

* Fix filename so it's generated correctly

* Remove fmt line

* Update `project` tests that are affected by `LoadAndValidateFramework` now taking a pointer as an argument

* Remove duplication of `defaultClientScopes` info, format `FrameworkProviderConfig` struct definition

* Update `FrameworkProviderConfig` to store scopes info using types.List, make field be populated with data

* Add initial version of tests for scopes in plugin framework config code

* Add remaining tests for `scopes`, update formatting of SDK version of test case

* Change (FrameworkProviderConfig).UserProjectOverride to types.Bool (again)
joelkattapuram pushed a commit to joelkattapuram/magic-modules that referenced this pull request Sep 20, 2023
…dles `scopes` values (GoogleCloudPlatform#8874)

* Add initial version of plugin framework provider config test affected by inaccessible functions

* Refactor provider config tests to use plugin-framework types

* Add test case about handling of Unknown values for `project`

* Update tests to check values in BOTH the data model and provider config struct after `LoadAndValidateFramework` runs

* Add some tests for `credentials` in plugin framework provider, including test case that fails

* Update `LoadAndValidateFramework` to take a pointer to the provider data model, so mutations to the data within the function change the original struct

This enables tests to track how the data is mutated

* Add remaining `credentials` test cases to check PF/SDK config parity

* Make tests unset ADC ENV automatically, update comments to tests setting ADC ENV

* Add test for behaviour when credentials value is unknown

* Add comment referring devs to where unknown value test is implemented

* Remove duplicated test case

* Fix filename so it's generated correctly

* Remove fmt line

* Update `project` tests that are affected by `LoadAndValidateFramework` now taking a pointer as an argument

* Remove duplication of `defaultClientScopes` info, format `FrameworkProviderConfig` struct definition

* Update `FrameworkProviderConfig` to store scopes info using types.List, make field be populated with data

* Add initial version of tests for scopes in plugin framework config code

* Add remaining tests for `scopes`, update formatting of SDK version of test case

* Change (FrameworkProviderConfig).UserProjectOverride to types.Bool (again)
@SarahFrench SarahFrench deleted the add-pf-scopes-tests branch September 26, 2023 13:44
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