From 90cd3f5f98797bf04f10d3c57062caa4b3fd4fdb Mon Sep 17 00:00:00 2001 From: Varun Arbatti Date: Thu, 29 Aug 2019 16:34:58 +1000 Subject: [PATCH] DCD-621: Cleans up comments & extracts batch number to a variable --- bin/run-tests-in-batches | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) diff --git a/bin/run-tests-in-batches b/bin/run-tests-in-batches index ca3bd78..54b8d1b 100755 --- a/bin/run-tests-in-batches +++ b/bin/run-tests-in-batches @@ -4,8 +4,9 @@ set -e #set -x # Install dev packages from Pipfile.lock if necessary. -#pipenv sync --dev +pipenv sync --dev +BATCH_SIZE=3 BATCH_NUMBER="" batch_args="$1" @@ -31,20 +32,14 @@ esac scenarios=( $(ls -d1 roles/**/molecule/* | sort) ) offset=$(( ${BATCH_NUMBER} - 1)) -test_start_index=$(( ${offset} * 3 )) +test_start_index=$(( ${offset} * $BATCH_SIZE )) +scenario_batch="${scenarios[@]:$test_start_index:$BATCH_SIZE}" -for scenario in "${scenarios[@]:$test_start_index:3}"; do +echo "Scenarios that will be executed as part of this batch: ${scenario_batch}" + +for scenario in ${scenario_batch}; do pushd $(dirname $(dirname $scenario)) pipenv run \ molecule test --all popd done; - - - -#for role in `find roles/ -name molecule | sort`; do -# pushd `dirname $role` -# pipenv run \ -# molecule test --all -# popd -#done