Skip to content

Commit fc0700f

Browse files
authored
test: add upgrade solution test (#244)
1 parent a3c39f8 commit fc0700f

File tree

1 file changed

+27
-2
lines changed

1 file changed

+27
-2
lines changed

tests/pr_test.go

Lines changed: 27 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ func TestRunFSCloudExample(t *testing.T) {
5555
Testing: t,
5656
TerraformDir: fscloudExampleTerraformDir,
5757
Prefix: "es-fs-test",
58-
Region: "us-south", // For FSCloud locking into us-south since that is where the HPCS permanent instance is
58+
Region: "us-south",
5959
/*
6060
Comment out the 'ResourceGroup' input to force this test to create a unique resource group to ensure tests do
6161
not clash. This is due to the fact that an auth policy may already exist in this resource group since we are
@@ -156,7 +156,7 @@ func TestRunStandardSolutionSchematics(t *testing.T) {
156156
Testing: t,
157157
TarIncludePatterns: tarIncludePatterns,
158158
TemplateFolder: standardSolutionTerraformDir,
159-
Region: "us-south",
159+
BestRegionYAMLPath: regionSelectionPath,
160160
Prefix: "els-sr-da",
161161
ResourceGroup: resourceGroup,
162162
DeleteWorkspaceOnFail: false,
@@ -177,6 +177,31 @@ func TestRunStandardSolutionSchematics(t *testing.T) {
177177
assert.Nil(t, err, "This should not have errored")
178178
}
179179

180+
func TestRunStandardUpgradeSolution(t *testing.T) {
181+
t.Parallel()
182+
183+
options := testhelper.TestOptionsDefault(&testhelper.TestOptions{
184+
Testing: t,
185+
TerraformDir: standardSolutionTerraformDir,
186+
BestRegionYAMLPath: regionSelectionPath,
187+
Prefix: "els-st-da-upg",
188+
ResourceGroup: resourceGroup,
189+
})
190+
191+
options.TerraformVars = map[string]interface{}{
192+
"access_tags": permanentResources["accessTags"],
193+
"existing_kms_instance_crn": permanentResources["hpcs_south_crn"],
194+
"kms_endpoint_type": "public",
195+
"resource_group_name": options.Prefix,
196+
}
197+
198+
output, err := options.RunTestUpgrade()
199+
if !options.UpgradeTestSkipped {
200+
assert.Nil(t, err, "This should not have errored")
201+
assert.NotNil(t, output, "Expected some output")
202+
}
203+
}
204+
180205
func TestRunBasicExample(t *testing.T) {
181206
t.Parallel()
182207
options := testhelper.TestOptionsDefaultWithVars(&testhelper.TestOptions{

0 commit comments

Comments
 (0)