diff options
author | Matt Clay <mclay@redhat.com> | 2020-02-28 01:05:47 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-02-28 01:05:47 +0100 |
commit | f735fd672a783638b8187e61569386ef27410ff7 (patch) | |
tree | dcc4c0d7ce029a970fdce2a0143f05587b033ae6 /test/utils | |
parent | sqs_queue - Move to boto3 and add support for various extra features (#66795) (diff) | |
download | ansible-f735fd672a783638b8187e61569386ef27410ff7.tar.xz ansible-f735fd672a783638b8187e61569386ef27410ff7.zip |
Third batch of incidental integration tests. (#67830)
* Copy in incidental windows tests.
* Update incidental test aliases.
* Add support plugins.
* Update target references.
* Update sanity ignores.
* Update integration-aliases test.
* Add to CI.
Diffstat (limited to 'test/utils')
-rwxr-xr-x | test/utils/shippable/incidental/windows.sh | 77 |
1 files changed, 77 insertions, 0 deletions
diff --git a/test/utils/shippable/incidental/windows.sh b/test/utils/shippable/incidental/windows.sh new file mode 100755 index 0000000000..f84d7c3ba3 --- /dev/null +++ b/test/utils/shippable/incidental/windows.sh @@ -0,0 +1,77 @@ +#!/usr/bin/env bash + +set -o pipefail -eux + +declare -a args +IFS='/:' read -ra args <<< "$1" + +version="${args[1]}" + +target="shippable/windows/incidental/" + +stage="${S:-prod}" +provider="${P:-default}" + +# python versions to test in order +# python 2.7 runs full tests while other versions run minimal tests +python_versions=( + 3.5 + 3.6 + 3.7 + 3.8 + 2.7 +) + +# version to test when only testing a single version +single_version=2012-R2 + +# shellcheck disable=SC2086 +ansible-test windows-integration --explain ${CHANGED:+"$CHANGED"} ${UNSTABLE:+"$UNSTABLE"} > /tmp/explain.txt 2>&1 || { cat /tmp/explain.txt && false; } +{ grep ' windows-integration: .* (targeted)$' /tmp/explain.txt || true; } > /tmp/windows.txt + +if [ -s /tmp/windows.txt ] || [ "${CHANGED:+$CHANGED}" == "" ]; then + echo "Detected changes requiring integration tests specific to Windows:" + cat /tmp/windows.txt + + echo "Running Windows integration tests for multiple versions concurrently." + + platforms=( + --windows "${version}" + ) +else + echo "No changes requiring integration tests specific to Windows were detected." + echo "Running Windows integration tests for a single version only: ${single_version}" + + if [ "${version}" != "${single_version}" ]; then + echo "Skipping this job since it is for: ${version}" + exit 0 + fi + + platforms=( + --windows "${version}" + ) +fi + +for version in "${python_versions[@]}"; do + if [ "${version}" == "2.7" ]; then + # full tests for python 2.7 + ci="${target}" + else + # minimal tests for other python versions + ci="incidental_win_ping" + fi + + # terminate remote instances on the final python version tested + if [ "${version}" = "${python_versions[-1]}" ]; then + terminate="always" + else + terminate="never" + fi + + # shellcheck disable=SC2086 + ansible-test windows-integration --color -v --retry-on-error "${ci}" ${COVERAGE:+"$COVERAGE"} ${CHANGED:+"$CHANGED"} ${UNSTABLE:+"$UNSTABLE"} \ + "${platforms[@]}" \ + --docker default --python "${version}" \ + --enable-test-support \ + --remote-terminate "${terminate}" --remote-stage "${stage}" --remote-provider "${provider}" +done |