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

Open
wants to merge 8 commits into
base: main
Choose a base branch
from

Conversation

SarahFrench
Copy link
Collaborator

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

@modular-magician
Copy link
Collaborator

Tests analytics

Total tests: 4103
Passed tests: 3690
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

}
}

func testAccSdkProvider_request_timeout_providerDefault(t *testing.T) {
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I forgot to put this comment in, explaining the different defaults for this field in the SDK vs PF code. I'll save adding it until after review, as it's something worth making explicit to the reviewer.

Suggested change
func testAccSdkProvider_request_timeout_providerDefault(t *testing.T) {
// In the SDK version of the provider config code request_timeout has a zero value of "0s" and no default.
// The final 'effective' value is "120s", matching the default used in the plugin-framework version of the provider config code.
// See : https://github.com/hashicorp/terraform-provider-google/blob/09cb850ee64bcd78e4457df70905530c1ed75f19/google/transport/config.go#L1228-L1233
func testAccSdkProvider_request_timeout_providerDefault(t *testing.T) {

@SarahFrench SarahFrench marked this pull request as ready for review September 27, 2024 16:53
@SarahFrench
Copy link
Collaborator 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
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, 316 insertions(+), 3 deletions(-))
google-beta provider: Diff ( 5 files changed, 316 insertions(+), 3 deletions(-))

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.

2 participants