2016-11-30 05:21:53 +00:00
|
|
|
#!/bin/bash -eux
|
|
|
|
|
|
|
|
set -o pipefail
|
|
|
|
|
2017-09-05 22:32:26 +00:00
|
|
|
declare -a args
|
2017-10-03 19:43:46 +00:00
|
|
|
IFS='/:' read -ra args <<< "$1"
|
2017-09-05 22:32:26 +00:00
|
|
|
|
|
|
|
target="windows/ci/group${args[1]}/"
|
|
|
|
|
2017-11-29 08:46:08 +00:00
|
|
|
stage="${S:-prod}"
|
|
|
|
provider="${P:-default}"
|
|
|
|
|
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
|
2017-09-05 22:32:26 +00:00
|
|
|
ansible-test windows-integration "${target}" --explain ${CHANGED:+"$CHANGED"} 2>&1 | { grep ' windows-integration: .* (targeted)$' || true; } > /tmp/windows.txt
|
2016-11-30 05:21:53 +00:00
|
|
|
|
2017-09-14 05:21:19 +00:00
|
|
|
if [ -s /tmp/windows.txt ] || [ "${CHANGED:+$CHANGED}" == "" ]; then
|
2016-11-30 05:21:53 +00:00
|
|
|
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
|
2018-01-10 01:22:24 +00:00
|
|
|
--windows 2016-English-Full-Base
|
2017-05-18 17:37:53 +00:00
|
|
|
)
|
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
|
|
|
|
|
|
|
for version in "${python_versions[@]}"; do
|
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
|
2017-09-05 22:32:26 +00:00
|
|
|
ci="${target}"
|
|
|
|
if [ "${target}" == "windows/ci/group1/" ]; then
|
|
|
|
# only run smoketest tests for group1
|
|
|
|
changed_all_target="windows/ci/smoketest/"
|
|
|
|
else
|
|
|
|
# smoketest tests already covered by group1
|
|
|
|
changed_all_target="none"
|
|
|
|
fi
|
2017-05-18 17:37:53 +00:00
|
|
|
else
|
2017-09-14 05:21:19 +00:00
|
|
|
# without change detection enabled run entire test group
|
|
|
|
ci="${target}"
|
2017-05-18 17:37:53 +00:00
|
|
|
fi
|
2017-07-14 23:51:32 +00:00
|
|
|
else
|
2017-09-05 22:32:26 +00:00
|
|
|
# only run minimal tests for group1
|
|
|
|
if [ "${target}" != "windows/ci/group1/" ]; then continue; fi
|
2017-07-14 23:51:32 +00:00
|
|
|
# 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
|
|
|
|
2017-11-15 01:08:48 +00:00
|
|
|
# terminate remote instances on the final python version tested
|
|
|
|
if [ "${version}" = "${python_versions[-1]}" ]; then
|
|
|
|
terminate="always"
|
|
|
|
else
|
|
|
|
terminate="never"
|
|
|
|
fi
|
|
|
|
|
2017-07-14 23:51:32 +00:00
|
|
|
# shellcheck disable=SC2086
|
2017-10-26 07:21:46 +00:00
|
|
|
ansible-test windows-integration --color -v --retry-on-error "${ci}" --docker default --python "${version}" ${COVERAGE:+"$COVERAGE"} ${CHANGED:+"$CHANGED"} \
|
2017-11-29 08:46:08 +00:00
|
|
|
"${platforms[@]}" --changed-all-target "${changed_all_target}" \
|
|
|
|
--remote-terminate "${terminate}" --remote-stage "${stage}" --remote-provider "${provider}"
|
2017-05-18 17:37:53 +00:00
|
|
|
done
|