2019-02-18 21:41:45 +00:00
|
|
|
#!/usr/bin/env bash
|
2016-11-30 05:21:53 +00:00
|
|
|
|
2019-02-18 21:41:45 +00:00
|
|
|
set -o pipefail -eux
|
2016-11-30 05:21:53 +00:00
|
|
|
|
2017-02-25 00:58:56 +00:00
|
|
|
declare -a args
|
2017-10-03 19:43:46 +00:00
|
|
|
IFS='/:' read -ra args <<< "$1"
|
2017-01-10 18:30:41 +00:00
|
|
|
|
2017-02-25 00:58:56 +00:00
|
|
|
version="${args[1]}"
|
2017-01-10 18:30:41 +00:00
|
|
|
|
2019-03-11 22:13:09 +00:00
|
|
|
if [[ "${COVERAGE:-}" == "--coverage" ]]; then
|
2019-04-05 16:32:09 +00:00
|
|
|
timeout=99
|
2019-03-05 19:58:13 +00:00
|
|
|
else
|
2019-03-21 16:18:12 +00:00
|
|
|
timeout=11
|
2019-03-05 19:58:13 +00:00
|
|
|
fi
|
|
|
|
|
|
|
|
ansible-test env --timeout "${timeout}" --color -v
|
|
|
|
|
2019-06-04 22:15:36 +00:00
|
|
|
if [[ "${version}" = "2.6" ]]; then
|
|
|
|
# Python 2.6 is only supported for modules and module_utils.
|
|
|
|
# Eventually this logic will move into ansible-test itself.
|
|
|
|
targets=("test/units/(modules|module_utils)/")
|
|
|
|
else
|
|
|
|
targets=("test/units/")
|
|
|
|
fi
|
|
|
|
|
2017-05-14 07:04:52 +00:00
|
|
|
# shellcheck disable=SC2086
|
2018-01-23 18:00:55 +00:00
|
|
|
ansible-test units --color -v --docker default --python "${version}" ${COVERAGE:+"$COVERAGE"} ${CHANGED:+"$CHANGED"} \
|
2019-06-04 22:15:36 +00:00
|
|
|
"${targets[@]}" \
|