diff --git a/scale-testing.mk b/scale-testing.mk index 18e9e947..2f98d2aa 100644 --- a/scale-testing.mk +++ b/scale-testing.mk @@ -5,6 +5,8 @@ AWS_REGION ?= us-east-2 EKS_K8S_VERSION ?= 1.30 +# testing dev instances is currently not supported +# TODO: create the docker registry (e.g. ECR) to enable dev builds VERSION ?= 0.8.1 INTEGRATION_TESTS_PARALLEL ?= true SKIP_HCPVSAPPS_TESTS ?= true diff --git a/test/integration/vaultdynamicsecret_integration_test.go b/test/integration/vaultdynamicsecret_integration_test.go index 74873d69..44a80916 100644 --- a/test/integration/vaultdynamicsecret_integration_test.go +++ b/test/integration/vaultdynamicsecret_integration_test.go @@ -8,6 +8,7 @@ import ( "encoding/json" "errors" "fmt" + "log" "maps" "os" "path" @@ -100,13 +101,18 @@ func TestVaultDynamicSecret(t *testing.T) { // TODO: Extend this to support other dynamic create test cases defaultCreate := 5 // Default count if no VDS_CREATE_COUNT is set vdsCreateCount := getEnvInt("VDS_CREATE_COUNT", -1) + + // Counts can't be <= 0, if they are, the default count will be used. + if vdsCreateCount <= 0 { + log.Printf("Invalid VDS_CREATE_COUNT: %d, using default count: %d", vdsCreateCount, defaultCreate) + vdsCreateCount = defaultCreate + } + createOnlyCount := getEnvInt("VDS_CREATE_ONLY", defaultCreate) mixedCount := getEnvInt("VDS_MIXED_CREATE", defaultCreate) - if vdsCreateCount != -1 { - createOnlyCount = vdsCreateCount - mixedCount = vdsCreateCount - } + createOnlyCount = vdsCreateCount + mixedCount = vdsCreateCount ctx := context.Background() crdClient := getCRDClient(t) diff --git a/test/integration/vaultpkisecret_integration_test.go b/test/integration/vaultpkisecret_integration_test.go index a10a2040..e340bdd2 100644 --- a/test/integration/vaultpkisecret_integration_test.go +++ b/test/integration/vaultpkisecret_integration_test.go @@ -7,6 +7,7 @@ import ( "context" "encoding/json" "fmt" + "log" "os" "path" "path/filepath" @@ -64,15 +65,20 @@ func TestVaultPKISecret(t *testing.T) { defaultCreate := 5 // Default count if no VDS_CREATE_COUNT is set vpsCreateCount := getEnvInt("VPS_CREATE_COUNT", -1) + + // Ensure vpsCreateCount is valid + if vpsCreateCount <= 0 { + log.Printf("Invalid VPS_CREATE_COUNT: %d, using default count: %d", vpsCreateCount, defaultCreate) + vpsCreateCount = defaultCreate + } + createOnlyCount := getEnvInt("VPS_CREATE_ONLY", 1) mixedCount := getEnvInt("VPS_MIXED_CREATE", defaultCreate) createTLSCount := getEnvInt("VPS_MIXED_CREATE", 2) - if vpsCreateCount != -1 { - createOnlyCount = vpsCreateCount - mixedCount = vpsCreateCount - createTLSCount = vpsCreateCount - } + createOnlyCount = vpsCreateCount + mixedCount = vpsCreateCount + createTLSCount = vpsCreateCount tempDir, err := os.MkdirTemp(os.TempDir(), t.Name()) require.Nil(t, err) diff --git a/test/integration/vaultstaticsecret_integration_test.go b/test/integration/vaultstaticsecret_integration_test.go index 5c794e07..fdde63b9 100644 --- a/test/integration/vaultstaticsecret_integration_test.go +++ b/test/integration/vaultstaticsecret_integration_test.go @@ -63,8 +63,16 @@ func TestVaultStaticSecret(t *testing.T) { // If VSS_CREATE_COUNT is set, it will override the specific test counts. // If VSS_CREATE_COUNT is not set, the specific test counts will be used. // If no counts are set, the default count will be used. + // Counts can't be <= 0, if they are, the default count will be used. defaultCreate := 2 // Default count if no VSS_CREATE_COUNT is set vssCreateCount := getEnvInt("VSS_CREATE_COUNT", -1) + + // Ensure vssCreateCount is valid + if vssCreateCount <= 0 { + log.Printf("Invalid VSS_CREATE_COUNT %d, using default count %d", vssCreateCount, defaultCreate) + vssCreateCount = defaultCreate + } + kvv1Count := getEnvInt("VSS_KVV1_CREATE", defaultCreate) kvv2Count := getEnvInt("VSS_KVV2_CREATE", defaultCreate) bothCount := getEnvInt("VSS_BOTH_CREATE", defaultCreate) @@ -72,15 +80,12 @@ func TestVaultStaticSecret(t *testing.T) { mixedBothCount := getEnvInt("VSS_MIXED_BOTH_CREATE", defaultCreate) eventsBothCount := getEnvInt("VSS_EVENTS_BOTH_CREATE", defaultCreate) - // Apply VSS_CREATE_COUNT if it is set - if vssCreateCount != -1 { - kvv1Count = vssCreateCount - kvv2Count = vssCreateCount - bothCount = vssCreateCount - kvv2FixedCount = vssCreateCount - mixedBothCount = vssCreateCount - eventsBothCount = vssCreateCount - } + kvv1Count = vssCreateCount + kvv2Count = vssCreateCount + bothCount = vssCreateCount + kvv2FixedCount = vssCreateCount + mixedBothCount = vssCreateCount + eventsBothCount = vssCreateCount // The events tests require Vault Enterprise >= 1.16.3, and since that // changes the app policy required we need to set a flag in the test