Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions internal/command/apply_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -822,12 +822,11 @@ output "foobar" {
// Mock provider still needs to be supplied via testingOverrides despite the mock HTTP source
mockProvider := mockPluggableStateStorageProvider()
mockProviderAddress := addrs.NewDefaultProvider("test")
source, close := newMockProviderSource(t, map[string][]string{
source := newMockProviderSource(t, map[string][]string{
// The test fixture config has no version constraints, so the latest version will
// be used; below is the 'latest' version in the test world.
"hashicorp/test": {"1.2.3"},
})
t.Cleanup(close)

ui := new(cli.MockUi)
view, done := testView(t)
Expand Down Expand Up @@ -943,10 +942,9 @@ output "foobar" {
mockProvider.GetProviderSchemaResponse = &schema
mockProviderAddress := addrs.NewBuiltInProvider("terraform")

source, close := newMockProviderSource(t, map[string][]string{
source := newMockProviderSource(t, map[string][]string{
"hashicorp/terraform": {"1.2.3"},
})
t.Cleanup(close)

ui := new(cli.MockUi)
view, done := testView(t)
Expand Down
6 changes: 2 additions & 4 deletions internal/command/autocomplete_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,9 @@ func TestMetaCompletePredictWorkspaceName(t *testing.T) {
"foobar": true,
}
mockProviderAddress := addrs.NewDefaultProvider("test")
providerSource, close := newMockProviderSource(t, map[string][]string{
providerSource := newMockProviderSource(t, map[string][]string{
"hashicorp/test": {"1.0.0"},
})
defer close()

ui := new(cli.MockUi)
view, _ := testView(t)
Expand Down Expand Up @@ -93,10 +92,9 @@ func TestMetaCompletePredictWorkspaceName(t *testing.T) {
// No workspaces exist in the mock
mockProvider.MockStates = map[string]interface{}{}
mockProviderAddress := addrs.NewDefaultProvider("test")
providerSource, close := newMockProviderSource(t, map[string][]string{
providerSource := newMockProviderSource(t, map[string][]string{
"hashicorp/test": {"1.0.0"},
})
defer close()

ui := new(cli.MockUi)
view, _ := testView(t)
Expand Down
18 changes: 7 additions & 11 deletions internal/command/import_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -173,10 +173,9 @@ func TestImport_remoteState(t *testing.T) {

statePath := "imported.tfstate"

providerSource, close := newMockProviderSource(t, map[string][]string{
"test": []string{"1.2.3"},
providerSource := newMockProviderSource(t, map[string][]string{
"test": {"1.2.3"},
})
defer close()

// init our backend
ui := cli.NewMockUi()
Expand Down Expand Up @@ -285,10 +284,9 @@ func TestImport_initializationErrorShouldUnlock(t *testing.T) {

statePath := "imported.tfstate"

providerSource, close := newMockProviderSource(t, map[string][]string{
"test": []string{"1.2.3"},
providerSource := newMockProviderSource(t, map[string][]string{
"test": {"1.2.3"},
})
defer close()

// init our backend
ui := cli.NewMockUi()
Expand Down Expand Up @@ -781,10 +779,9 @@ func TestImportModuleVarFile(t *testing.T) {
},
}

providerSource, close := newMockProviderSource(t, map[string][]string{
"test": []string{"1.2.3"},
providerSource := newMockProviderSource(t, map[string][]string{
"test": {"1.2.3"},
})
defer close()

// init to install the module
ui := new(cli.MockUi)
Expand Down Expand Up @@ -855,10 +852,9 @@ func TestImportModuleInputVariableEvaluation(t *testing.T) {
},
}

providerSource, close := newMockProviderSource(t, map[string][]string{
providerSource := newMockProviderSource(t, map[string][]string{
"test": {"1.2.3"},
})
defer close()

// init to install the module
ui := new(cli.MockUi)
Expand Down
18 changes: 6 additions & 12 deletions internal/command/init2_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -310,10 +310,9 @@ func TestPlan_dynamicModuleSource(t *testing.T) {
t.Chdir(td)

p := planFixtureProvider()
providerSource, close := newMockProviderSource(t, map[string][]string{
providerSource := newMockProviderSource(t, map[string][]string{
"hashicorp/test": {"1.0.0"},
})
defer close()

args := []string{"-var", "module_name=example"}

Expand Down Expand Up @@ -363,10 +362,9 @@ func TestPlan_dynamicModuleSourceMismatch(t *testing.T) {
t.Chdir(td)

p := planFixtureProvider()
providerSource, close := newMockProviderSource(t, map[string][]string{
providerSource := newMockProviderSource(t, map[string][]string{
"hashicorp/test": {"1.0.0"},
})
defer close()
args := []string{"-var", "module_name=example"}

initUi := new(cli.MockUi)
Expand Down Expand Up @@ -411,10 +409,9 @@ func TestApply_dynamicModuleSource(t *testing.T) {
t.Chdir(td)

p := planFixtureProvider()
providerSource, close := newMockProviderSource(t, map[string][]string{
providerSource := newMockProviderSource(t, map[string][]string{
"hashicorp/test": {"1.0.0"},
})
defer close()
args := []string{"-var", "module_name=example"}

initUi := new(cli.MockUi)
Expand Down Expand Up @@ -463,10 +460,9 @@ func TestApply_dynamicModuleSourceWithDefaultPlanFile(t *testing.T) {
t.Chdir(td)

p := planFixtureProvider()
providerSource, close := newMockProviderSource(t, map[string][]string{
providerSource := newMockProviderSource(t, map[string][]string{
"hashicorp/test": {"1.0.0"},
})
defer close()

initUi := new(cli.MockUi)
initView, initDone := testView(t)
Expand Down Expand Up @@ -539,10 +535,9 @@ func TestPlan_dynamicModuleSourceWithCount(t *testing.T) {
t.Chdir(td)

p := planFixtureProvider()
providerSource, close := newMockProviderSource(t, map[string][]string{
providerSource := newMockProviderSource(t, map[string][]string{
"hashicorp/test": {"1.0.0"},
})
defer close()

args := []string{"-var", "module_name=example"}

Expand Down Expand Up @@ -592,10 +587,9 @@ func TestPlan_dynamicModuleSourceWithForEach(t *testing.T) {
t.Chdir(td)

p := planFixtureProvider()
providerSource, close := newMockProviderSource(t, map[string][]string{
providerSource := newMockProviderSource(t, map[string][]string{
"hashicorp/test": {"1.0.0"},
})
defer close()

args := []string{"-var", "module_name=example"}

Expand Down
Loading
Loading