From ba35e9dccdd6c8d8a9eeb9a8c8ae082138329dee Mon Sep 17 00:00:00 2001 From: Robert Gottlieb Date: Tue, 17 Sep 2024 10:44:41 -0400 Subject: [PATCH 1/2] fix acceptance tests by adding missing var in parameter --- ci/run-smoke-test-rotate-creds.sh | 5 +++-- ci/run-smoke-tests-db-updates.sh | 4 ++-- ci/run-smoke-tests-db-version.sh | 4 ++-- ci/run-smoke-tests-update-storage.sh | 4 ++-- ci/run-smoke-tests.sh | 4 ++-- 5 files changed, 11 insertions(+), 10 deletions(-) mode change 100755 => 100644 ci/run-smoke-test-rotate-creds.sh mode change 100755 => 100644 ci/run-smoke-tests-db-updates.sh mode change 100755 => 100644 ci/run-smoke-tests-db-version.sh mode change 100755 => 100644 ci/run-smoke-tests-update-storage.sh mode change 100755 => 100644 ci/run-smoke-tests.sh diff --git a/ci/run-smoke-test-rotate-creds.sh b/ci/run-smoke-test-rotate-creds.sh old mode 100755 new mode 100644 index 683a0ad1..a92b0184 --- a/ci/run-smoke-test-rotate-creds.sh +++ b/ci/run-smoke-test-rotate-creds.sh @@ -23,7 +23,7 @@ cf delete-service -f "rds-smoke-tests-db-rotate-creds-$SERVICE_PLAN" # change into the directory and push the app without starting it. pushd aws-db-test/databases/aws-rds -cf push "smoke-tests-db-rotate-creds-${SERVICE_PLAN}" -f manifest.yml --no-start +cf push "smoke-tests-db-rotate-creds-${SERVICE_PLAN}" -f manifest.yml --var rds-service="rds-smoke-tests-db-rotate-creds-$SERVICE_PLAN" --no-start # set some variables that it needs cf set-env "smoke-tests-db-rotate-creds-${SERVICE_PLAN}" DB_TYPE "${SERVICE_PLAN}" @@ -43,7 +43,7 @@ while true; do done # wait for the app to start. if the app starts, it's passed the smoke test. -cf push "smoke-tests-db-rotate-creds-${SERVICE_PLAN}" +cf push "smoke-tests-db-rotate-creds-${SERVICE_PLAN}" --var rds-service="rds-smoke-tests-db-rotate-creds-$SERVICE_PLAN" # Rotate creds cf update-service "rds-smoke-tests-db-rotate-creds-$SERVICE_PLAN" -c '{"rotate_credentials": true}' @@ -69,6 +69,7 @@ cf restage "smoke-tests-db-rotate-creds-${SERVICE_PLAN}" # Restart app - if it succeeds, then smoke tests have passed with new credentials cf restart "smoke-tests-db-rotate-creds-${SERVICE_PLAN}" + # Clean up app and service cf delete -f "smoke-tests-db-rotate-creds-$SERVICE_PLAN" cf delete-service -f "rds-smoke-tests-db-rotate-creds-$SERVICE_PLAN" diff --git a/ci/run-smoke-tests-db-updates.sh b/ci/run-smoke-tests-db-updates.sh old mode 100755 new mode 100644 index 6c8f3e3d..239a8f19 --- a/ci/run-smoke-tests-db-updates.sh +++ b/ci/run-smoke-tests-db-updates.sh @@ -24,7 +24,7 @@ cf delete-service -f "rds-smoke-tests-db-update-$SERVICE_PLAN" # change into the directory and push the app without starting it. pushd aws-db-test/databases/aws-rds -cf push "smoke-tests-db-update-${SERVICE_PLAN}" -f manifest.yml --no-start +cf push "smoke-tests-db-update-${SERVICE_PLAN}" -f manifest.yml --var rds-service="rds-smoke-tests-update-$SERVICE_PLAN" --no-start # set some variables that it needs cf set-env "smoke-tests-db-update-${SERVICE_PLAN}" DB_TYPE "${SERVICE_PLAN}" @@ -50,7 +50,7 @@ while true; do done # wait for the app to start. if the app starts, it's passed the smoke test. -cf push "smoke-tests-db-update-${SERVICE_PLAN}" +cf push "smoke-tests-db-update-${SERVICE_PLAN}" --var rds-service="rds-smoke-tests-db-update-$SERVICE_PLAN" # Update service cf update-service "rds-smoke-tests-db-update-$SERVICE_PLAN" -p "$NEW_SERVICE_PLAN" diff --git a/ci/run-smoke-tests-db-version.sh b/ci/run-smoke-tests-db-version.sh old mode 100755 new mode 100644 index 9596be88..981582c8 --- a/ci/run-smoke-tests-db-version.sh +++ b/ci/run-smoke-tests-db-version.sh @@ -23,7 +23,7 @@ cf delete-service -f "rds-smoke-tests-db-version-$SERVICE_PLAN" # change into the directory and push the app without starting it. pushd aws-db-test/databases/aws-rds -cf push "smoke-tests-db-version-${SERVICE_PLAN}" -f manifest.yml --no-start +cf push "smoke-tests-db-version-${SERVICE_PLAN}" -f manifest.yml --var rds-service="rds-smoke-tests-db-version-$SERVICE_PLAN" --no-start # set some variables that it needs cf set-env "smoke-tests-db-version-${SERVICE_PLAN}" DB_TYPE "${SERVICE_PLAN}" @@ -49,7 +49,7 @@ while true; do done # wait for the app to start. if the app starts, it's passed the smoke test. -cf push "smoke-tests-db-version-${SERVICE_PLAN}" +cf push "smoke-tests-db-version-${SERVICE_PLAN}" --var rds-service="rds-smoke-tests-db-version-$SERVICE_PLAN" # Clean up app and service cf delete -f "smoke-tests-db-version-$SERVICE_PLAN" diff --git a/ci/run-smoke-tests-update-storage.sh b/ci/run-smoke-tests-update-storage.sh old mode 100755 new mode 100644 index 57ecfb41..abb7a899 --- a/ci/run-smoke-tests-update-storage.sh +++ b/ci/run-smoke-tests-update-storage.sh @@ -24,7 +24,7 @@ cf delete-service -f "rds-smoke-tests-db-update-storage-$SERVICE_PLAN" # change into the directory and push the app without starting it. pushd aws-db-test/databases/aws-rds -cf push "smoke-tests-db-update-storage-${SERVICE_PLAN}" -f manifest.yml --no-start +cf push "smoke-tests-db-update-storage-${SERVICE_PLAN}" -f manifest.yml --var rds-service="rds-smoke-tests-db-update-storage-$SERVICE_PLAN" --no-start # set some variables that it needs cf set-env "smoke-tests-db-update-storage-${SERVICE_PLAN}" DB_TYPE "${SERVICE_PLAN}" @@ -50,7 +50,7 @@ while true; do done # wait for the app to start. if the app starts, it's passed the smoke test. -cf push "smoke-tests-db-update-storage-${SERVICE_PLAN}" +cf push "smoke-tests-db-update-storage-${SERVICE_PLAN}" --var rds-service="rds-smoke-tests-db-update-storage-$SERVICE_PLAN" # Update storage size cf update-service "rds-smoke-tests-db-update-storage-$SERVICE_PLAN" -c '{"storage": 25}' diff --git a/ci/run-smoke-tests.sh b/ci/run-smoke-tests.sh old mode 100755 new mode 100644 index 4ffcc3ae..f2249b2e --- a/ci/run-smoke-tests.sh +++ b/ci/run-smoke-tests.sh @@ -11,7 +11,7 @@ cf delete-service -f "rds-smoke-tests-$SERVICE_PLAN" # change into the directory and push the app without starting it. pushd aws-db-test/databases/aws-rds -cf push "smoke-tests-${SERVICE_PLAN}" -f manifest.yml --no-start +cf push "smoke-tests-${SERVICE_PLAN}" -f manifest.yml --var rds-service="rds-smoke-tests-$SERVICE_PLAN" --no-start # set some variables that it needs cf set-env "smoke-tests-${SERVICE_PLAN}" DB_TYPE "${SERVICE_PLAN}" @@ -37,7 +37,7 @@ while true; do done # wait for the app to start. if the app starts, it's passed the smoke test. -cf push "smoke-tests-${SERVICE_PLAN}" +cf push "smoke-tests-${SERVICE_PLAN}" --var rds-service="rds-smoke-tests-$SERVICE_PLAN" # Clean up app and service cf delete -f "smoke-tests-$SERVICE_PLAN" From 960ebfa3fb214bac2763824503d6753b8c53465a Mon Sep 17 00:00:00 2001 From: Robert Gottlieb Date: Tue, 17 Sep 2024 10:49:55 -0400 Subject: [PATCH 2/2] adding in the fix for the build manifest as well --- ci/build-manifest.sh | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) mode change 100755 => 100644 ci/build-manifest.sh diff --git a/ci/build-manifest.sh b/ci/build-manifest.sh old mode 100755 new mode 100644 index b9cb7af0..c06a0e64 --- a/ci/build-manifest.sh +++ b/ci/build-manifest.sh @@ -12,11 +12,10 @@ TERRAFORM="${TERRAFORM_BIN:-terraform}" # Append environment variables to manifest cat << EOF >> built/manifest.yml -env: - DB_URL: `${TERRAFORM} output -raw -state=$STATE_FILE rds_internal_rds_host` - DB_PORT: `${TERRAFORM} output -raw -state=$STATE_FILE rds_internal_rds_port` - S3_SNAPSHOT_BUCKET: `${TERRAFORM} output -raw -state=$STATE_FILE s3_snapshots_bucket_id` - ENABLE_FUNCTIONS: true + DB_URL: `${TERRAFORM} output -raw -state=$STATE_FILE rds_internal_rds_host` + DB_PORT: `${TERRAFORM} output -raw -state=$STATE_FILE rds_internal_rds_port` + S3_SNAPSHOT_BUCKET: `${TERRAFORM} output -raw -state=$STATE_FILE s3_snapshots_bucket_id` + ENABLE_FUNCTIONS: true EOF # Build secrets for merging into templates