summaryrefslogtreecommitdiff
path: root/.azure-pipelines/commands/incidental/windows.sh
diff options
context:
space:
mode:
authorMatt Clay <matt@mystile.com>2023-02-28 13:21:11 -0800
committerMatt Clay <matt@mystile.com>2023-03-14 17:47:58 -0700
commit4461de15deed01cf05486027ac1cf250c51e3dd5 (patch)
treeec14143392d3cb363c7e4f06addc3eb6a468aee4 /.azure-pipelines/commands/incidental/windows.sh
parentbea9a2acf72f87661660a0d46c8554777aa02978 (diff)
downloadansible-4461de15deed01cf05486027ac1cf250c51e3dd5.tar.gz
[stable-2.14] Relocate the AZP entry point scripts (#80114)
Scripts previously under `test/utils/shippable/` are now under `.azure-pipelines/commands/` instead. (cherry picked from commit f47bc03599eedc48753d2cd5e1bea177f35e6133) Co-authored-by: Matt Clay <matt@mystile.com>
Diffstat (limited to '.azure-pipelines/commands/incidental/windows.sh')
-rwxr-xr-x.azure-pipelines/commands/incidental/windows.sh52
1 files changed, 52 insertions, 0 deletions
diff --git a/.azure-pipelines/commands/incidental/windows.sh b/.azure-pipelines/commands/incidental/windows.sh
new file mode 100755
index 0000000000..ad77ace726
--- /dev/null
+++ b/.azure-pipelines/commands/incidental/windows.sh
@@ -0,0 +1,52 @@
+#!/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 version to run full tests on while other versions run minimal tests
+python_default="$(PYTHONPATH="${PWD}/test/lib" python -c 'from ansible_test._internal import constants; print(constants.CONTROLLER_MIN_PYTHON_VERSION)')"
+
+# version to test when only testing a single version
+single_version=2012-R2
+
+# shellcheck disable=SC2086
+ansible-test windows-integration --list-targets -v ${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
+
+# shellcheck disable=SC2086
+ansible-test windows-integration --color -v --retry-on-error "${target}" ${COVERAGE:+"$COVERAGE"} ${CHANGED:+"$CHANGED"} ${UNSTABLE:+"$UNSTABLE"} \
+ "${platforms[@]}" \
+ --docker default --python "${python_default}" \
+ --remote-terminate always --remote-stage "${stage}" --remote-provider "${provider}"