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

Introduce equality checking of PreparedConfig in PrepareProviderConfig and ValidateProviderConfig #54

Merged
merged 2 commits into from
Feb 17, 2022

Commits on Feb 15, 2022

  1. Introduce equality checking of PreparedConfig in PrepareProviderConfi…

    …g and ValidateProviderConfig
    
    Reference: #51
    
    Previously in real world usage:
    
    ```
    
        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
    
        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.
    ```
    
    Updated unit testing before code changes:
    
    ```
    --- FAIL: TestMuxServerPrepareProviderConfig (0.00s)
        --- FAIL: TestMuxServerPrepareProviderConfig/PreparedConfig-multiple-equal (0.00s)
            mux_server_PrepareProviderConfig_test.go:365: wanted no error, got error: got a PrepareProviderConfig PreparedConfig response from multiple servers, not sure which to use
    FAIL
    FAIL    github.com/hashicorp/terraform-plugin-mux/tf5muxserver  1.244s
    
    --- FAIL: TestMuxServerValidateProviderConfig (0.00s)
        --- FAIL: TestMuxServerValidateProviderConfig/PreparedConfig-multiple-equal (0.00s)
            mux_server_ValidateProviderConfig_test.go:365: wanted no error, got error: got a ValidateProviderConfig PreparedConfig response from multiple servers, not sure which to use
    FAIL
    FAIL    github.com/hashicorp/terraform-plugin-mux/tf6muxserver  0.665s
    ```
    
    Verified those integration tests are now passing by replacing the mux dependency with this branch. Once those tests are published, we can introduce the integration tests into this project's testing workflow.
    bflad committed Feb 15, 2022
    Configuration menu
    Copy the full SHA
    2e18b67 View commit details
    Browse the repository at this point in the history
  2. Update CHANGELOG for #54

    bflad committed Feb 15, 2022
    Configuration menu
    Copy the full SHA
    d8fdec8 View commit details
    Browse the repository at this point in the history