diff --git a/tests/other_test.go b/tests/other_test.go index 29f131ed..8027efdb 100644 --- a/tests/other_test.go +++ b/tests/other_test.go @@ -9,16 +9,6 @@ import ( "github.com/stretchr/testify/assert" ) -// To verify DNS records creation -var dnsRecordsMap = []map[string]interface{}{ - {"name": "testA", "type": "A", "rdata": "1.2.3.4", "ttl": 3600}, - {"name": "testAAAA", "type": "AAAA", "rdata": "2001:0db8:0012:0001:3c5e:7354:0000:5db5"}, - {"name": "testCNAME", "type": "CNAME", "rdata": "test.com"}, - {"name": "testTXT", "type": "TXT", "rdata": "textinformation", "ttl": 900}, - {"name": "testMX", "type": "MX", "rdata": "mailserver.test.com", "preference": 10}, - {"name": "testSRV", "type": "SRV", "rdata": "tester.com", "priority": 100, "weight": 100, "port": 8000, "service": "_sip", "protocol": "udp"}, -} - func TestRunBasicExample(t *testing.T) { t.Parallel() @@ -64,23 +54,3 @@ func TestRunSpecificZoneExample(t *testing.T) { assert.Nil(t, err, "This should not have errored") assert.NotNil(t, output, "Expected some output") } - -func TestRunVpcWithDnsExample(t *testing.T) { - t.Parallel() - - options := testhelper.TestOptionsDefaultWithVars(&testhelper.TestOptions{ - Testing: t, - TerraformDir: vpcWithDnsExampleTerraformDir, - Prefix: "dns-slz", - ResourceGroup: resourceGroup, - Region: "us-south", - }) - options.TerraformVars = map[string]interface{}{ - "dns_records": dnsRecordsMap, - "name": "test-dns", - "dns_zone_name": "slz.com", - } - output, err := options.RunTestConsistency() - assert.Nil(t, err, "This should not have errored") - assert.NotNil(t, output, "Expected some output") -} diff --git a/tests/pr_test.go b/tests/pr_test.go index 600ba9ed..242ddbdd 100644 --- a/tests/pr_test.go +++ b/tests/pr_test.go @@ -33,6 +33,16 @@ const yamlLocation = "../common-dev-assets/common-go-assets/common-permanent-res var permanentResources map[string]interface{} +// To verify DNS records creation +var dnsRecordsMap = []map[string]interface{}{ + {"name": "testA", "type": "A", "rdata": "1.2.3.4", "ttl": 3600}, + {"name": "testAAAA", "type": "AAAA", "rdata": "2001:0db8:0012:0001:3c5e:7354:0000:5db5"}, + {"name": "testCNAME", "type": "CNAME", "rdata": "test.com"}, + {"name": "testTXT", "type": "TXT", "rdata": "textinformation", "ttl": 900}, + {"name": "testMX", "type": "MX", "rdata": "mailserver.test.com", "preference": 10}, + {"name": "testSRV", "type": "SRV", "rdata": "tester.com", "priority": 100, "weight": 100, "port": 8000, "service": "_sip", "protocol": "udp"}, +} + func TestMain(m *testing.M) { // Read the YAML file contents var err error @@ -172,3 +182,23 @@ func TestRunExistingVPCExample(t *testing.T) { logger.Log(t, "END: Destroy (existing resources)") } } + +func TestRunVpcWithDnsExample(t *testing.T) { + t.Parallel() + + options := testhelper.TestOptionsDefaultWithVars(&testhelper.TestOptions{ + Testing: t, + TerraformDir: vpcWithDnsExampleTerraformDir, + Prefix: "dns-slz", + ResourceGroup: resourceGroup, + Region: "us-south", + }) + options.TerraformVars = map[string]interface{}{ + "dns_records": dnsRecordsMap, + "name": "test-dns", + "dns_zone_name": "slz.com", + } + output, err := options.RunTestConsistency() + assert.Nil(t, err, "This should not have errored") + assert.NotNil(t, output, "Expected some output") +}