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

tf5muxserver+tf6muxserver: GetProviderSchema Diagnostics Missing Severity #152

Closed
bflad opened this issue Apr 21, 2023 · 1 comment · Fixed by #153
Closed

tf5muxserver+tf6muxserver: GetProviderSchema Diagnostics Missing Severity #152

bflad opened this issue Apr 21, 2023 · 1 comment · Fixed by #153
Labels
bug Something isn't working

Comments

@bflad
Copy link
Contributor

bflad commented Apr 21, 2023

terraform-plugin-mux version

v0.9.0

Relevant provider source code

In github.com/hashicorp/terraform-provider-dns:

func TestAccProvider_Update_Server_Env(t *testing.T) {
	t.Setenv("DNS_UPDATE_SERVER", "example.com")

	resource.Test(t, resource.TestCase{
		ProtoV5ProviderFactories: testProtoV5ProviderFactories,
		Steps: []resource.TestStep{
			{
				Config: `
				data "dns_a_record_set" "test" {
					# Same host as data source testing
					host = "terraform-provider-dns-a.hashicorptest.com"
				}
				`,
				Check: resource.ComposeAggregateTestCheckFunc(
					resource.TestCheckResourceAttr("data.dns_a_record_set.test", "addrs.#", "1"),
				),
			},
		},
	})
}

Expected Behavior

Similar to running this outside terraform-plugin-testing, the acceptance test to fail with the terraform-plugin-mux mismatched schema error in the GetProviderSchema response.

Actual Behavior

Acceptance testing passes because the terraform-plugin-mux diagnostics are missing a severity. The acceptance testing is dependent on terraform-exec's error return from Terraform commands to be populated, but since the diagnostic is not an error diagnostic, it does not fill in the error return.

Enabling trace logging shows the issue:

2023-04-21T12:59:08.670-0400 [TRACE] sdk.proto: Received downstream response: tf_provider_addr=registry.terraform.io/hashicorp/dns tf_proto_version=5.3 tf_req_id=e00c4292-8082-32c4-e1b2-526b6f989c7b tf_rpc=GetProviderSchema diagnostic_warning_count=0 tf_req_duration_ms=0 diagnostic_error_count=0
2023-04-21T12:59:08.670-0400 [WARN]  sdk.proto: Response contains unknown diagnostic: tf_proto_version=5.3 diagnostic_severity=INVALID diagnostic_summary="Invalid Provider Server Combination"
  diagnostic_detail=
  | The combined provider has differing provider schema implementations across providers. Provider schemas must be identical across providers. This is always an issue in the provider implementation and should be reported to the provider developers...

Steps to Reproduce

  1. Add new test to terraform-provider-dns
  2. TF_LOG=TRACE TF_ACC=1 go test -count=1 -run='TestAccProvider_Update_Server_Env' -v ./internal/provider
=== RUN   TestAccProvider_Update_Server_Env
--- PASS: TestAccProvider_Update_Server_Env (0.79s)
PASS
ok      github.com/hashicorp/terraform-provider-dns/internal/provider   1.085s

References

@bflad bflad added the bug Something isn't working label Apr 21, 2023
bflad added a commit that referenced this issue Apr 21, 2023
…hema` response set error severity in diagnostics

Reference: #152
bflad added a commit that referenced this issue Apr 21, 2023
…hema` response set error severity in diagnostics (#153)

Reference: #152
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 24, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
1 participant