Skip to content

Commit 8dbd2e8

Browse files
authored
enhencement split unit and integration tests for azure (#13)
1 parent a181a21 commit 8dbd2e8

1 file changed

Lines changed: 8 additions & 6 deletions

File tree

terratest/azure_test.go

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,19 +30,21 @@ func TestAzure(t *testing.T) {
3030
}
3131

3232
// unit tests
33-
common.LogColor("yellow", "Unit Test")
33+
if testSetup["TEST_TYPE"] == "unit" {
34+
common.LogColor("yellow", "Unit Test")
3435

35-
// website::tag::2:: Run `terraform init` and `terraform plan`. Fail the test if there are any errors.
36-
terraform.InitAndPlan(t, terraformOptions)
36+
// website::tag::2:: Run `terraform init` and `terraform plan`. Fail the test if there are any errors.
37+
terraform.InitAndPlan(t, terraformOptions)
38+
}
3739

3840
// integration tests
39-
if testSetup["TEST_TYPE"] != "unit" {
41+
if testSetup["TEST_TYPE"] == "integration" {
42+
common.LogColor("yellow", "Integration Test")
43+
4044
// get terratest settings for integration test
4145
terratestSettings := path + "/terratest.yaml"
4246
settings := common.GetTerratestSettings(terratestSettings)
4347

44-
common.LogColor("yellow", "Integration Test")
45-
4648
// website::tag::5:: At the end of the test, run `terraform destroy` to clean up any resources that were created
4749
defer terraform.Destroy(t, terraformOptions)
4850

0 commit comments

Comments
 (0)