Skip to content

Commit

Permalink
enhencement split unit and integration tests for azure (#13)
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelamattes authored Apr 26, 2023
1 parent a181a21 commit 8dbd2e8
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions terratest/azure_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,19 +30,21 @@ func TestAzure(t *testing.T) {
}

// unit tests
common.LogColor("yellow", "Unit Test")
if testSetup["TEST_TYPE"] == "unit" {
common.LogColor("yellow", "Unit Test")

// website::tag::2:: Run `terraform init` and `terraform plan`. Fail the test if there are any errors.
terraform.InitAndPlan(t, terraformOptions)
// website::tag::2:: Run `terraform init` and `terraform plan`. Fail the test if there are any errors.
terraform.InitAndPlan(t, terraformOptions)
}

// integration tests
if testSetup["TEST_TYPE"] != "unit" {
if testSetup["TEST_TYPE"] == "integration" {
common.LogColor("yellow", "Integration Test")

// get terratest settings for integration test
terratestSettings := path + "/terratest.yaml"
settings := common.GetTerratestSettings(terratestSettings)

common.LogColor("yellow", "Integration Test")

// website::tag::5:: At the end of the test, run `terraform destroy` to clean up any resources that were created
defer terraform.Destroy(t, terraformOptions)

Expand Down

0 comments on commit 8dbd2e8

Please sign in to comment.