-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Refactor muxing 1 : Re-use same config to configure the SDK and PF providers, fix VCR testing #11903
base: main
Are you sure you want to change the base?
Refactor muxing 1 : Re-use same config to configure the SDK and PF providers, fix VCR testing #11903
Conversation
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.
|
Initial acc tests for the SDK and PF provider code. These tests aren't final, as we're waiting for some more acc tests to be added to the code base and then pulled into this PR. GA Provider: Beta Provider:
Test failures:
|
Tests analyticsTotal tests: 4138 Click here to see the affected service packages
Action takenFound 11 affected test(s) by replaying old test recordings. Starting RECORDING based on the most recent commit. Click here to see the affected tests
|
🟢 Tests passed during RECORDING mode: 🟢 No issues found for passed tests after REPLAYING rerun. 🔴 Tests failed during RECORDING mode: 🔴 Errors occurred during RECORDING mode. Please fix them to complete your PR. |
Latest commits address some of the test failures described in this 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.
🟢 Tests passed during RECORDING mode: 🟢 No issues found for passed tests after REPLAYING rerun. 🔴 Tests failed during RECORDING mode: 🔴 Errors occurred during RECORDING mode. Please fix them to complete your PR. |
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
🟢 Tests passed during RECORDING mode: 🟢 No issues found for passed tests after REPLAYING rerun. 🔴 Tests failed during RECORDING mode: 🔴 Errors occurred during RECORDING mode. Please fix them to complete your PR. |
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.
Approval for Firebase since the changes are mechanical in nature and Firebase tests are passing.
…ruct This allows the PF provider to access any data on the SDK provider, including the meta/Config struct that will be created when the SDK provider is configured.
…struct to all data sources and resources, instead of `FrameworkProviderConfig`
… Config struct to be usable in those places. - Replace use of FrameworkProviderConfig with Config - Add Beta-only `NewFirebaseClient` method to Config struct for use with Firebase data sources - Update LocationDescriber interface - Misc places where the SDK and PF type systems meet and string needs to be converted to types.StringType
…, adapt to type system changes
- This carries over the idea of configuring the PF provider using the SDK provider. The changes in the MuxedProviders func mimic changes already made in main.go. - Remove unnecessary duplication of cached configs per test name; now one used regardless of PF/SDK - Updates to some DestroyProducer functions so they access the cached SDK Config struct to get a client - Remove GetFwTestProvider and the file containing it - this isn't needed.
…ovider-google#14158 - Use of older TPG versions through ExternalProviders breaks VCR, so that is also removed from TestAccDataSourceGoogleFirebaseAppleAppConfig
…" in the PF provider's meta struct
…e now ignored and ENVs can be used instead
…el_addition_strategy` acctest to reflect how the SDK configuration logic now affects the PF provider
…se of ExternalProviders to get other versions of TPG/TPGB
Here I'm running acceptance tests to see which ones fail, similar to #11903 (comment) above. TeamCity links: SDK test failuresSDK test failures typically represent validation that was provided by the PF configuration logic being removed as part of the muxing fixes. In the SDK tests above the only failure is
This shows that the muxing fixes have stopped some validation originating from the plugin-framework code that detects when the string it's parsable as a duration. The original validation observed for this field in the PF code doesn't originate from the schema as there are no Validators for that field. Instead I believe this code would raise an error when the PF provider's configuration logic was handling a non-parsable duration string. That code is no longer used for configuring the PF provider after this PR changes to muxing. To solve this we could either:
PF test failures"found when not expected"These test failures are due to how the muxing fixes will change the behaviour of unset field in the data source
Similarly
Also,
The solutions to these are to update how the test is defined. The test failures don't reflect changes that would impact users. TestAccFwProvider_request_timeout
We should just update the test to reflect the SDK default being used here now, so the test matches the SDK equivalent: https://github.com/hashicorp/terraform-provider-google/blob/82d641bafd47d8863aaa6a07521a51207ad92732/google/provider/provider_request_timeout_test.go#L19
In the PF code previously, if you supplied "3m" as a duration string it would remain that way. In contrast, the SDK code will convert that value to the longer-form "3m0s". This disparity is noted here in the test. The solution here is to update the test to match the SDK behaviour.
This is failing for the same reason as explained in the SDK test failures section above. |
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
… of duration strings
…ema, to replace validation that took place in PF configuration logic
The last few commits are acting on my comments in #11903 (comment) Edit: 0f85c17 was a correction to one of these commits |
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.
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: 4215 Click here to see the affected service packages
Action takenFound 3 affected test(s) by replaying old test recordings. Starting RECORDING based on the most recent commit. Click here to see the affected tests
|
🟢 Tests passed during RECORDING mode: 🔴 Tests failed when rerunning REPLAYING mode: Tests failed due to non-determinism or randomness when the VCR replayed the response after the HTTP request was made. Please fix these to complete your PR. If you believe these test failures to be incorrect or unrelated to your change, or if you have any questions, please raise the concern with your reviewer. 🔴 Tests failed during RECORDING mode: 🔴 Errors occurred during RECORDING mode. Please fix them to complete your PR. |
After the previous commits' changes to tests to address the discussion in #11903 (comment) I've re-run acceptance tests in TeamCity: SDK tests Framework tests |
Also, today I did some manual testing to confirm that this PR fixes some authentication bugs that were introduced by muxing: hashicorp/terraform-provider-google#16832 (comment) That comment has information about how to reproduce the bug and how to use my fork of the TPG repo to test how this PR's changes fix the issue. |
Opened for review - I've stopped doing self-review and manual testing, so I'm waiting on review comments either about the code, testing or to coordinate merging the PR |
Fixes hashicorp/terraform-provider-google#18774
Summary
This PR:
fwtransport.FrameworkProviderConfig
structtransport_tpg.Config
struct from the SDK provider, with no duplication of logic to process user inputs.transport_tpg.Config
structThings to pay attention to during review/testing