Skip to content

Commit c743d40

Browse files
authored
tests: add new test for override example (#694)
1 parent 965e41c commit c743d40

File tree

3 files changed

+21
-6
lines changed

3 files changed

+21
-6
lines changed

examples/override-example/override.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@
1919
"secondary_storage": "300gb.5iops-tier",
2020
"resource_group": "slz-workload-rg",
2121
"kms_config": {
22-
"crk_name": "slz-roks-key",
23-
"private_endpoint": true
22+
"crk_name": "slz-key",
23+
"private_endpoint": true
2424
},
2525
"subnet_names": [
2626
"vsi-zone-1",

tests/other_test.go

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ import (
77
"github.com/stretchr/testify/assert"
88
)
99

10+
const overrideExampleTerraformDir = "examples/override-example"
11+
1012
// NOTE: The HPCS tests may fail if our account already has an existing hpcs auth policy - hence only running once a week so PR pipeline is not impacted
1113
func TestRunRoksPatternWithHPCS(t *testing.T) {
1214
t.Parallel()
@@ -48,3 +50,16 @@ func TestRunVSIPatternWithHPCS(t *testing.T) {
4850
assert.Nil(t, err, "This should not have errored")
4951
assert.NotNil(t, output, "Expected some output")
5052
}
53+
54+
func TestRunOverrideExample(t *testing.T) {
55+
t.Parallel()
56+
if enableSchematicsTests {
57+
t.Skip("Skipping terratest for override-example, running Schematics test instead")
58+
}
59+
60+
options := setupOptionsQuickStartPattern(t, "slz-ex", overrideExampleTerraformDir)
61+
62+
output, err := options.RunTestConsistency()
63+
assert.Nil(t, err, "This should not have errored")
64+
assert.NotNil(t, output, "Expected some output")
65+
}

tests/pr_test.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -506,7 +506,7 @@ func TestRunVSIQuickStartPatternSchematics(t *testing.T) {
506506
{Name: "region", Value: options.Region, DataType: "string"},
507507
{Name: "prefix", Value: options.Prefix, DataType: "string"},
508508
{Name: "ssh_key", Value: sshPublicKey(t), DataType: "string"},
509-
{Name: "service_endpoints", Value: "private", DataType: "string"},
509+
{Name: "service_endpoints", Value: service_endpoints, DataType: "string"},
510510
}
511511

512512
err := options.RunSchematicTest()
@@ -527,7 +527,7 @@ func TestRunVSIPatternSchematics(t *testing.T) {
527527
{Name: "prefix", Value: options.Prefix, DataType: "string"},
528528
{Name: "ssh_public_key", Value: sshPublicKey(t), DataType: "string"},
529529
{Name: "add_atracker_route", Value: add_atracker_route, DataType: "bool"},
530-
{Name: "service_endpoints", Value: "private", DataType: "string"},
530+
{Name: "service_endpoints", Value: service_endpoints, DataType: "string"},
531531
}
532532

533533
err := options.RunSchematicTest()
@@ -549,7 +549,7 @@ func TestRunRoksPatternSchematics(t *testing.T) {
549549
{Name: "region", Value: options.Region, DataType: "string"},
550550
{Name: "prefix", Value: options.Prefix, DataType: "string"},
551551
{Name: "tags", Value: options.Tags, DataType: "list(string)"},
552-
{Name: "service_endpoints", Value: "private", DataType: "string"},
552+
{Name: "service_endpoints", Value: service_endpoints, DataType: "string"},
553553
}
554554

555555
err := options.RunSchematicTest()
@@ -570,7 +570,7 @@ func TestRunVPCPatternSchematics(t *testing.T) {
570570
{Name: "prefix", Value: options.Prefix, DataType: "string"},
571571
{Name: "tags", Value: options.Tags, DataType: "list(string)"},
572572
{Name: "add_atracker_route", Value: add_atracker_route, DataType: "bool"},
573-
{Name: "service_endpoints", Value: "private", DataType: "string"},
573+
{Name: "service_endpoints", Value: service_endpoints, DataType: "string"},
574574
}
575575

576576
err := options.RunSchematicTest()

0 commit comments

Comments
 (0)