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