Skip to content

Commit

Permalink
Ensure TestExamplesComplete/Enabled does not re-initialize Terraform.…
Browse files Browse the repository at this point in the history
… Doing so causes issues in CI due to tests running in parallel.
  • Loading branch information
korenyoni committed Jul 2, 2021
1 parent 5497ec2 commit d6b1be2
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions test/src/examples_complete_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ func TestExamplesComplete(t *testing.T) {
TerraformDir: "../../examples/complete",
Upgrade: true,
// Variables to pass to our Terraform code using -var-file options
VarFiles: []string{"fixtures.us-east-2.tfvars"},
VarFiles: []string{"fixtures.us-west-1.tfvars"},
}

terraform.Init(t, terraformOptions)
Expand Down Expand Up @@ -57,7 +57,7 @@ func testExamplesCompleteEnabled(t *testing.T) {
defer terraform.Destroy(t, terraformOptions)

// This will run `terraform init` and `terraform apply` and fail the test if there are any errors
terraform.InitAndApply(t, terraformOptions)
terraform.Apply(t, terraformOptions)

// Run `terraform output` to get the value of an output variable
hostname := terraform.Output(t, terraformOptions, "hostname")
Expand All @@ -75,6 +75,7 @@ func testExamplesCompleteEnabled(t *testing.T) {
assert.Equal(t, testName+".testing.cloudposse.co.s3.amazonaws.com", s3BucketDomainName)
}

// Test the Terraform module in examples/complete using Terratest, but with the root module disabled.
func testExamplesCompleteDisabled(t *testing.T) {
t.Parallel()

Expand Down

0 comments on commit d6b1be2

Please sign in to comment.