Skip to content

Commit

Permalink
Addressing nick's PR comments
Browse files Browse the repository at this point in the history
  • Loading branch information
erikschlegel committed Apr 25, 2019
1 parent adaf6aa commit 6cb6fd3
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 13 deletions.
1 change: 0 additions & 1 deletion .env.template
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
GO111MODULE=on
ARM_SUBSCRIPTION_ID="<az-service-principal-subscription-id>"
GO_VERSION=1.11
TF_VERSION=0.11.13
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,18 +37,10 @@ func configureTerraformOptions(t *testing.T, fixtureFolder string) *terraform.Op
return terraformOptions
}

const SKIP_STAGE_ENV_VAR_PREFIX = "SKIP_"

// RunTestStage executes the given test stage (e.g., setup, teardown, validation) if an environment variable of the name
// `SKIP_<stageName>` (e.g., SKIP_teardown) is not set.
// RunTestStage executes the given test stage (e.g., setup, teardown, validation)
func RunTestStage(t *testing.T, stageName string, stage func()) {
envVarName := fmt.Sprintf("%s%s", SKIP_STAGE_ENV_VAR_PREFIX, stageName)
if os.Getenv(envVarName) == "" {
fmt.Printf("The '%s' environment variable is not set, so executing stage '%s'.", envVarName, stageName)
stage()
} else {
fmt.Printf("The '%s' environment variable is set, so skipping stage '%s'.", envVarName, stageName)
}
fmt.Printf("Executing stage '%s'.", stageName)
stage()
}

func validatePlan(t *testing.T, tfPlanOutput string, tfOptions *terraform.Options) {
Expand Down
1 change: 0 additions & 1 deletion infra/templates/backend-state-setup/terraform.tfvars
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
name="cobaltfstate"
location="southcentralus"

0 comments on commit 6cb6fd3

Please sign in to comment.