2019-02-18 22:41:45 +01:00
|
|
|
#!/usr/bin/env bash
|
2016-11-30 06:21:53 +01:00
|
|
|
|
2019-02-18 22:41:45 +01:00
|
|
|
set -o pipefail -eux
|
2016-11-30 06:21:53 +01:00
|
|
|
|
|
|
|
declare -a args
|
2017-10-03 21:43:46 +02:00
|
|
|
IFS='/:' read -ra args <<< "$1"
|
2016-11-30 06:21:53 +01:00
|
|
|
|
|
|
|
script="${args[0]}"
|
|
|
|
|
2017-10-03 21:43:46 +02:00
|
|
|
test="$1"
|
|
|
|
|
2021-04-28 00:10:51 +02:00
|
|
|
docker images
|
2016-11-30 06:21:53 +01:00
|
|
|
docker ps
|
|
|
|
|
2021-04-28 00:10:51 +02:00
|
|
|
for container in $(docker ps --format '{{.Image}} {{.ID}}' | grep -v -e '^quay.io/ansible/azure-pipelines-test-container:' | sed 's/^.* //'); do
|
2019-02-21 22:59:56 +01:00
|
|
|
docker rm -f "${container}" || true # ignore errors
|
2018-07-10 06:06:13 +02:00
|
|
|
done
|
|
|
|
|
|
|
|
docker ps
|
|
|
|
|
2019-08-05 23:56:38 +02:00
|
|
|
export PATH="${PWD}/bin:${PATH}"
|
2017-04-09 07:34:29 +02:00
|
|
|
export PYTHONIOENCODING='utf-8'
|
2017-05-13 19:08:42 +02:00
|
|
|
|
2017-05-14 09:04:52 +02:00
|
|
|
if [ -n "${COVERAGE:-}" ]; then
|
|
|
|
# on-demand coverage reporting triggered by setting the COVERAGE environment variable to a non-empty value
|
2017-05-13 19:08:42 +02:00
|
|
|
export COVERAGE="--coverage"
|
2017-05-14 09:04:52 +02:00
|
|
|
elif [[ "${COMMIT_MESSAGE}" =~ ci_coverage ]]; then
|
|
|
|
# on-demand coverage reporting triggered by having 'ci_coverage' in the latest commit message
|
|
|
|
export COVERAGE="--coverage"
|
|
|
|
else
|
|
|
|
# on-demand coverage reporting disabled (default behavior, always-on coverage reporting remains enabled)
|
2019-03-11 23:13:09 +01:00
|
|
|
export COVERAGE="--coverage-check"
|
2017-05-14 09:04:52 +02:00
|
|
|
fi
|
|
|
|
|
|
|
|
if [ -n "${COMPLETE:-}" ]; then
|
|
|
|
# disable change detection triggered by setting the COMPLETE environment variable to a non-empty value
|
|
|
|
export CHANGED=""
|
|
|
|
elif [[ "${COMMIT_MESSAGE}" =~ ci_complete ]]; then
|
|
|
|
# disable change detection triggered by having 'ci_complete' in the latest commit message
|
|
|
|
export CHANGED=""
|
|
|
|
else
|
|
|
|
# enable change detection (default behavior)
|
|
|
|
export CHANGED="--changed"
|
2017-05-13 19:08:42 +02:00
|
|
|
fi
|
2016-11-30 06:21:53 +01:00
|
|
|
|
2018-04-13 01:15:28 +02:00
|
|
|
if [ "${IS_PULL_REQUEST:-}" == "true" ]; then
|
|
|
|
# run unstable tests which are targeted by focused changes on PRs
|
|
|
|
export UNSTABLE="--allow-unstable-changed"
|
|
|
|
else
|
|
|
|
# do not run unstable tests outside PRs
|
|
|
|
export UNSTABLE=""
|
|
|
|
fi
|
|
|
|
|
2019-03-11 23:13:09 +01:00
|
|
|
if [[ "${COVERAGE:-}" == "--coverage" ]]; then
|
2019-03-05 20:58:13 +01:00
|
|
|
timeout=60
|
|
|
|
else
|
2019-11-01 16:59:29 +01:00
|
|
|
timeout=50
|
2019-03-05 20:58:13 +01:00
|
|
|
fi
|
|
|
|
|
|
|
|
ansible-test env --dump --show --timeout "${timeout}" --color -v
|
2018-12-21 07:08:57 +01:00
|
|
|
|
2017-10-03 21:43:46 +02:00
|
|
|
"test/utils/shippable/${script}.sh" "${test}"
|