Skip to content

Commit e3f2ff3

Browse files
committed
replace instances of stepIndex + 1 with stepNumber
1 parent 7df59d7 commit e3f2ff3

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

helper/resource/testing_new.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -249,7 +249,7 @@ func runNewTest(ctx context.Context, t testing.T, c TestCase, helper *plugintest
249249
File: step.ConfigFile,
250250
Raw: rawCfg,
251251
TestStepConfigRequest: config.TestStepConfigRequest{
252-
StepNumber: stepIndex + 1,
252+
StepNumber: stepNumber,
253253
TestName: t.Name(),
254254
},
255255
}.Exec()
@@ -289,7 +289,7 @@ func runNewTest(ctx context.Context, t testing.T, c TestCase, helper *plugintest
289289
if step.ImportState {
290290
logging.HelperResourceTrace(ctx, "TestStep is ImportState mode")
291291

292-
err := testStepNewImportState(ctx, t, helper, wd, step, appliedCfg, providers, stepIndex)
292+
err := testStepNewImportState(ctx, t, helper, wd, step, appliedCfg, providers, stepNumber)
293293
if step.ExpectError != nil {
294294
logging.HelperResourceDebug(ctx, "Checking TestStep ExpectError")
295295
if err == nil {

helper/resource/testing_new_import_state.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,15 +20,15 @@ import (
2020
"github.com/hashicorp/terraform-plugin-testing/terraform"
2121
)
2222

23-
func testStepNewImportState(ctx context.Context, t testing.T, helper *plugintest.Helper, wd *plugintest.WorkingDir, step TestStep, cfgRaw string, providers *providerFactories, stepIndex int) error {
23+
func testStepNewImportState(ctx context.Context, t testing.T, helper *plugintest.Helper, wd *plugintest.WorkingDir, step TestStep, cfgRaw string, providers *providerFactories, stepNumber int) error {
2424
t.Helper()
2525

2626
configRequest := teststep.PrepareConfigurationRequest{
2727
Directory: step.ConfigDirectory,
2828
File: step.ConfigFile,
2929
Raw: step.Config,
3030
TestStepConfigRequest: config.TestStepConfigRequest{
31-
StepNumber: stepIndex + 1,
31+
StepNumber: stepNumber,
3232
TestName: t.Name(),
3333
},
3434
}.Exec()
@@ -116,7 +116,7 @@ func testStepNewImportState(ctx context.Context, t testing.T, helper *plugintest
116116
File: step.ConfigFile,
117117
Raw: cfgRaw,
118118
TestStepConfigRequest: config.TestStepConfigRequest{
119-
StepNumber: stepIndex + 1,
119+
StepNumber: stepNumber,
120120
TestName: t.Name(),
121121
},
122122
}.Exec()

0 commit comments

Comments
 (0)