Skip to content

Commit ada5563

Browse files
committed
refactor: moved test to pr_test
1 parent 921b887 commit ada5563

File tree

2 files changed

+30
-30
lines changed

2 files changed

+30
-30
lines changed

tests/other_test.go

Lines changed: 0 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,6 @@ import (
99
"github.com/stretchr/testify/assert"
1010
)
1111

12-
// To verify DNS records creation
13-
var dnsRecordsMap = []map[string]interface{}{
14-
{"name": "testA", "type": "A", "rdata": "1.2.3.4", "ttl": 3600},
15-
{"name": "testAAAA", "type": "AAAA", "rdata": "2001:0db8:0012:0001:3c5e:7354:0000:5db5"},
16-
{"name": "testCNAME", "type": "CNAME", "rdata": "test.com"},
17-
{"name": "testTXT", "type": "TXT", "rdata": "textinformation", "ttl": 900},
18-
{"name": "testMX", "type": "MX", "rdata": "mailserver.test.com", "preference": 10},
19-
{"name": "testSRV", "type": "SRV", "rdata": "tester.com", "priority": 100, "weight": 100, "port": 8000, "service": "_sip", "protocol": "udp"},
20-
}
21-
2212
func TestRunBasicExample(t *testing.T) {
2313
t.Parallel()
2414

@@ -64,23 +54,3 @@ func TestRunSpecificZoneExample(t *testing.T) {
6454
assert.Nil(t, err, "This should not have errored")
6555
assert.NotNil(t, output, "Expected some output")
6656
}
67-
68-
func TestRunVpcWithDnsExample(t *testing.T) {
69-
t.Parallel()
70-
71-
options := testhelper.TestOptionsDefaultWithVars(&testhelper.TestOptions{
72-
Testing: t,
73-
TerraformDir: vpcWithDnsExampleTerraformDir,
74-
Prefix: "dns-slz",
75-
ResourceGroup: resourceGroup,
76-
Region: "us-south",
77-
})
78-
options.TerraformVars = map[string]interface{}{
79-
"dns_records": dnsRecordsMap,
80-
"name": "test-dns",
81-
"dns_zone_name": "slz.com",
82-
}
83-
output, err := options.RunTestConsistency()
84-
assert.Nil(t, err, "This should not have errored")
85-
assert.NotNil(t, output, "Expected some output")
86-
}

tests/pr_test.go

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,16 @@ const yamlLocation = "../common-dev-assets/common-go-assets/common-permanent-res
3333

3434
var permanentResources map[string]interface{}
3535

36+
// To verify DNS records creation
37+
var dnsRecordsMap = []map[string]interface{}{
38+
{"name": "testA", "type": "A", "rdata": "1.2.3.4", "ttl": 3600},
39+
{"name": "testAAAA", "type": "AAAA", "rdata": "2001:0db8:0012:0001:3c5e:7354:0000:5db5"},
40+
{"name": "testCNAME", "type": "CNAME", "rdata": "test.com"},
41+
{"name": "testTXT", "type": "TXT", "rdata": "textinformation", "ttl": 900},
42+
{"name": "testMX", "type": "MX", "rdata": "mailserver.test.com", "preference": 10},
43+
{"name": "testSRV", "type": "SRV", "rdata": "tester.com", "priority": 100, "weight": 100, "port": 8000, "service": "_sip", "protocol": "udp"},
44+
}
45+
3646
func TestMain(m *testing.M) {
3747
// Read the YAML file contents
3848
var err error
@@ -172,3 +182,23 @@ func TestRunExistingVPCExample(t *testing.T) {
172182
logger.Log(t, "END: Destroy (existing resources)")
173183
}
174184
}
185+
186+
func TestRunVpcWithDnsExample(t *testing.T) {
187+
t.Parallel()
188+
189+
options := testhelper.TestOptionsDefaultWithVars(&testhelper.TestOptions{
190+
Testing: t,
191+
TerraformDir: vpcWithDnsExampleTerraformDir,
192+
Prefix: "dns-slz",
193+
ResourceGroup: resourceGroup,
194+
Region: "us-south",
195+
})
196+
options.TerraformVars = map[string]interface{}{
197+
"dns_records": dnsRecordsMap,
198+
"name": "test-dns",
199+
"dns_zone_name": "slz.com",
200+
}
201+
output, err := options.RunTestConsistency()
202+
assert.Nil(t, err, "This should not have errored")
203+
assert.NotNil(t, output, "Expected some output")
204+
}

0 commit comments

Comments
 (0)