From 8dbd2e8811dfacf283c62ecae74c6d3e00295770 Mon Sep 17 00:00:00 2001 From: michaelamattes <41573722+michaelamattes@users.noreply.github.com> Date: Wed, 26 Apr 2023 12:34:22 +0200 Subject: [PATCH] enhencement split unit and integration tests for azure (#13) --- terratest/azure_test.go | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/terratest/azure_test.go b/terratest/azure_test.go index 030e776..977cde9 100644 --- a/terratest/azure_test.go +++ b/terratest/azure_test.go @@ -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)