@@ -10,12 +10,15 @@ import (
1010 "strings"
1111 "testing"
1212
13+ "github.com/IBM/go-sdk-core/v5/core"
1314 "github.com/gruntwork-io/terratest/modules/files"
1415 "github.com/gruntwork-io/terratest/modules/logger"
1516 "github.com/gruntwork-io/terratest/modules/random"
1617 "github.com/gruntwork-io/terratest/modules/terraform"
1718 "github.com/stretchr/testify/assert"
1819 "github.com/stretchr/testify/require"
20+ "github.com/terraform-ibm-modules/ibmcloud-terratest-wrapper/cloudinfo"
21+ "github.com/terraform-ibm-modules/ibmcloud-terratest-wrapper/testaddons"
1922 "github.com/terraform-ibm-modules/ibmcloud-terratest-wrapper/testhelper"
2023 "github.com/terraform-ibm-modules/ibmcloud-terratest-wrapper/testschematic"
2124)
@@ -220,3 +223,37 @@ func TestRunExistingResourcesExample(t *testing.T) {
220223 logger .Log (t , "END: Destroy (existing resources)" )
221224 }
222225}
226+
227+ // This DA has no "on-by-default" dependencies defined so hence testing with Account Config DA enabled
228+ func TestAddonWithAccountConfig (t * testing.T ) {
229+ t .Parallel ()
230+
231+ options := testaddons .TestAddonsOptionsDefault (& testaddons.TestAddonOptions {
232+ Testing : t ,
233+ Prefix : "icr-addon" ,
234+ ResourceGroup : resourceGroup ,
235+ QuietMode : true , // Suppress logs except on failure
236+ })
237+
238+ options .AddonConfig = cloudinfo .NewAddonConfigTerraform (
239+ options .Prefix ,
240+ "deploy-arch-ibm-container-registry" ,
241+ "fully-configurable" ,
242+ map [string ]interface {}{
243+ "prefix" : options .Prefix ,
244+ "namespace_region" : "us-south" ,
245+ },
246+ )
247+
248+ // Enable Account Config DA
249+ options .AddonConfig .Dependencies = []cloudinfo.AddonConfig {
250+ {
251+ OfferingName : "deploy-arch-ibm-account-infra-base" ,
252+ OfferingFlavor : "resource-groups-with-account-settings" ,
253+ Enabled : core .BoolPtr (true ), // explicitly enable this dependency
254+ },
255+ }
256+
257+ err := options .RunAddonTest ()
258+ require .NoError (t , err )
259+ }
0 commit comments