2016-11-30 05:21:53 +00:00
|
|
|
#!/bin/bash -eux
|
|
|
|
|
|
|
|
set -o pipefail
|
|
|
|
|
2017-05-18 17:37:53 +00:00
|
|
|
# python versions to test in order
|
|
|
|
# python 2.7 runs full tests while other versions run minimal tests
|
|
|
|
python_versions=(
|
|
|
|
2.6
|
|
|
|
3.5
|
|
|
|
3.6
|
|
|
|
2.7
|
|
|
|
)
|
|
|
|
|
2017-05-14 07:04:52 +00:00
|
|
|
# shellcheck disable=SC2086
|
|
|
|
ansible-test windows-integration --explain ${CHANGED:+"$CHANGED"} 2>&1 | { grep ' windows-integration: .* (targeted)$' || true; } > /tmp/windows.txt
|
2016-11-30 05:21:53 +00:00
|
|
|
|
|
|
|
if [ -s /tmp/windows.txt ]; then
|
|
|
|
echo "Detected changes requiring integration tests specific to Windows:"
|
|
|
|
cat /tmp/windows.txt
|
|
|
|
|
|
|
|
echo "Running Windows integration tests for multiple versions concurrently."
|
|
|
|
|
2017-05-18 17:37:53 +00:00
|
|
|
platforms=(
|
|
|
|
--windows 2008-SP2
|
|
|
|
--windows 2008-R2_SP1
|
|
|
|
--windows 2012-RTM
|
|
|
|
--windows 2012-R2_RTM
|
|
|
|
)
|
2016-11-30 05:21:53 +00:00
|
|
|
else
|
|
|
|
echo "No changes requiring integration tests specific to Windows were detected."
|
|
|
|
echo "Running Windows integration tests for a single version only."
|
|
|
|
|
2017-05-18 17:37:53 +00:00
|
|
|
platforms=(
|
2016-11-30 05:21:53 +00:00
|
|
|
--windows 2012-R2_RTM
|
2017-05-18 17:37:53 +00:00
|
|
|
)
|
2016-11-30 05:21:53 +00:00
|
|
|
fi
|
2017-05-18 17:37:53 +00:00
|
|
|
|
|
|
|
retry.py pip install tox --disable-pip-version-check
|
|
|
|
|
|
|
|
for version in "${python_versions[@]}"; do
|
|
|
|
# clean up between test runs until we switch from --tox to --docker
|
|
|
|
rm -rf ~/.ansible/{cp,pc,tmp}/
|
|
|
|
|
2017-07-14 23:51:32 +00:00
|
|
|
changed_all_target="all"
|
|
|
|
|
|
|
|
if [ "${version}" == "2.7" ]; then
|
|
|
|
# smoketest tests for python 2.7
|
|
|
|
if [ "${CHANGED}" ]; then
|
|
|
|
# with change detection enabled run tests for anything changed
|
|
|
|
# use the smoketest tests for any change that triggers all tests
|
|
|
|
ci="windows/ci/"
|
|
|
|
changed_all_target="windows/ci/smoketest/"
|
2017-05-18 17:37:53 +00:00
|
|
|
else
|
2017-07-14 23:51:32 +00:00
|
|
|
# without change detection enabled run only smoketest tests
|
|
|
|
ci="windows/ci/smoketest/"
|
2017-05-18 17:37:53 +00:00
|
|
|
fi
|
2017-07-14 23:51:32 +00:00
|
|
|
else
|
|
|
|
# minimal tests for other python versions
|
|
|
|
ci="windows/ci/minimal/"
|
2017-05-18 17:37:53 +00:00
|
|
|
fi
|
2017-07-14 23:51:32 +00:00
|
|
|
|
|
|
|
# shellcheck disable=SC2086
|
|
|
|
ansible-test windows-integration --color -v --retry-on-error "${ci}" --tox --python "${version}" ${COVERAGE:+"$COVERAGE"} ${CHANGED:+"$CHANGED"} \
|
|
|
|
"${platforms[@]}" --changed-all-target "${changed_all_target}"
|
2017-05-18 17:37:53 +00:00
|
|
|
done
|