Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 7 additions & 8 deletions ibm_catalog.json
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@
],
"optional": true,
"on_by_default": false,
"version": "v3.0.7"
"version": "v3.0.23"
},
{
"name": "deploy-arch-ibm-apprapp",
Expand All @@ -89,7 +89,7 @@
],
"catalog_id": "7a4d68b4-cf8b-40cd-a3d1-f49aff526eb3",
"id": "045c1169-d15a-4046-ae81-aa3d3348421f-global",
"version": "v1.10.2",
"version": "v1.11.2",
"optional": true,
"input_mapping": [
{
Expand Down Expand Up @@ -142,7 +142,7 @@
"fully-configurable"
],
"id": "63d8ae58-fbf3-41ce-b844-0fb5b85882ab-global",
"version": "v1.6.11",
"version": "v1.6.28",
"optional": true,
"on_by_default": true,
"input_mapping": [
Expand All @@ -167,7 +167,7 @@
"name": "deploy-arch-ibm-cloud-monitoring",
"description": "Configure IBM Cloud Monitoring to collect the platform metrics.",
"id": "73debdbf-894f-4c14-81c7-5ece3a70b67d-global",
"version": "v1.6.4",
"version": "v1.7.2",
"flavors": [
"fully-configurable"
],
Expand Down Expand Up @@ -200,7 +200,7 @@
"name": "deploy-arch-ibm-activity-tracker",
"description": "Configure Activity Tracker Event Routing to route the auditing events.",
"id": "918453c3-4f97-4583-8c4a-83ef12fc7916-global",
"version": "v1.2.25",
"version": "v1.2.34",
"flavors": [
"fully-configurable"
],
Expand Down Expand Up @@ -300,7 +300,6 @@
},
{
"key": "app_config_plan",
"required": true,
"virtual": true,
"type": "string",
"options": [
Expand All @@ -317,8 +316,8 @@
"value": "enterprise"
}
],
"default_value": "basic",
"description": "The plan to use for the App Configuration service instance."
"default_value": "enterprise",
"description": "The plan to use for the App Configuration service instance. If the Key Protect deployable architecture has been selected, 'enterprise' plan must be used."
},
{
"key": "enable_platform_metrics",
Expand Down
56 changes: 19 additions & 37 deletions tests/pr_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,15 @@ import (
"github.com/terraform-ibm-modules/ibmcloud-terratest-wrapper/testschematic"
)

/*
Global variables
*/
const resourceGroup = "geretain-test-resources"
const fullyConfigurableDADir = "solutions/fully-configurable"

var existingResources = "./existing-resources"

// Define a struct with fields that match the structure of the YAML data.
const yamlLocation = "../common-dev-assets/common-go-assets/common-permanent-resources.yaml"
const existingResources = "./existing-resources"
const terraformVersion = "terraform_v1.10" // This should match the version in the ibm_catalog.json

// Current supported SCC Workload Protection region
var validRegions = []string{
"us-south",
"us-east",
Expand All @@ -44,7 +44,6 @@ var validRegions = []string{
"ca-tor",
"au-syd",
}

var permanentResources map[string]interface{}

func TestMain(m *testing.M) {
Expand Down Expand Up @@ -108,9 +107,11 @@ func TestFullyConfigurable(t *testing.T) {
},
ResourceGroup: resourceGroup,
TemplateFolder: fullyConfigurableDADir,
Tags: []string{"test-schematic"},
Tags: []string{"test-schematic", "scc-wp-da-fc"},
DeleteWorkspaceOnFail: false,
WaitJobCompleteMinutes: 60,
Region: region,
TerraformVersion: terraformVersion,
// workaround for https://github.com/terraform-ibm-modules/terraform-ibm-scc-workload-protection/issues/243
IgnoreAdds: testhelper.Exemptions{
List: []string{"module.scc_wp.restapi_object.cspm"},
Expand All @@ -120,7 +121,7 @@ func TestFullyConfigurable(t *testing.T) {
options.TerraformVars = []testschematic.TestSchematicTerraformVar{
{Name: "ibmcloud_api_key", Value: options.RequiredEnvironmentVars["TF_VAR_ibmcloud_api_key"], DataType: "string", Secure: true},
{Name: "existing_resource_group_name", Value: resourceGroup, DataType: "string"},
{Name: "region", Value: region, DataType: "string"},
{Name: "region", Value: options.Region, DataType: "string"},
{Name: "scc_workload_protection_instance_tags", Value: options.Tags, DataType: "list(string)"},
{Name: "scc_workload_protection_resource_key_tags", Value: options.Tags, DataType: "list(string)"},
{Name: "scc_workload_protection_access_tags", Value: permanentResources["accessTags"], DataType: "list(string)"},
Expand Down Expand Up @@ -193,11 +194,14 @@ func TestFullyConfigurableUpgrade(t *testing.T) {
"*.tf",
fullyConfigurableDADir + "/*.tf",
},
ResourceGroup: resourceGroup,
TemplateFolder: fullyConfigurableDADir,
Tags: []string{"test-schematic"},
DeleteWorkspaceOnFail: false,
WaitJobCompleteMinutes: 60,
ResourceGroup: resourceGroup,
TemplateFolder: fullyConfigurableDADir,
Tags: []string{"test-schematic"},
DeleteWorkspaceOnFail: false,
WaitJobCompleteMinutes: 60,
CheckApplyResultForUpgrade: true,
Region: region,
TerraformVersion: terraformVersion,
// workaround for https://github.com/terraform-ibm-modules/terraform-ibm-scc-workload-protection/issues/243
IgnoreAdds: testhelper.Exemptions{
List: []string{"module.scc_wp.restapi_object.cspm"},
Expand All @@ -207,7 +211,7 @@ func TestFullyConfigurableUpgrade(t *testing.T) {
options.TerraformVars = []testschematic.TestSchematicTerraformVar{
{Name: "ibmcloud_api_key", Value: options.RequiredEnvironmentVars["TF_VAR_ibmcloud_api_key"], DataType: "string", Secure: true},
{Name: "existing_resource_group_name", Value: resourceGroup, DataType: "string"},
{Name: "region", Value: region, DataType: "string"},
{Name: "region", Value: options.Region, DataType: "string"},
{Name: "scc_workload_protection_instance_tags", Value: options.Tags, DataType: "list(string)"},
{Name: "scc_workload_protection_resource_key_tags", Value: options.Tags, DataType: "list(string)"},
{Name: "scc_workload_protection_access_tags", Value: permanentResources["accessTags"], DataType: "list(string)"},
Expand All @@ -234,7 +238,7 @@ func TestFullyConfigurableUpgrade(t *testing.T) {
}
}

func TestSccWpAddonDefaultConfiguration(t *testing.T) {
func TestAddonDefaultConfiguration(t *testing.T) {
t.Parallel()

options := testaddons.TestAddonsOptionsDefault(&testaddons.TestAddonOptions{
Expand All @@ -257,25 +261,3 @@ func TestSccWpAddonDefaultConfiguration(t *testing.T) {
err := options.RunAddonTest()
require.NoError(t, err)
}

// TestDependencyPermutations runs dependency permutations for SCC WP and all its dependencies
func TestSccWpDependencyPermutations(t *testing.T) {
// currently Permutation tests is not stable and the test wrapper framework must be updated. Skip tests for now
t.Skip()
t.Parallel()
options := testaddons.TestAddonsOptionsDefault(&testaddons.TestAddonOptions{
Testing: t,
Prefix: "scc-per",
AddonConfig: cloudinfo.AddonConfig{
OfferingName: "deploy-arch-ibm-scc-workload-protection",
OfferingFlavor: "fully-configurable",
Inputs: map[string]interface{}{
"prefix": "scc-per",
"region": validRegions[rand.Intn(len(validRegions))],
},
},
})

err := options.RunAddonPermutationTest()
assert.NoError(t, err, "Dependency permutation test should not fail")
}