Skip to content

Commit 4f77c70

Browse files
paddycarverPaddy
authored andcommitted
Update terraform-plugin-test, fix build errors.
Update to use the commit of terraform-plugin-test with the CreateDestroyPlan function added. Fix the build errors caused by typos and forgetting to remove arguments when converting from Require* functions to non-Require* variants.
1 parent 2c74b97 commit 4f77c70

File tree

3 files changed

+10
-8
lines changed

3 files changed

+10
-8
lines changed

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ require (
2727
github.com/hashicorp/hcl/v2 v2.3.0
2828
github.com/hashicorp/logutils v1.0.0
2929
github.com/hashicorp/terraform-json v0.5.0
30-
github.com/hashicorp/terraform-plugin-test/v2 v2.0.0
30+
github.com/hashicorp/terraform-plugin-test/v2 v2.0.1-0.20200901104947-ff3345b5b0ac
3131
github.com/hashicorp/yamux v0.0.0-20181012175058-2f1d1f20f75d // indirect
3232
github.com/keybase/go-crypto v0.0.0-20161004153544-93f5b35093ba
3333
github.com/kylelemons/godebug v1.1.0 // indirect

go.sum

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,8 @@ github.com/hashicorp/terraform-json v0.5.0 h1:7TV3/F3y7QVSuN4r9BEXqnWqrAyeOtON8f
174174
github.com/hashicorp/terraform-json v0.5.0/go.mod h1:eAbqb4w0pSlRmdvl8fOyHAi/+8jnkVYN28gJkSJrLhU=
175175
github.com/hashicorp/terraform-plugin-test/v2 v2.0.0 h1:fYGV3nZvs8KFGKuY2NPAJDMNfVSDHo+U2FGFl3bPv1s=
176176
github.com/hashicorp/terraform-plugin-test/v2 v2.0.0/go.mod h1:C6VALgUlvaif+PnHyRGKWPTdQkMJK4NQ20VJolxZLI0=
177+
github.com/hashicorp/terraform-plugin-test/v2 v2.0.1-0.20200901104947-ff3345b5b0ac h1:uixV2WFSoBaZkePbs38UFPQt8GkosGIZTA63c2P11n4=
178+
github.com/hashicorp/terraform-plugin-test/v2 v2.0.1-0.20200901104947-ff3345b5b0ac/go.mod h1:C6VALgUlvaif+PnHyRGKWPTdQkMJK4NQ20VJolxZLI0=
177179
github.com/hashicorp/yamux v0.0.0-20180604194846-3520598351bb/go.mod h1:+NfK9FKeTrX5uv1uIXGdwYDTeHna2qgaIlx54MXqjAM=
178180
github.com/hashicorp/yamux v0.0.0-20181012175058-2f1d1f20f75d h1:kJCB4vdITiW1eC1vq2e6IsrXKrZit1bv/TDYFGMp4BQ=
179181
github.com/hashicorp/yamux v0.0.0-20181012175058-2f1d1f20f75d/go.mod h1:+NfK9FKeTrX5uv1uIXGdwYDTeHna2qgaIlx54MXqjAM=

helper/resource/testing_new_config.go

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -30,14 +30,14 @@ func testStepNewConfig(t testing.T, c TestCase, wd *tftest.WorkingDir, step Test
3030
}
3131
}
3232

33-
err := wd.SetConfig(t, step.Config)
33+
err := wd.SetConfig(step.Config)
3434
if err != nil {
35-
return fmt.Error("Error setting config: %w", err)
35+
return fmt.Errorf("Error setting config: %w", err)
3636
}
3737

3838
// require a refresh before applying
3939
// failing to do this will result in data sources not being updated
40-
err := runProviderCommand(t, func() error {
40+
err = runProviderCommand(t, func() error {
4141
return wd.Refresh()
4242
}, wd, c.ProviderFactories)
4343
if err != nil {
@@ -126,7 +126,7 @@ func testStepNewConfig(t testing.T, c TestCase, wd *tftest.WorkingDir, step Test
126126
var plan *tfjson.Plan
127127
err = runProviderCommand(t, func() error {
128128
var err error
129-
plan, err = wd.SavedPlan(t)
129+
plan, err = wd.SavedPlan()
130130
return err
131131
}, wd, c.ProviderFactories)
132132
if err != nil {
@@ -137,7 +137,7 @@ func testStepNewConfig(t testing.T, c TestCase, wd *tftest.WorkingDir, step Test
137137
var stdout string
138138
err = runProviderCommand(t, func() error {
139139
var err error
140-
stdout, err = wd.SavedPlanStdout(t)
140+
stdout, err = wd.SavedPlanStdout()
141141
return err
142142
}, wd, c.ProviderFactories)
143143
if err != nil {
@@ -171,7 +171,7 @@ func testStepNewConfig(t testing.T, c TestCase, wd *tftest.WorkingDir, step Test
171171

172172
err = runProviderCommand(t, func() error {
173173
var err error
174-
plan, err = wd.SavedPlan(t)
174+
plan, err = wd.SavedPlan()
175175
return err
176176
}, wd, c.ProviderFactories)
177177
if err != nil {
@@ -183,7 +183,7 @@ func testStepNewConfig(t testing.T, c TestCase, wd *tftest.WorkingDir, step Test
183183
var stdout string
184184
err = runProviderCommand(t, func() error {
185185
var err error
186-
stdout, err = wd.SavedPlanStdout(t)
186+
stdout, err = wd.SavedPlanStdout()
187187
return err
188188
}, wd, c.ProviderFactories)
189189
if err != nil {

0 commit comments

Comments
 (0)