diff --git a/modules/terraform/init_test.go b/modules/terraform/init_test.go index e985777c2..b376001dc 100644 --- a/modules/terraform/init_test.go +++ b/modules/terraform/init_test.go @@ -87,21 +87,17 @@ func TestInitReconfigureBackend(t *testing.T) { t.Parallel() stateDirectory, err := ioutil.TempDir("", t.Name()) - if err != nil { - t.Fatal(err) - } + require.NoError(t, err) defer os.RemoveAll(stateDirectory) testFolder, err := files.CopyTerraformFolderToTemp("../../test/fixtures/terraform-backend", t.Name()) - if err != nil { - t.Fatal(err) - } + require.NoError(t, err) defer os.RemoveAll(testFolder) options := &Options{ TerraformDir: testFolder, BackendConfig: map[string]interface{}{ - "path": filepath.Join(stateDirectory, "backend.tfstate"), + "path": filepath.Join(stateDirectory, "backend.tfstate"), "workspace_dir": "current", }, } @@ -121,21 +117,17 @@ func TestInitBackendMigration(t *testing.T) { t.Parallel() stateDirectory, err := ioutil.TempDir("", t.Name()) - if err != nil { - t.Fatal(err) - } + require.NoError(t, err) defer os.RemoveAll(stateDirectory) testFolder, err := files.CopyTerraformFolderToTemp("../../test/fixtures/terraform-backend", t.Name()) - if err != nil { - t.Fatal(err) - } + require.NoError(t, err) defer os.RemoveAll(testFolder) options := &Options{ TerraformDir: testFolder, BackendConfig: map[string]interface{}{ - "path": filepath.Join(stateDirectory, "backend.tfstate"), + "path": filepath.Join(stateDirectory, "backend.tfstate"), "workspace_dir": "current", }, } @@ -149,4 +141,4 @@ func TestInitBackendMigration(t *testing.T) { options.MigrateState = true _, err = InitE(t, options) assert.NoError(t, err, "Backend initialization with changed configuration should success with -migrate-state option") -} \ No newline at end of file +}