configs/configupgrade: Partially fix TestUpgradeValid
This is still not compileable because the test provider needs to be updated to the new provider interface, but all the rest of the types are now correct so we can update the test provider in a later commit to make this work again.
This commit is contained in:
parent
2b5d9506b1
commit
85aa8769db
|
@ -10,7 +10,7 @@ import (
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
testprovider "github.com/hashicorp/terraform/builtin/providers/test"
|
testprovider "github.com/hashicorp/terraform/builtin/providers/test"
|
||||||
"github.com/hashicorp/terraform/terraform"
|
"github.com/hashicorp/terraform/providers"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestUpgradeValid(t *testing.T) {
|
func TestUpgradeValid(t *testing.T) {
|
||||||
|
@ -32,7 +32,7 @@ func TestUpgradeValid(t *testing.T) {
|
||||||
inputDir := filepath.Join(fixtureDir, entry.Name(), "input")
|
inputDir := filepath.Join(fixtureDir, entry.Name(), "input")
|
||||||
wantDir := filepath.Join(fixtureDir, entry.Name(), "want")
|
wantDir := filepath.Join(fixtureDir, entry.Name(), "want")
|
||||||
u := &Upgrader{
|
u := &Upgrader{
|
||||||
Providers: terraform.ResourceProviderResolverFixed(testProviders),
|
Providers: providers.ResolverFixed(testProviders),
|
||||||
}
|
}
|
||||||
|
|
||||||
inputSrc, err := LoadModule(inputDir)
|
inputSrc, err := LoadModule(inputDir)
|
||||||
|
@ -90,7 +90,7 @@ func TestUpgradeRenameJSON(t *testing.T) {
|
||||||
}
|
}
|
||||||
|
|
||||||
u := &Upgrader{
|
u := &Upgrader{
|
||||||
Providers: terraform.ResourceProviderResolverFixed(testProviders),
|
Providers: providers.ResolverFixed(testProviders),
|
||||||
}
|
}
|
||||||
gotSrc, diags := u.Upgrade(inputSrc)
|
gotSrc, diags := u.Upgrade(inputSrc)
|
||||||
if diags.HasErrors() {
|
if diags.HasErrors() {
|
||||||
|
@ -176,8 +176,8 @@ func diffSourceFilesFallback(got, want []byte) []byte {
|
||||||
return buf.Bytes()
|
return buf.Bytes()
|
||||||
}
|
}
|
||||||
|
|
||||||
var testProviders = map[string]terraform.ResourceProviderFactory{
|
var testProviders = map[string]providers.Factory{
|
||||||
"test": terraform.ResourceProviderFactory(func() (terraform.ResourceProvider, error) {
|
"test": providers.Factory(func() (providers.Interface, error) {
|
||||||
return testprovider.Provider(), nil
|
return testprovider.Provider(), nil
|
||||||
}),
|
}),
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue