Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use ImportStatePersist to preserve state generated by import operation #1052

Merged
merged 8 commits into from
Sep 8, 2022
Prev Previous commit
Next Next commit
Removing additional call to Init as this has already been called in r…
…unNewTest and when called at this point will overwrite the contents of the .terraform directory with the current version of the provider (#717)
  • Loading branch information
bendbennett committed Sep 7, 2022
commit c8b634c8a3465dd3047c5237fd13685556cedec8
7 changes: 0 additions & 7 deletions helper/resource/testing_new_import_state.go
Original file line number Diff line number Diff line change
@@ -104,13 +104,6 @@ func testStepNewImportState(ctx context.Context, t testing.T, helper *plugintest

logging.HelperResourceDebug(ctx, "Running Terraform CLI init and import")

err = runProviderCommand(ctx, t, func() error {
return importWd.Init(ctx)
}, importWd, providers)
if err != nil {
t.Fatalf("Error running init: %s", err)
}

err = runProviderCommand(ctx, t, func() error {
return importWd.Import(ctx, step.ResourceName, importId)
}, importWd, providers)