Skip to content
Open
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
2 changes: 1 addition & 1 deletion .secrets.baseline
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"files": "go.sum|^.secrets.baseline$",
"lines": null
},
"generated_at": "2025-10-04T06:15:54Z",
"generated_at": "2025-10-07T13:10:19Z",
"plugins_used": [
{
"name": "AWSKeyDetector"
Expand Down
10 changes: 5 additions & 5 deletions ibm_catalog.json
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,7 @@
],
"optional": true,
"on_by_default": false,
"version": "v3.0.7"
"version": "v3.0.23"
},
{
"name": "deploy-arch-ibm-cloud-monitoring",
Expand Down Expand Up @@ -356,7 +356,7 @@
],
"optional": true,
"on_by_default": true,
"version": "v1.6.4"
"version": "v1.7.2"
},
{
"name": "deploy-arch-ibm-cloud-logs",
Expand Down Expand Up @@ -385,7 +385,7 @@
],
"optional": true,
"on_by_default": true,
"version": "v1.6.11"
"version": "v1.6.28"
},
{
"name": "deploy-arch-ibm-activity-tracker",
Expand All @@ -409,7 +409,7 @@
],
"optional": true,
"on_by_default": true,
"version": "v1.2.25"
"version": "v1.2.34"
},
{
"name": "deploy-arch-ibm-scc-workload-protection",
Expand All @@ -433,7 +433,7 @@
],
"optional": true,
"on_by_default": true,
"version": "v1.11.4"
"version": "v1.12.3"
}
],
"dependency_version_2": true,
Expand Down
3 changes: 3 additions & 0 deletions tests/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ go 1.24.0
toolchain go1.25.1

