Skip to content

Commit

Permalink
generate test config before running performance test
Browse files Browse the repository at this point in the history
  • Loading branch information
asalan316 committed Jan 13, 2025
1 parent b33c821 commit 0839ede
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 12 deletions.
7 changes: 5 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -381,7 +381,7 @@ build-acceptance-tests:
@make --directory='./src/acceptance' build_tests

.PHONY: acceptance-tests
acceptance-tests: build-test-app ## Run acceptance tests against OSS dev environment (requires a previous deployment of the autoscaler)
acceptance-tests: build-test-app acceptance-tests-config ## Run acceptance tests against OSS dev environment (requrires a previous deployment of the autoscaler)
@make --directory='./src/acceptance' run-acceptance-tests
.PHONY: acceptance-cleanup
acceptance-cleanup:
Expand All @@ -403,14 +403,17 @@ setup-performance: build-test-app
export NODES=1;\
export SUITES="setup_performance";\
export DEPLOYMENT_NAME="autoscaler-performance";\
make acceptance-tests-config;\
make --directory='./src/acceptance' run-acceptance-tests

.PHONY: run-performance
run-performance:
export NODES=1;\
export DEPLOYMENT_NAME="autoscaler-performance";\
export SUITES="run_performance";\
make --directory='./src/acceptance' run-acceptance-tests
make acceptance-tests-config;\
make --directory='./src/acceptance' run-acceptance-tests


.PHONY: run-act
run-act:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ existing_space="${EXISTING_SPACE:-}"
performance_app_count="${PERFORMANCE_APP_COUNT:-}"
performance_app_percentage_to_scale="${PERFORMANCE_APP_PERCENTAGE_TO_SCALE:-}"
performance_setup_workers="${PERFORMANCE_SETUP_WORKERS:-}"
performance_update_existing_org_quota=${PERFORMANCE_UPDATE_EXISTING_ORG_QUOTA:-}
performance_update_existing_org_quota=${PERFORMANCE_UPDATE_EXISTING_ORG_QUOTA:-true}
cpu_upper_threshold=${CPU_UPPER_THRESHOLD:-100}

if [[ -z "${cf_admin_password}" ]]
Expand All @@ -26,11 +26,11 @@ then
cf_admin_password="$(credhub get --quiet --name='/bosh-autoscaler/cf/cf_admin_password')"
fi

function write_test_config() {
function write_app_config() {
local -r config_path="$1"
local -r use_existing_organization="$2"
local -r use_existing_space="$3"
local -r existing_organization="$4"
local -r existing_org="$4"
local -r existing_space="$5"

cat > "${config_path}" << EOF
Expand All @@ -45,7 +45,7 @@ function write_test_config() {
"service_plan": "autoscaler-free-plan",
"service_broker": "${deployment_name}",
"use_existing_organization": ${use_existing_organization},
"existing_organization": "${existing_organization}",
"existing_organization": "${existing_org}",
"use_existing_space": ${use_existing_space},
"existing_space": "${existing_space}",
"aggregate_interval": 120,
Expand All @@ -63,3 +63,7 @@ function write_test_config() {
}
EOF
}

write_app_config \
"${ACCEPTANCE_CONFIG_PATH}" \
"${use_existing_organization}" "${use_existing_space}" "${existing_organization}" "${existing_space}"
7 changes: 1 addition & 6 deletions ci/autoscaler/scripts/run-acceptance-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
set -eu -o pipefail
script_dir="$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"
source "${script_dir}/vars.source.sh"
source "${script_dir}/acceptance-tests-config.source.sh"

skip_teardown="${SKIP_TEARDOWN:-false}"
suites="${SUITES:-"api app broker"}"
Expand All @@ -17,11 +16,7 @@ then
exit 1;
fi

write_test_config \
"${autoscaler_acceptance_dir}/acceptance_config.json" \
"${USE_EXISTING_ORGANIZATION:-false}" "${USE_EXISTING_SPACE:-false}" "${EXISTING_ORGANIZATION:-}" "${EXISTING_SPACE:-}"

if [[ ! -f "${autoscaler_dir}/src/acceptance/acceptance_config.json" ]]
if [[ ! -f "${autoscaler_acceptance_dir}/acceptance_config.json" ]]
then
echo 'FAILED: Did not find file acceptance_config.json.'
exit 1
Expand Down

0 comments on commit 0839ede

Please sign in to comment.