Skip to content

Commit 22ad7f6

Browse files
committed
SKIP UPGRADE TEST fix unit test and variable validation
1 parent 7d84e1d commit 22ad7f6

File tree

2 files changed

+4
-13
lines changed

2 files changed

+4
-13
lines changed

solutions/security-enforced/variables.tf

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -157,13 +157,6 @@ variable "existing_kms_instance_crn" {
157157
condition = var.existing_mongodb_instance_crn != null ? var.existing_kms_instance_crn == null : true
158158
error_message = "When using an existing mongodb instance 'existing_kms_instance_crn' should not be set"
159159
}
160-
161-
validation {
162-
condition = (
163-
length(compact([var.existing_kms_instance_crn, var.existing_kms_key_crn, var.existing_backup_kms_key_crn])) == 1 ? true : false
164-
)
165-
error_message = "To enable KMS encryption one of 'existing_kms_instance_crn', 'existing_kms_key_crn' or 'existing_backup_kms_key_crn' must be set."
166-
}
167160
}
168161

169162
variable "existing_kms_key_crn" {

tests/pr_test.go

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ func TestRunFullyConfigurableSolutionSchematics(t *testing.T) {
7070
},
7171
TemplateFolder: fullyConfigurableSolutionTerraformDir,
7272
BestRegionYAMLPath: regionSelectionPath,
73-
Prefix: "mdb-st-da",
73+
Prefix: "mdb-fc-da",
7474
ResourceGroup: resourceGroup,
7575
DeleteWorkspaceOnFail: false,
7676
WaitJobCompleteMinutes: 60,
@@ -98,7 +98,6 @@ func TestRunFullyConfigurableSolutionSchematics(t *testing.T) {
9898
{Name: "kms_encryption_enabled", Value: true, DataType: "bool"},
9999
{Name: "use_ibm_owned_encryption_key", Value: false, DataType: "bool"},
100100
{Name: "existing_kms_instance_crn", Value: permanentResources["hpcs_south_crn"], DataType: "string"},
101-
{Name: "existing_backup_kms_key_crn", Value: permanentResources["hpcs_south_root_key_crn"], DataType: "string"},
102101
{Name: "kms_endpoint_type", Value: "private", DataType: "string"},
103102
{Name: "mongodb_version", Value: "7.0", DataType: "string"}, // Always lock this test into the latest supported MongoDB version
104103
{Name: "existing_resource_group_name", Value: resourceGroup, DataType: "string"},
@@ -160,7 +159,7 @@ func TestRunSecurityEnforcedSolutionSchematics(t *testing.T) {
160159
},
161160
TemplateFolder: securityEnforcedSolutionTerraformDir,
162161
BestRegionYAMLPath: regionSelectionPath,
163-
Prefix: "mdb-st-da",
162+
Prefix: "mdb-se-da",
164163
ResourceGroup: resourceGroup,
165164
DeleteWorkspaceOnFail: false,
166165
WaitJobCompleteMinutes: 60,
@@ -186,7 +185,6 @@ func TestRunSecurityEnforcedSolutionSchematics(t *testing.T) {
186185
{Name: "ibmcloud_api_key", Value: options.RequiredEnvironmentVars["TF_VAR_ibmcloud_api_key"], DataType: "string", Secure: true},
187186
{Name: "mongodb_access_tags", Value: permanentResources["accessTags"], DataType: "list(string)"},
188187
{Name: "existing_kms_instance_crn", Value: permanentResources["hpcs_south_crn"], DataType: "string"},
189-
{Name: "existing_backup_kms_key_crn", Value: permanentResources["hpcs_south_root_key_crn"], DataType: "string"},
190188
{Name: "kms_endpoint_type", Value: "private", DataType: "string"},
191189
{Name: "mongodb_version", Value: "7.0", DataType: "string"}, // Always lock this test into the latest supported MongoDB version
192190
{Name: "existing_resource_group_name", Value: resourceGroup, DataType: "string"},
@@ -204,7 +202,7 @@ func TestRunSecurityEnforcedSolutionSchematics(t *testing.T) {
204202

205203
func TestRunExistingInstance(t *testing.T) {
206204
t.Parallel()
207-
prefix := fmt.Sprintf("mongodb-t-%s", strings.ToLower(random.UniqueId()))
205+
prefix := fmt.Sprintf("mdb-t-%s", strings.ToLower(random.UniqueId()))
208206
realTerraformDir := ".."
209207
tempTerraformDir, _ := files.CopyTerraformFolderToTemp(realTerraformDir, fmt.Sprintf(prefix+"-%s", strings.ToLower(random.UniqueId())))
210208
region := validICDRegions[rand.Intn(len(validICDRegions))]
@@ -246,7 +244,7 @@ func TestRunExistingInstance(t *testing.T) {
246244
},
247245
TemplateFolder: fullyConfigurableSolutionTerraformDir,
248246
BestRegionYAMLPath: regionSelectionPath,
249-
Prefix: "mongodb-sr-da",
247+
Prefix: "mdb-sr-da",
250248
ResourceGroup: resourceGroup,
251249
DeleteWorkspaceOnFail: false,
252250
WaitJobCompleteMinutes: 60,

0 commit comments

Comments
 (0)