mirror of https://github.com/ansible/ansible.git
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
63 lines
1.8 KiB
Bash
63 lines
1.8 KiB
Bash
6 years ago
|
#!/usr/bin/env bash
|
||
8 years ago
|
|
||
6 years ago
|
set -o pipefail -eux
|
||
8 years ago
|
|
||
|
declare -a args
|
||
7 years ago
|
IFS='/:' read -ra args <<< "$1"
|
||
8 years ago
|
|
||
|
script="${args[0]}"
|
||
|
|
||
7 years ago
|
test="$1"
|
||
|
|
||
4 years ago
|
docker images
|
||
8 years ago
|
docker ps
|
||
|
|
||
4 years ago
|
for container in $(docker ps --format '{{.Image}} {{.ID}}' | grep -v -e '^quay.io/ansible/azure-pipelines-test-container:' | sed 's/^.* //'); do
|
||
6 years ago
|
docker rm -f "${container}" || true # ignore errors
|
||
6 years ago
|
done
|
||
|
|
||
|
docker ps
|
||
|
|
||
5 years ago
|
export PATH="${PWD}/bin:${PATH}"
|
||
8 years ago
|
export PYTHONIOENCODING='utf-8'
|
||
8 years ago
|
|
||
8 years ago
|
if [ -n "${COVERAGE:-}" ]; then
|
||
|
# on-demand coverage reporting triggered by setting the COVERAGE environment variable to a non-empty value
|
||
8 years ago
|
export COVERAGE="--coverage"
|
||
8 years ago
|
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)
|
||
6 years ago
|
export COVERAGE="--coverage-check"
|
||
8 years ago
|
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"
|
||
8 years ago
|
fi
|
||
8 years ago
|
|
||
7 years ago
|
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
|
||
|
|
||
6 years ago
|
if [[ "${COVERAGE:-}" == "--coverage" ]]; then
|
||
6 years ago
|
timeout=60
|
||
|
else
|
||
5 years ago
|
timeout=50
|
||
6 years ago
|
fi
|
||
|
|
||
|
ansible-test env --dump --show --timeout "${timeout}" --color -v
|
||
6 years ago
|
|
||
2 years ago
|
".azure-pipelines/commands/${script}.sh" "${test}"
|