Skip to content

Commit

Permalink
Expose a setup helper for acceptance tests
Browse files Browse the repository at this point in the history
  • Loading branch information
minamijoyo committed Jul 28, 2020
1 parent 3c7d551 commit fbaaeeb
Show file tree
Hide file tree
Showing 7 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions tfexec/helper_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -159,8 +159,8 @@ func (e *mockExitError) ExitCode() int {
return e.exitCode
}

// setupTestAcc is a common setup helper for acceptance tests.
func setupTestAcc(t *testing.T, source string) Executor {
// SetupTestAcc is a common setup helper for acceptance tests.
func SetupTestAcc(t *testing.T, source string) Executor {
workDir, err := setupTestWorkDir(source)
if err != nil {
t.Fatalf("failed to setup work dir: %s", err)
Expand Down
2 changes: 1 addition & 1 deletion tfexec/terraform_apply_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ func TestAccTerraformCLIApply(t *testing.T) {
SkipUnlessAcceptanceTestEnabled(t)

source := `resource "null_resource" "foo" {}`
e := setupTestAcc(t, source)
e := SetupTestAcc(t, source)
terraformCLI := NewTerraformCLI(e)

err := terraformCLI.Init(context.Background(), "", "-input=false", "-no-color")
Expand Down
2 changes: 1 addition & 1 deletion tfexec/terraform_destroy_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ func TestAccTerraformCLIDestroy(t *testing.T) {
SkipUnlessAcceptanceTestEnabled(t)

source := `resource "null_resource" "foo" {}`
e := setupTestAcc(t, source)
e := SetupTestAcc(t, source)
terraformCLI := NewTerraformCLI(e)

err := terraformCLI.Init(context.Background(), "", "-input=false", "-no-color")
Expand Down
2 changes: 1 addition & 1 deletion tfexec/terraform_import_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ resource "random_string" "foo" {
length = 4
}
`
e := setupTestAcc(t, source)
e := SetupTestAcc(t, source)
terraformCLI := NewTerraformCLI(e)

err := terraformCLI.Init(context.Background(), "", "-input=false", "-no-color")
Expand Down
2 changes: 1 addition & 1 deletion tfexec/terraform_init_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ func TestAccTerraformCLIInit(t *testing.T) {
SkipUnlessAcceptanceTestEnabled(t)

source := `resource "null_resource" "foo" {}`
e := setupTestAcc(t, source)
e := SetupTestAcc(t, source)
terraformCLI := NewTerraformCLI(e)

err := terraformCLI.Init(context.Background(), "", "-input=false", "-no-color")
Expand Down
2 changes: 1 addition & 1 deletion tfexec/terraform_plan_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ func TestAccTerraformCLIPlan(t *testing.T) {
SkipUnlessAcceptanceTestEnabled(t)

source := `resource "null_resource" "foo" {}`
e := setupTestAcc(t, source)
e := SetupTestAcc(t, source)
terraformCLI := NewTerraformCLI(e)

err := terraformCLI.Init(context.Background(), "", "-input=false", "-no-color")
Expand Down
2 changes: 1 addition & 1 deletion tfexec/terraform_state_list_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ func TestAccTerraformCLIStateList(t *testing.T) {
resource "null_resource" "foo" {}
resource "null_resource" "bar" {}
`
e := setupTestAcc(t, source)
e := SetupTestAcc(t, source)
terraformCLI := NewTerraformCLI(e)

err := terraformCLI.Init(context.Background(), "", "-input=false", "-no-color")
Expand Down

0 comments on commit fbaaeeb

Please sign in to comment.