Skip to content

fix mock provider validation#2140

Merged
ollevche merged 7 commits into
mainfrom
fix-mock-provider-validation
Nov 20, 2024
Merged

fix mock provider validation#2140
ollevche merged 7 commits into
mainfrom
fix-mock-provider-validation

Conversation

@ollevche

@ollevche ollevche commented Nov 5, 2024

Copy link
Copy Markdown
Contributor

Resolves #2139
Resolves #2038

In the initial implementation of mock providers, I missed that the validation of the provider block must also be skipped. In this PR I disable ValidateProviderConfig calls and remove provider-related schemas from GetProviderSchema call for any mocked provider.

Target Release

1.9.0

Checklist

  • I have read the contribution guide.
  • I have not used an AI coding assistant to create this PR.
  • I have written all code in this PR myself OR I have marked all code I have not written myself (including modified code, e.g. copied from other places and then modified) with a comment indicating where it came from.
  • I (and other contributors to this PR) have not looked at the Terraform source code while implementing this PR.

Go checklist

  • I have run golangci-lint on my change and receive no errors relevant to my code.
  • I have run existing tests to ensure my code doesn't break anything.
  • I have added tests for all relevant use cases of my code, and those tests are passing.
  • I have only exported functions, variables and structs that should be used from other packages.
  • I have added meaningful comments to all exported functions, variables, and structs.

@github-actions

github-actions Bot commented Nov 5, 2024

Copy link
Copy Markdown

Reminder for the PR assignee: If this is a user-visible change, please update the changelog as part of the PR.

@ollevche

ollevche commented Nov 5, 2024

Copy link
Copy Markdown
Contributor Author

The fix should also be backported to OpenTofu 1.8

Comment thread internal/tofu/provider_for_test_framework.go
Signed-off-by: ollevche <ollevche@gmail.com>
Signed-off-by: ollevche <ollevche@gmail.com>
Signed-off-by: ollevche <ollevche@gmail.com>
Signed-off-by: ollevche <ollevche@gmail.com>
Signed-off-by: ollevche <ollevche@gmail.com>
Signed-off-by: ollevche <ollevche@gmail.com>
Signed-off-by: ollevche <ollevche@gmail.com>
@ollevche ollevche force-pushed the fix-mock-provider-validation branch from f3d0710 to b2f46ba Compare November 20, 2024 14:02
@ollevche ollevche requested a review from cam72cam November 20, 2024 14:20
@ollevche ollevche merged commit 2758f2c into main Nov 20, 2024
@ollevche ollevche deleted the fix-mock-provider-validation branch November 20, 2024 14:45
ollevche added a commit that referenced this pull request Nov 20, 2024
Signed-off-by: ollevche <ollevche@gmail.com>
ollevche added a commit that referenced this pull request Nov 20, 2024
Signed-off-by: ollevche <ollevche@gmail.com>
apparentlymart pushed a commit that referenced this pull request Dec 3, 2024
Signed-off-by: ollevche <ollevche@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants