Skip to content
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 request_timeout #11848

Conversation

SarahFrench
Copy link
Contributor

@SarahFrench SarahFrench commented Sep 26, 2024

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

  • how the provider behaves when provider configuration arguments come from different sources ( config vs ENVs)
    • There are no ENVs for request_timeout
    • There are different default behaviours between SDK and PF
  • schema-level validation that's in place
    • Inputs must be parseable as a duration
      use cases: how does this argument impact the providers behaviour in plan/apply
    • I've implemented a test case where setting the timeout ridiculously low 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

This comment was marked as outdated.

@modular-magician

This comment was marked as outdated.

@SarahFrench SarahFrench marked this pull request as ready for review September 27, 2024 16:53
@SarahFrench SarahFrench requested a review from BBBmau September 27, 2024 16:53
@SarahFrench
Copy link
Contributor Author

SarahFrench commented Sep 27, 2024

@BBBmau requesting you as reviewer as you have experience about the different defaults for SDK vs PF from the past

@SarahFrench SarahFrench changed the title Add acceptance tests for request_timeout Add acceptance tests for request_timeout Sep 27, 2024
@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 ( 5 files changed, 317 insertions(+), 3 deletions(-))
google-beta provider: Diff ( 5 files changed, 317 insertions(+), 3 deletions(-))

@modular-magician

This comment was marked as outdated.

@modular-magician

This comment was marked as outdated.

@modular-magician
Copy link
Collaborator

Tests analytics

Total tests: 4118
Passed tests: 3704
Skipped tests: 413
Affected tests: 1

Click here to see the affected service packages

All service packages are affected

Action taken

Found 1 affected test(s) by replaying old test recordings. Starting RECORDING based on the most recent commit. Click here to see the affected tests
  • TestAccDataprocCluster_withAutoscalingPolicy

Get to know how VCR tests work

@modular-magician
Copy link
Collaborator

🔴 Tests failed during RECORDING mode:
TestAccDataprocCluster_withAutoscalingPolicy[Error message] [Debug log]

🔴 Errors occurred during RECORDING mode. Please fix them to complete your PR.

View the build log or the debug log for each test

Copy link

github-actions bot commented Oct 2, 2024

@BBBmau This PR has been waiting for review for 3 weekdays. Please take a look! Use the label disable-review-reminders to disable these notifications.

Copy link

github-actions bot commented Oct 4, 2024

@GoogleCloudPlatform/terraform-team @BBBmau This PR has been waiting for review for 1 week. Please take a look! Use the label disable-review-reminders to disable these notifications.

@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 ( 5 files changed, 317 insertions(+), 2 deletions(-))
google-beta provider: Diff ( 5 files changed, 317 insertions(+), 2 deletions(-))

@modular-magician
Copy link
Collaborator

Tests analytics

Total tests: 4140
Passed tests: 3719
Skipped tests: 416
Affected tests: 5

Click here to see the affected service packages

All service packages are affected

Action taken

Found 5 affected test(s) by replaying old test recordings. Starting RECORDING based on the most recent commit. Click here to see the affected tests
  • TestAccDataformRepositoryReleaseConfig_dataformRepositoryReleaseConfigExample
  • TestAccDataformRepositoryWorkflowConfig_dataformRepositoryWorkflowConfigExample
  • TestAccDataformRepository_dataformRepositoryWithCloudsourceRepoAndSshExample
  • TestAccDataformRepository_updated
  • TestAccDataprocCluster_withAutoscalingPolicy

Get to know how VCR tests work

@modular-magician
Copy link
Collaborator

🔴 Tests failed during RECORDING mode:
TestAccDataformRepositoryReleaseConfig_dataformRepositoryReleaseConfigExample[Error message] [Debug log]
TestAccDataformRepositoryWorkflowConfig_dataformRepositoryWorkflowConfigExample[Error message] [Debug log]
TestAccDataformRepository_dataformRepositoryWithCloudsourceRepoAndSshExample[Error message] [Debug log]
TestAccDataformRepository_updated[Error message] [Debug log]
TestAccDataprocCluster_withAutoscalingPolicy[Error message] [Debug log]

🔴 Errors occurred during RECORDING mode. Please fix them to complete your PR.

View the build log or the debug log for each test

Copy link

@GoogleCloudPlatform/terraform-team @BBBmau This PR has been waiting for review for 2 weeks. Please take a look! Use the label disable-review-reminders to disable these notifications.

@SarahFrench
Copy link
Contributor Author

@BBBmau could I get a review?

Copy link

@GoogleCloudPlatform/terraform-team @BBBmau This PR has been waiting for review for 3 weeks. Please take a look! Use the label disable-review-reminders to disable these notifications.

Copy link
Collaborator

@BBBmau BBBmau left a comment

Choose a reason for hiding this comment

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

approving after running tests locally and getting passing. Everything looks good also.

Failing tests from VCR are unrelated to the PR.

(base) ┌─(~/Dev/terraform-provider-google)─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────(mau@mau-JKDT676NCP:s018)─┐
└─(12:07:05 on main)──> envchain GCLOUD make testacc  TEST=./google/fwprovider TESTARGS='-run TestAccFwProvider_request_timeout'                                                                                                                    ──(Fri,Oct18)─┘
TF_ACC=1 TF_SCHEMA_PANIC_ON_ERROR=1 go test ./google/fwprovider -v -run TestAccFwProvider_request_timeout -timeout 240m -ldflags="-X=github.com/hashicorp/terraform-provider-google/version.ProviderVersion=acc"
=== RUN   TestAccFwProvider_request_timeout
=== RUN   TestAccFwProvider_request_timeout/a_default_value_of_120s_is_used_when_there_are_no_user_inputs
=== RUN   TestAccFwProvider_request_timeout/request_timeout_can_be_set_in_config_in_different_formats,_are_NOT_normalized_to_full-length_format
=== RUN   TestAccFwProvider_request_timeout/when_request_timeout_is_set_to_an_empty_string_in_the_config_the_value_fails_validation,_as_it_is_not_a_duration
--- PASS: TestAccFwProvider_request_timeout (24.07s)
    --- PASS: TestAccFwProvider_request_timeout/a_default_value_of_120s_is_used_when_there_are_no_user_inputs (8.91s)
    --- PASS: TestAccFwProvider_request_timeout/request_timeout_can_be_set_in_config_in_different_formats,_are_NOT_normalized_to_full-length_format (13.40s)
    --- PASS: TestAccFwProvider_request_timeout/when_request_timeout_is_set_to_an_empty_string_in_the_config_the_value_fails_validation,_as_it_is_not_a_duration (1.76s)
PASS
ok      github.com/hashicorp/terraform-provider-google/google/fwprovider        25.528s
(base) ┌─(~/Dev/terraform-provider-google)─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────(mau@mau-JKDT676NCP:s018)─┐
└─(12:08:30 on main ✹ ✭)──> envchain GCLOUD make testacc  TEST=./google/provider TESTARGS='-run TestAccSdkProvider_request_timeout'                                                                                                                 ──(Fri,Oct18)─┘
TF_ACC=1 TF_SCHEMA_PANIC_ON_ERROR=1 go test ./google/provider -v -run TestAccSdkProvider_request_timeout -timeout 240m -ldflags="-X=github.com/hashicorp/terraform-provider-google/version.ProviderVersion=acc"
=== RUN   TestAccSdkProvider_request_timeout
=== RUN   TestAccSdkProvider_request_timeout/when_request_timeout_is_set_to_an_empty_string_in_the_config_the_value_fails_validation,_as_it_is_not_a_duration
=== RUN   TestAccSdkProvider_request_timeout/short_timeouts_impact_provisioning_resources
=== RUN   TestAccSdkProvider_request_timeout/a_default_value_of_0s_is_used_when_there_are_no_user_inputs_(it_is_overridden_downstream)
=== RUN   TestAccSdkProvider_request_timeout/request_timeout_can_be_set_in_config_in_different_formats,_are_normalized_to_full-length_format
--- PASS: TestAccSdkProvider_request_timeout (53.63s)
    --- PASS: TestAccSdkProvider_request_timeout/when_request_timeout_is_set_to_an_empty_string_in_the_config_the_value_fails_validation,_as_it_is_not_a_duration (2.21s)
    --- PASS: TestAccSdkProvider_request_timeout/short_timeouts_impact_provisioning_resources (29.32s)
    --- PASS: TestAccSdkProvider_request_timeout/a_default_value_of_0s_is_used_when_there_are_no_user_inputs_(it_is_overridden_downstream) (8.14s)
    --- PASS: TestAccSdkProvider_request_timeout/request_timeout_can_be_set_in_config_in_different_formats,_are_normalized_to_full-length_format (13.96s)
PASS
ok      github.com/hashicorp/terraform-provider-google/google/provider  55.103s

@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 ( 5 files changed, 320 insertions(+), 2 deletions(-))
google-beta provider: Diff ( 5 files changed, 320 insertions(+), 2 deletions(-))

@modular-magician
Copy link
Collaborator

Tests analytics

Total tests: 4203
Passed tests: 3781
Skipped tests: 422
Affected tests: 0

Click here to see the affected service packages

All service packages are affected

🟢 All tests passed!

View the build log

@SarahFrench SarahFrench merged commit 95e23d1 into GoogleCloudPlatform:main Oct 21, 2024
10 checks passed
BBBmau added a commit to BBBmau/magic-modules that referenced this pull request Oct 21, 2024
BBBmau added a commit to BBBmau/magic-modules that referenced this pull request Oct 21, 2024
BBBmau added a commit to BBBmau/magic-modules that referenced this pull request Oct 23, 2024
BBBmau added a commit to BBBmau/magic-modules that referenced this pull request Oct 24, 2024
BBBmau added a commit to BBBmau/magic-modules that referenced this pull request Nov 5, 2024
BBBmau added a commit to BBBmau/magic-modules that referenced this pull request Nov 13, 2024
akshat-jindal-nit pushed a commit to akshat-jindal-nit/magic-modules that referenced this pull request Nov 18, 2024
amanMahendroo pushed a commit to amanMahendroo/magic-modules that referenced this pull request Dec 17, 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