-
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
Improve tests for SDK-based util functions, add tests to the new plugin framework equivalents #7555
Conversation
Oops! It looks like you're using an unknown release-note type in your changelog entries:
Please only use the types listed in https://github.com/GoogleCloudPlatform/magic-modules/blob/master/.ci/RELEASE_NOTES_GUIDE.md. |
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 moved this test to a different file as it's not really a 'provider' test, though that may have made sense at the time this code was written!
It's now called TestGetRegionFromZone
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. Terraform GA: Diff ( 4 files changed, 209 insertions(+), 66 deletions(-)) |
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. Terraform GA: Diff ( 5 files changed, 261 insertions(+), 66 deletions(-)) |
Tests analyticsTotal tests: Action takenFound 29 affected test(s) by replaying old test recordings. Starting RECORDING based on the most recent commit. Click here to see the affected testsTestAccFirebaserulesRelease_BasicRelease|TestAccComputeRegionPerInstanceConfig_statefulIps|TestAccComputePerInstanceConfig_statefulIps|TestAccComputeRegionBackendService_withBackendMultiNic|TestAccComputeInstanceTemplate_IPv6|TestAccComputeInstanceTemplate_secondaryAliasIpRange|TestAccComputeRegionBackendService_regionBackendServiceBalancingModeExample|TestAccInstanceGroupManager_stateful|TestAccComputeInstanceTemplate_subnet_auto|TestAccComputeForwardingRule_internalTcpUdpLbWithMigBackendExample|TestAccComputeInstanceTemplate_subnet_custom|TestAccComputeForwardingRule_internalHttpLbWithMigBackendExample|TestAccComputeGlobalForwardingRule_externalHttpLbMigBackendCustomHeaderExample|TestAccComputeGlobalForwardingRule_externalTcpProxyLbMigBackendExample|TestAccComposerEnvironment_withWebServerConfig|TestAccComposerEnvironmentAirflow2_withSoftwareConfig|TestAccComposerEnvironment_withSoftwareConfig|TestAccComputeForwardingRule_forwardingRuleRegionalHttpXlbExample|TestAccComputeForwardingRule_forwardingRuleHttpLbExample|TestAccApigeeKeystoresAliasesKeyCertFile_apigeeKeystoresAliasesKeyCertFileTestExample|TestAccCloudRunV2Job_cloudrunv2JobVpcaccessExample|TestAccFrameworkProviderMeta_setModuleName|TestAccComposerEnvironment_UpdateComposerV2WithTriggerer|TestAccDataSourceDNSKeys_noDnsSec|TestAccDataSourceDNSKeys_basic|TestAccDataSourceDnsManagedZone_basic|TestAccDataSourceGoogleFirebaseAppleAppConfig|TestAccDataSourceDnsRecordSet_basic|TestAccFrameworkProviderBasePath_setBasePath |
Tests passed during RECORDING mode: Tests failed during RECORDING mode: Please fix these to complete your PR |
👆 That's the last little tweak from me, I learned a better way to omit a value in a framework test |
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. Terraform GA: Diff ( 5 files changed, 261 insertions(+), 66 deletions(-)) |
Tests analyticsTotal tests: Action takenFound 13 affected test(s) by replaying old test recordings. Starting RECORDING based on the most recent commit. Click here to see the affected testsTestAccFirebaserulesRelease_BasicRelease|TestAccComposerEnvironmentAirflow2_withSoftwareConfig|TestAccComputeForwardingRule_update|TestAccComposerEnvironment_withSoftwareConfig|TestAccComposerEnvironment_UpdateComposerV2WithTriggerer|TestAccFrameworkProviderBasePath_setBasePath|TestAccApigeeKeystoresAliasesKeyCertFile_apigeeKeystoresAliasesKeyCertFileTestExample|TestAccDataSourceDNSKeys_basic|TestAccDataSourceDnsManagedZone_basic|TestAccDataSourceDNSKeys_noDnsSec|TestAccDataSourceDnsRecordSet_basic|TestAccFrameworkProviderMeta_setModuleName|TestAccDataSourceGoogleFirebaseAppleAppConfig |
Tests passed during RECORDING mode: Tests failed during RECORDING mode: Please fix these 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.
LGTM. Please rebase the main branch because of the merged PR #7446. Thanks.
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. Terraform GA: Diff ( 5 files changed, 261 insertions(+), 66 deletions(-)) |
Tests analyticsTotal tests: Errors occurred during REPLAYING mode. Please fix them to complete your PR |
I'll look into the failure later today Edit: it's due to the issues with the compute region instance template data source, see: hashicorp/terraform-provider-google#14183 I'll sit and wait until that's fixed |
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. Terraform GA: Diff ( 5 files changed, 261 insertions(+), 66 deletions(-)) |
Tests analyticsTotal tests: Errors occurred during REPLAYING mode. Please fix them to complete your PR |
`ResourceComputeRegionInstanceTemplate` was removed?
Seems like the issue is that my test was using something that has since been removed from TPGB, very confusing |
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. Terraform GA: Diff ( 5 files changed, 261 insertions(+), 66 deletions(-)) |
Tests analyticsTotal tests: Action takenFound 4 affected test(s) by replaying old test recordings. Starting RECORDING based on the most recent commit. Click here to see the affected testsTestAccFirebaserulesRelease_BasicRelease|TestAccComposerEnvironment_withEncryptionConfigComposer2|TestAccApigeeKeystoresAliasesKeyCertFile_apigeeKeystoresAliasesKeyCertFileTestExample|TestAccApigeeEnvKeystoreAliasPkcs12_apigeeEnvKeystoreAliasPkcs12Example |
Tests passed during RECORDING mode: All tests passed |
…in framework equivalents (GoogleCloudPlatform#7555) * Add unit tests for `getProject` util * Refactor existing `TestGetZone` test * Move existing `getRegionFromZone` test alongside other util unit tests * Rename `getRegionFromZone` unit test * Refactor `TestGetRegion` unit test * Simplify acc test setup code * Change unit test to use subtests via `t.Run` * Add unit test for `getProjectFramework` util function * Fix comment * Update test to set null value more explicitly using `types.StringNull()` * Replace example schema for test `ResourceComputeRegionInstanceTemplate` was removed?
…in framework equivalents (GoogleCloudPlatform#7555) * Add unit tests for `getProject` util * Refactor existing `TestGetZone` test * Move existing `getRegionFromZone` test alongside other util unit tests * Rename `getRegionFromZone` unit test * Refactor `TestGetRegion` unit test * Simplify acc test setup code * Change unit test to use subtests via `t.Run` * Add unit test for `getProjectFramework` util function * Fix comment * Update test to set null value more explicitly using `types.StringNull()` * Replace example schema for test `ResourceComputeRegionInstanceTemplate` was removed?
…in framework equivalents (GoogleCloudPlatform#7555) * Add unit tests for `getProject` util * Refactor existing `TestGetZone` test * Move existing `getRegionFromZone` test alongside other util unit tests * Rename `getRegionFromZone` unit test * Refactor `TestGetRegion` unit test * Simplify acc test setup code * Change unit test to use subtests via `t.Run` * Add unit test for `getProjectFramework` util function * Fix comment * Update test to set null value more explicitly using `types.StringNull()` * Replace example schema for test `ResourceComputeRegionInstanceTemplate` was removed?
…in framework equivalents (GoogleCloudPlatform#7555) * Add unit tests for `getProject` util * Refactor existing `TestGetZone` test * Move existing `getRegionFromZone` test alongside other util unit tests * Rename `getRegionFromZone` unit test * Refactor `TestGetRegion` unit test * Simplify acc test setup code * Change unit test to use subtests via `t.Run` * Add unit test for `getProjectFramework` util function * Fix comment * Update test to set null value more explicitly using `types.StringNull()` * Replace example schema for test `ResourceComputeRegionInstanceTemplate` was removed?
This PR:
getProject
function that depends on the provider SDKgetProjectFramework
function, a version that that depends on the plugin framework instead of the SDKTestGetRegion
TestGetZone
If this PR is for Terraform, I acknowledge that I have:
make test
andmake lint
in the generated providers to ensure it passes unit and linter tests.Release Note Template for Downstream PRs (will be copied)