mirror of
https://bitbucket.org/atlassian/dc-deployments-automation.git
synced 2025-12-14 00:43:06 -06:00
51 lines
987 B
Bash
Executable File
51 lines
987 B
Bash
Executable File
#!/bin/bash
|
|
|
|
set -e
|
|
#set -x
|
|
|
|
# Install dev packages from Pipfile.lock if necessary.
|
|
#pipenv sync --dev
|
|
|
|
BATCH_NUMBER=""
|
|
batch_args="$1"
|
|
|
|
case $batch_args in
|
|
-b|--batch)
|
|
BATCH_NUMBER="$2"
|
|
;;
|
|
--default)
|
|
BATCH_NUMBER=""
|
|
;;
|
|
esac
|
|
|
|
if [[ -z "$BATCH_NUMBER" ]]; then
|
|
echo "Batch number not passed in. Please pass a batch number to run tests."
|
|
exit -1
|
|
fi
|
|
|
|
case ${BATCH_NUMBER} in
|
|
''|*[1-9]*) ;;
|
|
*) echo "Bad Input for Batch number. ${BATCH_NUMBER} is not a valid batch number (Should be a number >= 1)" && exit -1 ;;
|
|
esac
|
|
|
|
scenarios=( $(ls -d1 roles/**/molecule/* | sort) )
|
|
|
|
offset=$(( ${BATCH_NUMBER} - 1))
|
|
test_start_index=$(( ${offset} * 3 ))
|
|
|
|
for scenario in "${scenarios[@]:$test_start_index:3}"; 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
|