summaryrefslogtreecommitdiffstats
path: root/test/utils
diff options
context:
space:
mode:
authorMatt Clay <mclay@redhat.com>2020-02-24 03:37:26 +0100
committerGitHub <noreply@github.com>2020-02-24 03:37:26 +0100
commita64b56207148650819cf6d3b3eb98816b4cae84e (patch)
tree26ca5aec154e7fcead370f00b676969a304f266d /test/utils
parentSome cloudengine modules miss "import __future__" and "mateclass", update to ... (diff)
downloadansible-a64b56207148650819cf6d3b3eb98816b4cae84e.tar.xz
ansible-a64b56207148650819cf6d3b3eb98816b4cae84e.zip
Fix up network testing on Shippable. (#67678)
This prepares for code coverage collection for initial setup of incidental test coverage.
Diffstat (limited to 'test/utils')
l---------test/utils/shippable/ios.sh1
-rwxr-xr-xtest/utils/shippable/network.sh43
l---------test/utils/shippable/vyos.sh1
3 files changed, 15 insertions, 30 deletions
diff --git a/test/utils/shippable/ios.sh b/test/utils/shippable/ios.sh
new file mode 120000
index 0000000000..cad3e41b70
--- /dev/null
+++ b/test/utils/shippable/ios.sh
@@ -0,0 +1 @@
+network.sh \ No newline at end of file
diff --git a/test/utils/shippable/network.sh b/test/utils/shippable/network.sh
index a232ef7f6a..43dddd5866 100755
--- a/test/utils/shippable/network.sh
+++ b/test/utils/shippable/network.sh
@@ -2,16 +2,17 @@
set -o pipefail -eux
-# shellcheck disable=SC2086
-ansible-test network-integration --explain ${CHANGED:+"$CHANGED"} ${UNSTABLE:+"$UNSTABLE"} > /tmp/explain.txt 2>&1 || { cat /tmp/explain.txt && false; }
-{ grep ' network-integration: .* (targeted)$' /tmp/explain.txt || true; } > /tmp/network.txt
+declare -a args
+IFS='/:' read -ra args <<< "$1"
-if [ "${COVERAGE}" == "--coverage" ]; then
- # when on-demand coverage is enabled, force tests to run for all network platforms
- echo "coverage" > /tmp/network.txt
-fi
+platform="${args[0]}"
+version="${args[1]}"
-target="shippable/network/"
+if [ "${#args[@]}" -gt 2 ]; then
+ target="shippable/${platform}/group${args[2]}/"
+else
+ target="shippable/${platform}/"
+fi
stage="${S:-prod}"
provider="${P:-default}"
@@ -23,27 +24,9 @@ python_versions=(
3.6
)
-if [ -s /tmp/network.txt ]; then
- echo "Detected changes requiring integration tests specific to networking:"
- cat /tmp/network.txt
-
- echo "Running network integration tests for multiple platforms concurrently."
-
- platforms=(
- --platform vyos/1.1.8
- )
-else
- echo "No changes requiring integration tests specific to networking were detected."
- echo "Running network integration tests for a single platform only."
-
- platforms=(
- --platform vyos/1.1.8
- )
-fi
-
-for version in "${python_versions[@]}"; do
+for python_version in "${python_versions[@]}"; do
# terminate remote instances on the final python version tested
- if [ "${version}" = "${python_versions[-1]}" ]; then
+ if [ "${python_version}" = "${python_versions[-1]}" ]; then
terminate="always"
else
terminate="never"
@@ -51,7 +34,7 @@ for version in "${python_versions[@]}"; do
# shellcheck disable=SC2086
ansible-test network-integration --color -v --retry-on-error "${target}" ${COVERAGE:+"$COVERAGE"} ${CHANGED:+"$CHANGED"} ${UNSTABLE:+"$UNSTABLE"} \
- "${platforms[@]}" \
- --docker default --python "${version}" \
+ --platform "${platform}/${version}" \
+ --docker default --python "${python_version}" \
--remote-terminate "${terminate}" --remote-stage "${stage}" --remote-provider "${provider}"
done
diff --git a/test/utils/shippable/vyos.sh b/test/utils/shippable/vyos.sh
new file mode 120000
index 0000000000..cad3e41b70
--- /dev/null
+++ b/test/utils/shippable/vyos.sh
@@ -0,0 +1 @@
+network.sh \ No newline at end of file