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

Consider Adding terraform-plugin-mux Providers for Integration Testing #42

Closed
4 tasks
bflad opened this issue Feb 7, 2022 · 1 comment · Fixed by #44
Closed
4 tasks

Consider Adding terraform-plugin-mux Providers for Integration Testing #42

bflad opened this issue Feb 7, 2022 · 1 comment · Fixed by #44
Assignees
Labels
enhancement New feature or request

Comments

@bflad
Copy link
Contributor

bflad commented Feb 7, 2022

Use cases

While the terraform-plugin-mux repository has really good unit and example testing coverage, it may also be desirable to perform integration testing with terraform-provider-corner to further suss out any potential breaking changes or regressions when making code changes.

Proposal

For the following terraform-plugin-mux packages:

  • tf5muxserver
  • tf5to6server
  • tf6muxserver
  • tf6to5server

Setup new internal/X providers in terraform-provider-corner that implement acceptance testing.

References

@bflad bflad added the enhancement New feature or request label Feb 7, 2022
bflad added a commit that referenced this issue Feb 15, 2022
Reference: #42
Reference: hashicorp/terraform-plugin-mux#50
Reference: hashicorp/terraform-plugin-mux#51

This adds integration testing providers for the following terraform-plugin-mux packages:

- tf5muxserver
- tf5to6server
- tf6muxserver
- tf6to5server

The underlying providers are mainly decoupled duplicates of the existing frameworkprovider and sdkv2provider to prevent unintended changes across all the tests.

The `tf5muxserver` and `tf6muxserver` testing currently highlights the issue reported in hashicorp/terraform-plugin-mux#51:

```
--- FAIL: TestAccResourceUser (0.42s)
    provider_test.go:11: Step 1/1 error: Error running pre-apply refresh: exit status 1

        Error: Invalid provider configuration

        Provider "registry.terraform.io/hashicorp/tf5muxprovider" requires explicit
        configuration. Add a provider block to the root module and configure the
        provider's required arguments as described in the provider documentation.

        Error: Plugin error

          with provider["registry.terraform.io/hashicorp/tf5muxprovider"],
          on <empty> line 0:
          (source code not available)

        The plugin returned an unexpected error from
        plugin.(*GRPCProvider).ValidateProviderConfig: rpc error: code = Unknown desc
        = got a PrepareProviderConfig PreparedConfig response from multiple servers,
        not sure which to use
FAIL
FAIL    github.com/hashicorp/terraform-provider-corner/internal/tf5muxprovider  0.859s

--- FAIL: TestAccResourceUser (0.51s)
    provider_test.go:11: Step 1/1 error: Error running pre-apply refresh: exit status 1

        Error: Plugin error

        The plugin returned an unexpected error from
        plugin6.(*GRPCProvider).ValidateProviderConfig: rpc error: code = Unknown
        desc = got a ValidateProviderConfig PreparedConfig response from multiple
        servers, not sure which to use

        Error: Invalid provider configuration

        Provider "registry.terraform.io/hashicorp/tf6muxprovider" requires explicit
        configuration. Add a provider block to the root module and configure the
        provider's required arguments as described in the provider documentation.

FAIL
FAIL    github.com/hashicorp/terraform-provider-corner/internal/tf6muxprovider  2.914s
```

Which will require upstream updates in terraform-plugin-mux before it will pass.

Dependencies updated via:

```shell
# required for latest terraform-plugin-go usage until v0.6.0 is released
go get github.com/hashicorp/terraform-plugin-framework@main
go get github.com/hashicorp/terraform-plugin-mux@v0.5.0
```
@bflad bflad self-assigned this Feb 15, 2022
@bflad bflad closed this as completed in #44 Feb 22, 2022
bflad added a commit that referenced this issue Feb 22, 2022
Reference: #42
Reference: hashicorp/terraform-plugin-mux#50
Reference: hashicorp/terraform-plugin-mux#51

This adds integration testing providers for the following terraform-plugin-mux packages:

- tf5muxserver
- tf5to6server
- tf6muxserver
- tf6to5server

The underlying providers are mainly decoupled duplicates of the existing frameworkprovider and sdkv2provider to prevent unintended changes across all the tests.
Copy link

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.
If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 22, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant