Hi,
I’m currently testing upgrading from sdkv2 to framework (protocol6), I have been going through the recent upgrade docs which were merged into the framework project and taking a look at some of the examples, namely here: terraform-provider-random/resource_id_test.go at 21bf43373d6cfccdb5f818df5374d79637a88d02 · hashicorp/terraform-provider-random · GitHub
This led me to create the following acceptance test:
var testAccProtoV6ProviderFactories = map[string]func() (tfprotov6.ProviderServer, error){
"pingfederate": providerserver.NewProtocol6WithError(New("test")),
}
...
resource.ParallelTest(t, resource.TestCase{
Steps: []resource.TestStep{
{
ExternalProviders: map[string]resource.ExternalProvider{
"pingfederate": {
VersionConstraint: "0.0.24",
Source: "iwarapter/pingfederate",
},
},
Config: testAccPingFederateAuthenticationPolicyContractResourceConfig("email"),
Check: resource.ComposeTestCheckFunc(
testAccCheckPingFederateAuthenticationPolicyContractResourceExists(resourceName),
resource.TestCheckResourceAttr(resourceName, "name", "acc_test_one"),
resource.TestCheckResourceAttr(resourceName, "extended_attributes.0", "email"),
resource.TestCheckResourceAttr(resourceName, "extended_attributes.1", "foo"),
),
},
{
ProtoV6ProviderFactories: testAccProtoV6ProviderFactories,
PlanOnly: true,
Config: testAccPingFederateAuthenticationPolicyContractResourceConfig("email"),
Check: resource.ComposeTestCheckFunc(
testAccCheckPingFederateAuthenticationPolicyContractResourceExists(resourceName),
resource.TestCheckResourceAttr(resourceName, "name", "acc_test_one"),
resource.TestCheckResourceAttr(resourceName, "extended_attributes.0", "email"),
resource.TestCheckResourceAttr(resourceName, "extended_attributes.1", "foo"),
),
},
},
})
However this fails with:
Step 1/2 error: Error running pre-apply refresh:
Error: Inconsistent dependency lock file
The following dependency selections recorded in the lock file are
inconsistent with the current configuration:
- provider registry.terraform.io/hashicorp/pingfederate: required by this configuration but no version is selected
To update the locked dependency selections to match a changed configuration,
run:
terraform init -upgrade
github.com/hashicorp/terraform-plugin-framework v0.11.1
github.com/hashicorp/terraform-plugin-go v0.14.0
github.com/hashicorp/terraform-plugin-log v0.7.0
github.com/hashicorp/terraform-plugin-mux v0.7.0
github.com/hashicorp/terraform-plugin-sdk/v2 v2.21.0
Is there something obvious I am missing from this?