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

internal/fwserver: Unit testing and changelog for ConfigValidators diagnostics overwrites #622

Merged
merged 3 commits into from
Jan 13, 2023

Conversation

bflad
Copy link
Contributor

@bflad bflad commented Jan 13, 2023

Reference: #619

Against current main:

--- FAIL: TestServerValidateDataSourceConfig (0.00s)
    --- FAIL: TestServerValidateDataSourceConfig/request-config-DataSourceWithConfigValidators-diagnostics (0.00s)
        /Users/bflad/src/github.com/hashicorp/terraform-plugin-framework/internal/fwserver/server_validatedatasourceconfig_test.go:301: unexpected difference:   &fwserver.ValidateDataSourceConfigResponse{
            - 	Diagnostics: diag.Diagnostics{diag.ErrorDiagnostic{detail: "error detail 2", summary: "error summary 2"}},
            + 	Diagnostics: diag.Diagnostics{
            + 		diag.ErrorDiagnostic{detail: "error detail 1", summary: "error summary 1"},
            + 		diag.ErrorDiagnostic{detail: "error detail 2", summary: "error summary 2"},
            + 	},
              }
--- FAIL: TestServerValidateProviderConfig (0.00s)
    --- FAIL: TestServerValidateProviderConfig/request-config-ProviderWithConfigValidators-diagnostics (0.00s)
        /Users/bflad/src/github.com/hashicorp/terraform-plugin-framework/internal/fwserver/server_validateproviderconfig_test.go:307: unexpected difference:   &fwserver.ValidateProviderConfigResponse{
              	PreparedConfig: &{Raw: s`tftypes.Object["test":tftypes.String]<"test":tftypes.String<"tes`..., Schema: schema.Schema{Attributes: {"test": schema.StringAttribute{Required: true}}}},
            - 	Diagnostics:    diag.Diagnostics{diag.ErrorDiagnostic{detail: "error detail 2", summary: "error summary 2"}},
            + 	Diagnostics: diag.Diagnostics{
            + 		diag.ErrorDiagnostic{detail: "error detail 1", summary: "error summary 1"},
            + 		diag.ErrorDiagnostic{detail: "error detail 2", summary: "error summary 2"},
            + 	},
              }
--- FAIL: TestServerValidateResourceConfig (0.00s)
    --- FAIL: TestServerValidateResourceConfig/request-config-ResourceWithConfigValidators-diagnostics (0.00s)
        /Users/bflad/src/github.com/hashicorp/terraform-plugin-framework/internal/fwserver/server_validateresourceconfig_test.go:301: unexpected difference:   &fwserver.ValidateResourceConfigResponse{
            - 	Diagnostics: diag.Diagnostics{diag.ErrorDiagnostic{detail: "error detail 2", summary: "error summary 2"}},
            + 	Diagnostics: diag.Diagnostics{
            + 		diag.ErrorDiagnostic{detail: "error detail 1", summary: "error summary 1"},
            + 		diag.ErrorDiagnostic{detail: "error detail 2", summary: "error summary 2"},
            + 	},
              }

…agnostics overwrites

Reference: #619

Against current `main`:

```
--- FAIL: TestServerValidateDataSourceConfig (0.00s)
    --- FAIL: TestServerValidateDataSourceConfig/request-config-DataSourceWithConfigValidators-diagnostics (0.00s)
        /Users/bflad/src/github.com/hashicorp/terraform-plugin-framework/internal/fwserver/server_validatedatasourceconfig_test.go:301: unexpected difference:   &fwserver.ValidateDataSourceConfigResponse{
            - 	Diagnostics: diag.Diagnostics{diag.ErrorDiagnostic{detail: "error detail 2", summary: "error summary 2"}},
            + 	Diagnostics: diag.Diagnostics{
            + 		diag.ErrorDiagnostic{detail: "error detail 1", summary: "error summary 1"},
            + 		diag.ErrorDiagnostic{detail: "error detail 2", summary: "error summary 2"},
            + 	},
              }
--- FAIL: TestServerValidateProviderConfig (0.00s)
    --- FAIL: TestServerValidateProviderConfig/request-config-ProviderWithConfigValidators-diagnostics (0.00s)
        /Users/bflad/src/github.com/hashicorp/terraform-plugin-framework/internal/fwserver/server_validateproviderconfig_test.go:307: unexpected difference:   &fwserver.ValidateProviderConfigResponse{
              	PreparedConfig: &{Raw: s`tftypes.Object["test":tftypes.String]<"test":tftypes.String<"tes`..., Schema: schema.Schema{Attributes: {"test": schema.StringAttribute{Required: true}}}},
            - 	Diagnostics:    diag.Diagnostics{diag.ErrorDiagnostic{detail: "error detail 2", summary: "error summary 2"}},
            + 	Diagnostics: diag.Diagnostics{
            + 		diag.ErrorDiagnostic{detail: "error detail 1", summary: "error summary 1"},
            + 		diag.ErrorDiagnostic{detail: "error detail 2", summary: "error summary 2"},
            + 	},
              }
--- FAIL: TestServerValidateResourceConfig (0.00s)
    --- FAIL: TestServerValidateResourceConfig/request-config-ResourceWithConfigValidators-diagnostics (0.00s)
        /Users/bflad/src/github.com/hashicorp/terraform-plugin-framework/internal/fwserver/server_validateresourceconfig_test.go:301: unexpected difference:   &fwserver.ValidateResourceConfigResponse{
            - 	Diagnostics: diag.Diagnostics{diag.ErrorDiagnostic{detail: "error detail 2", summary: "error summary 2"}},
            + 	Diagnostics: diag.Diagnostics{
            + 		diag.ErrorDiagnostic{detail: "error detail 1", summary: "error summary 1"},
            + 		diag.ErrorDiagnostic{detail: "error detail 2", summary: "error summary 2"},
            + 	},
              }
```
@bflad bflad added this to the v1.1.0 milestone Jan 13, 2023
@bflad bflad requested a review from a team as a code owner January 13, 2023 14:04
Copy link
Contributor

@bendbennett bendbennett left a comment

Choose a reason for hiding this comment

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

LGTM 👍

@bflad bflad merged commit 032f768 into main Jan 13, 2023
@bflad bflad deleted the bflad/configvalidators-testing-changelog branch January 13, 2023 14:40
@github-actions
Copy link

I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active contributions.
If you have found a problem that seems related to this change, 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 Feb 13, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants