Debian Codegraph @

.azure-pipelines/commands/incidental/windows.sh

raw symbols SCIP
1 #!/usr/bin/env bash
2
3 set -o pipefail -eux
4
5 declare -a args
6 IFS='/:' read -ra args <<< "$1"
7
8 version="${args[1]}"
9 connection="${args[2]}"
10 connection_setting="${args[3]}"
11
12 target="shippable/windows/incidental/"
13
14 stage="${S:-prod}"
15 provider="${P:-default}"
16
17 # python version to run full tests on while other versions run minimal tests
18 python_default="$(PYTHONPATH="${PWD}/test/lib" python -c 'from ansible_test._internal import constants; print(constants.CONTROLLER_MIN_PYTHON_VERSION)')"
19
20 # version to test when only testing a single version
21 single_version=2022
22
23 # shellcheck disable=SC2086
24 ansible-test windows-integration --list-targets -v ${CHANGED:+"$CHANGED"} ${UNSTABLE:+"$UNSTABLE"} > /tmp/explain.txt 2>&1 || { cat /tmp/explain.txt && false; }
25 { grep ' windows-integration: .* (targeted)$' /tmp/explain.txt || true; } > /tmp/windows.txt
26
27 if [ -s /tmp/windows.txt ] || [ "${CHANGED:+$CHANGED}" == "" ]; then
28 echo "Detected changes requiring integration tests specific to Windows:"
29 cat /tmp/windows.txt
30
31 echo "Running Windows integration tests for the version ${version}."
32 else
33 echo "No changes requiring integration tests specific to Windows were detected."
34 echo "Running Windows integration tests for a single version only: ${single_version}"
35
36 if [ "${version}" != "${single_version}" ]; then
37 echo "Skipping this job since it is for: ${version}"
38 exit 0
39 fi
40 fi
41
42 # shellcheck disable=SC2086
43 ansible-test windows-integration --color -v --retry-on-error "${target}" ${COVERAGE:+"$COVERAGE"} ${CHANGED:+"$CHANGED"} ${UNSTABLE:+"$UNSTABLE"} \
44 --controller "docker:default,python=${python_default}" \
45 --target "remote:windows/${version},connection=${connection}+${connection_setting},provider=${provider}" \
46 --remote-terminate always --remote-stage "${stage}"