Skip to content

Commit

Permalink
If no --parallel option is given, it runs all the tests in one
Browse files Browse the repository at this point in the history
ansible-playbook command line that is the original behavior.
If `--parallel` option is given, it runs each test per command
line. To run *.yml per command line in one container, '--parallel 1`
option is required.
  • Loading branch information
nhosoi committed Jun 28, 2023
1 parent 5a000ad commit 654d23a
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions src/tox_lsr/test_scripts/runcontainer.sh
Original file line number Diff line number Diff line change
Expand Up @@ -318,11 +318,18 @@ run_playbooks() {
setup_vault "$test_dir" "${test_pb_base}.yml"
# shellcheck disable=SC2086
pushd "$test_dir" > /dev/null
for pb in ${test_pb[@]}; do
if [ "$PARALLEL" -gt 0 ]; then
for pb in ${test_pb[@]}; do
ansible-playbook -vv ${CONTAINER_SKIP_TAGS:-} ${EXTRA_SKIP_TAGS:-} \
-i "$inv_file" ${vault_args:-} \
-e ansible_playbook_filepath="$(type -p ansible-playbook)" "$pb"
done
else
ansible-playbook -vv ${CONTAINER_SKIP_TAGS:-} ${EXTRA_SKIP_TAGS:-} \
-i "$inv_file" ${vault_args:-} \
-e ansible_playbook_filepath="$(type -p ansible-playbook)" "$pb"
done
-e ansible_playbook_filepath="$(type -p ansible-playbook)" \
"${test_pb[@]}"
fi
popd > /dev/null
}

Expand Down

0 comments on commit 654d23a

Please sign in to comment.