require (
github.com/IBM/go-sdk-core v1.1.0
github.com/gruntwork-io/terratest v0.51.0
github.com/stretchr/testify v1.11.1
github.com/terraform-ibm-modules/ibmcloud-terratest-wrapper v1.60.10
Expand All @@ -29,6 +30,7 @@ require (
github.com/cloudflare/circl v1.6.1 // indirect
github.com/cyphar/filepath-securejoin v0.4.1 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/dgrijalva/jwt-go v3.2.0+incompatible // indirect
github.com/emirpasic/gods v1.18.1 // indirect
github.com/gabriel-vasile/mimetype v1.4.9 // indirect
github.com/ghodss/yaml v1.0.0 // indirect
Expand Down Expand Up @@ -98,6 +100,7 @@ require (
golang.org/x/sys v0.35.0 // indirect
golang.org/x/text v0.28.0 // indirect
golang.org/x/tools v0.35.0 // indirect
gopkg.in/go-playground/validator.v9 v9.31.0 // indirect
gopkg.in/warnings.v0 v0.1.2 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
Expand Down
10 changes: 10 additions & 0 deletions tests/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ github.com/IBM-Cloud/power-go-client v1.12.0 h1:tF9Mq5GLYHebpzQT6IYB89lIxEST1E9t
github.com/IBM-Cloud/power-go-client v1.12.0/go.mod h1:SpTK1ttW8bfMNUVQS8qOEuWn2KOkzaCLyzfze8MG1JE=
github.com/IBM/cloud-databases-go-sdk v0.8.0 h1:uMFqhnc/roVTzfCaUsJ23eaHKjChhGpM1F7Mpxik0bo=
github.com/IBM/cloud-databases-go-sdk v0.8.0/go.mod h1:JYucI1PdwqbAd8XGdDAchxzxRP7bxOh1zUnseovHKsc=
github.com/IBM/go-sdk-core v1.1.0 h1:pV73lZqr9r1xKb3h08c1uNG3AphwoV5KzUzhS+pfEqY=
github.com/IBM/go-sdk-core v1.1.0/go.mod h1:2pcx9YWsIsZ3I7kH+1amiAkXvLTZtAq9kbxsfXilSoY=
github.com/IBM/go-sdk-core/v5 v5.9.2/go.mod h1:YlOwV9LeuclmT/qi/LAK2AsobbAP42veV0j68/rlZsE=
github.com/IBM/go-sdk-core/v5 v5.21.0 h1:DUnYhvC4SoC8T84rx5omnhY3+xcQg/Whyoa3mDPIMkk=
github.com/IBM/go-sdk-core/v5 v5.21.0/go.mod h1:Q3BYO6iDA2zweQPDGbNTtqft5tDcEpm6RTuqMlPcvbw=
Expand Down Expand Up @@ -48,6 +50,8 @@ github.com/cyphar/filepath-securejoin v0.4.1/go.mod h1:Sdj7gXlvMcPZsbhwhQ33GguGL
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/dgrijalva/jwt-go v3.2.0+incompatible h1:7qlOGliEKZXTDg6OTjfoBKDXWrumCAMpl/TFQ4/5kLM=
github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ=
github.com/elazarl/goproxy v1.7.2 h1:Y2o6urb7Eule09PjlhQRGNsqRfPmYI3KKQLFpCAV3+o=
github.com/elazarl/goproxy v1.7.2/go.mod h1:82vkLNir0ALaW14Rc399OTTjyNREgmdL2cVoIbS6XaE=
github.com/emirpasic/gods v1.18.1 h1:FXtiHYKDGKCW2KzwZKx0iC0PQmdlorYgdFG9jPXJ1Bc=
Expand Down Expand Up @@ -106,9 +110,11 @@ github.com/go-openapi/validate v0.24.0 h1:LdfDKwNbpB6Vn40xhTdNZAnfLECL81w+VX3Bum
github.com/go-openapi/validate v0.24.0/go.mod h1:iyeX1sEufmv3nPbBdX3ieNviWnOZaJ1+zquzJEf2BAQ=
github.com/go-playground/assert/v2 v2.2.0 h1:JvknZsQTYeFEAhQwI4qEt9cyV5ONwRHC+lYKSsYSR8s=
github.com/go-playground/assert/v2 v2.2.0/go.mod h1:VDjEfimB/XKnb+ZQfWdccd7VUvScMdVu0Titje2rxJ4=
github.com/go-playground/locales v0.12.1/go.mod h1:IUMDtCfWo/w/mtMfIE/IG2K+Ey3ygWanZIBtBW0W2TM=
github.com/go-playground/locales v0.14.0/go.mod h1:sawfccIbzZTqEDETgFXqTho0QybSa7l++s0DH+LDiLs=
github.com/go-playground/locales v0.14.1 h1:EWaQ/wswjilfKLTECiXz7Rh+3BjFhfDFKv/oXslEjJA=
github.com/go-playground/locales v0.14.1/go.mod h1:hxrqLVvrK65+Rwrd5Fc6F2O76J/NuW9t0sjnWqG1slY=
github.com/go-playground/universal-translator v0.16.0/go.mod h1:1AnU7NaIRDWWzGEKwgtJRd2xk99HeFyHw3yid4rvQIY=
github.com/go-playground/universal-translator v0.18.0/go.mod h1:UvRDBj+xPUEGrFYl+lu/H90nyDXpg0fqeB/AQUGNTVA=
github.com/go-playground/universal-translator v0.18.1 h1:Bcnm0ZwsGyWbCzImXv+pAJnYK9S473LQFuzCbDbfSFY=
github.com/go-playground/universal-translator v0.18.1/go.mod h1:xekY+UJKNuX9WP91TpwSH2VMlDf28Uj24BCp08ZFTUY=
Expand Down Expand Up @@ -193,6 +199,7 @@ github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
github.com/leodido/go-urn v1.2.0/go.mod h1:+8+nEpDfqqsY+g338gtMEUOtuK+4dEMhiQEgxpxOKII=
github.com/leodido/go-urn v1.2.1/go.mod h1:zt4jvISO2HfUBqxjfIshjdMTYS56ZS/qv49ictyFfxY=
github.com/leodido/go-urn v1.4.0 h1:WT9HwE9SGECu3lg4d/dIA+jxlljEa1/ffXKmRjqdmIQ=
github.com/leodido/go-urn v1.4.0/go.mod h1:bvxc+MVxLKB4z00jd1z+Dvzr47oO32F/QSNjSBOlFxI=
Expand Down Expand Up @@ -511,7 +518,10 @@ gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f/go.mod h1:Co6ibVJAznAaIkqp8
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk=
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q=
gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys=
gopkg.in/go-playground/assert.v1 v1.2.1 h1:xoYuJVE7KT85PYWrN730RguIQO0ePzVRfFMXadIrXTM=
gopkg.in/go-playground/assert.v1 v1.2.1/go.mod h1:9RXL0bg/zibRAgZUYszZSwO/z8Y/a8bDuhia5mkpMnE=
gopkg.in/go-playground/validator.v9 v9.30.0/go.mod h1:+c9/zcJMFNgbLvly1L1V+PpxWdVbfP1avr/N00E2vyQ=
gopkg.in/go-playground/validator.v9 v9.31.0 h1:bmXmP2RSNtFES+bn4uYuHT7iJFJv7Vj+an+ZQdDaD1M=
gopkg.in/go-playground/validator.v9 v9.31.0/go.mod h1:+c9/zcJMFNgbLvly1L1V+PpxWdVbfP1avr/N00E2vyQ=
gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ=
gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw=
Expand Down
104 changes: 48 additions & 56 deletions tests/pr_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import (
"strings"
"testing"

"github.com/IBM/go-sdk-core/core"
"github.com/gruntwork-io/terratest/modules/files"
"github.com/gruntwork-io/terratest/modules/logger"
"github.com/gruntwork-io/terratest/modules/random"
Expand All @@ -21,13 +22,15 @@ import (
"github.com/terraform-ibm-modules/ibmcloud-terratest-wrapper/common"
"github.com/terraform-ibm-modules/ibmcloud-terratest-wrapper/testaddons"
"github.com/terraform-ibm-modules/ibmcloud-terratest-wrapper/testhelper"
"github.com/terraform-ibm-modules/ibmcloud-terratest-wrapper/testschematic"
)

// Use existing resource group
const resourceGroup = "geretain-test-resources"
const basicExampleDir = "examples/basic"
const existingExampleDir = "examples/existing-instance"
const standardSolutionTerraformDir = "solutions/fully-configurable"
const fullyConfigurableSolutionTerraformDir = "solutions/fully-configurable"
const terraformVersion = "terraform_v1.10" // This should match the version in the ibm_catalog.json

// 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"
Expand Down Expand Up @@ -152,53 +155,45 @@ func TestRunExistingResourcesExample(t *testing.T) {
}
}

func TestRunStandardSolution(t *testing.T) {
t.Parallel()

options := testhelper.TestOptionsDefault(&testhelper.TestOptions{
Testing: t,
TerraformDir: standardSolutionTerraformDir,
Region: validRegions[rand.Intn(len(validRegions))],
Prefix: "wxo-da",
ResourceGroup: resourceGroup,
func setupFullyConfigurableOptions(t *testing.T, prefix string) *testschematic.TestSchematicOptions {
options := testschematic.TestSchematicOptionsDefault(&testschematic.TestSchematicOptions{
Testing: t,
TemplateFolder: fullyConfigurableSolutionTerraformDir,
Region: validRegions[rand.Intn(len(validRegions))],
Prefix: prefix,
ResourceGroup: resourceGroup,
TerraformVersion: terraformVersion,
})

options.TerraformVars = map[string]interface{}{
"service_plan": "essentials-agentic-mau",
"provider_visibility": "public",
"existing_resource_group_name": resourceGroup,
"prefix": options.Prefix,
"region": options.Region,
options.TerraformVars = []testschematic.TestSchematicTerraformVar{
{Name: "ibmcloud_api_key", Value: options.RequiredEnvironmentVars["TF_VAR_ibmcloud_api_key"], DataType: "string", Secure: true},
{Name: "prefix", Value: options.Prefix, DataType: "string"},
{Name: "region", Value: options.Region, DataType: "string"},
{Name: "existing_resource_group_name", Value: resourceGroup, DataType: "string"},
{Name: "provider_visibility", Value: "private", DataType: "string"},
{Name: "service_plan", Value: "essentials-agentic-mau", DataType: "string"},
}
return options
}

output, err := options.RunTestConsistency()
func TestRunFullyConfigurableSolutionSchematics(t *testing.T) {
t.Parallel()

options := setupFullyConfigurableOptions(t, "wxo-da")

err := options.RunSchematicTest()
assert.Nil(t, err, "This should not have errored")
assert.NotNil(t, output, "Expected some output")
}

func TestRunStandardUpgradeSolution(t *testing.T) {
func TestRunFullyConfigurableUpgradeSolutionSchematics(t *testing.T) {
t.Parallel()

options := testhelper.TestOptionsDefault(&testhelper.TestOptions{
Testing: t,
TerraformDir: standardSolutionTerraformDir,
Region: validRegions[rand.Intn(len(validRegions))],
Prefix: "wxo-upg",
ResourceGroup: resourceGroup,
})

options.TerraformVars = map[string]interface{}{
"service_plan": "essentials-agentic-mau",
"provider_visibility": "public",
"existing_resource_group_name": resourceGroup,
"prefix": options.Prefix,
"region": options.Region,
}
options := setupFullyConfigurableOptions(t, "wxo-upg")
options.CheckApplyResultForUpgrade = true

output, err := options.RunTestUpgrade()
err := options.RunSchematicUpgradeTest()
if !options.UpgradeTestSkipped {
assert.Nil(t, err, "This should not have errored")
assert.NotNil(t, output, "Expected some output")
}
}

Expand All @@ -221,29 +216,26 @@ func TestDefaultConfiguration(t *testing.T) {
"existing_resource_group_name": resourceGroup,
},
)

err := options.RunAddonTest()
require.NoError(t, err)
}

// TestDependencyPermutations runs dependency permutations for watsonx orchestrate and all its dependencies
func TestDependencyPermutations(t *testing.T) {
t.Skip("Skipping dependency permutations")
t.Parallel()

options := testaddons.TestAddonsOptionsDefault(&testaddons.TestAddonOptions{
Testing: t,
Prefix: "wxor-perm",
AddonConfig: cloudinfo.AddonConfig{
OfferingName: "deploy-arch-ibm-watsonx-orchestrate",
// Disable target / route creation to prevent hitting quota in account
options.AddonConfig.Dependencies = []cloudinfo.AddonConfig{
{
OfferingName: "deploy-arch-ibm-cloud-monitoring",
OfferingFlavor: "fully-configurable",
Inputs: map[string]interface{}{
"prefix": "wxor-perm",
"existing_resource_group_name": resourceGroup,
"enable_metrics_routing_to_cloud_monitoring": false,
},
Enabled: core.BoolPtr(true),
},
})
{
OfferingName: "deploy-arch-ibm-activity-tracker",
OfferingFlavor: "fully-configurable",
Inputs: map[string]interface{}{
"enable_activity_tracker_event_routing_to_cloud_logs": false,
},
Enabled: core.BoolPtr(true),
},
}

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