add test for internal plugins with -plugin-dir
-plugin-dir was short-circuiting the discovery for internal plugins
This commit is contained in:
parent
5a9e0cf763
commit
5a975d9997
|
@ -1063,3 +1063,27 @@ func TestInit_pluginDirProvidersDoesNotGet(t *testing.T) {
|
||||||
t.Fatalf("bad: \n%s", ui.OutputWriter)
|
t.Fatalf("bad: \n%s", ui.OutputWriter)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Verify that plugin-dir doesn't prevent discovery of internal providers
|
||||||
|
func TestInit_pluginWithInternal(t *testing.T) {
|
||||||
|
td := tempDir(t)
|
||||||
|
copy.CopyDir(testFixturePath("init-internal"), td)
|
||||||
|
defer os.RemoveAll(td)
|
||||||
|
defer testChdir(t, td)()
|
||||||
|
|
||||||
|
ui := new(cli.MockUi)
|
||||||
|
m := Meta{
|
||||||
|
testingOverrides: metaOverridesForProvider(testProvider()),
|
||||||
|
Ui: ui,
|
||||||
|
}
|
||||||
|
|
||||||
|
c := &InitCommand{
|
||||||
|
Meta: m,
|
||||||
|
}
|
||||||
|
|
||||||
|
args := []string{"-plugin-dir", "./"}
|
||||||
|
//args := []string{}
|
||||||
|
if code := c.Run(args); code != 0 {
|
||||||
|
t.Fatalf("error: %s", ui.ErrorWriter)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
@ -0,0 +1 @@
|
||||||
|
provider "terraform" {}
|
Loading…
Reference in New Issue