From 4e571248a906bd461a547ab50e64573a644834b6 Mon Sep 17 00:00:00 2001 From: Matt Clay Date: Mon, 24 Feb 2020 17:31:14 -0800 Subject: First batch of incidental integration tests. (#67717) * Initial copy of incidental network tests. * Update incidental test aliases. * Add incidental tests to CI. * Rewrite module references in tests. This should not be necessary once module redirection is supported. * Rewrite target references for renamed targets. * Add support collections for incidental tests. * Add ignores for test support code. * Remove echo used for debugging. --- test/utils/shippable/i.sh | 14 +++++++++ test/utils/shippable/incidental/ios.sh | 1 + test/utils/shippable/incidental/network.sh | 46 ++++++++++++++++++++++++++++++ test/utils/shippable/incidental/vyos.sh | 1 + 4 files changed, 62 insertions(+) create mode 100755 test/utils/shippable/i.sh create mode 120000 test/utils/shippable/incidental/ios.sh create mode 100755 test/utils/shippable/incidental/network.sh create mode 120000 test/utils/shippable/incidental/vyos.sh (limited to 'test/utils/shippable') diff --git a/test/utils/shippable/i.sh b/test/utils/shippable/i.sh new file mode 100755 index 0000000000..efa2866d2e --- /dev/null +++ b/test/utils/shippable/i.sh @@ -0,0 +1,14 @@ +#!/usr/bin/env bash +# Temporary script to support side-by-side testing for incidental code coverage. +# Once collection migration has been completed the incidental tests can be combined with the regular tests. + +set -o pipefail -eux + +declare -a args +IFS='/:' read -ra args <<< "$1" + +script="${args[1]}" + +IFS='/' test="${args[*]:1}" + +"test/utils/shippable/incidental/${script}.sh" "${test}" diff --git a/test/utils/shippable/incidental/ios.sh b/test/utils/shippable/incidental/ios.sh new file mode 120000 index 0000000000..cad3e41b70 --- /dev/null +++ b/test/utils/shippable/incidental/ios.sh @@ -0,0 +1 @@ +network.sh \ No newline at end of file diff --git a/test/utils/shippable/incidental/network.sh b/test/utils/shippable/incidental/network.sh new file mode 100755 index 0000000000..f46c5013f6 --- /dev/null +++ b/test/utils/shippable/incidental/network.sh @@ -0,0 +1,46 @@ +#!/usr/bin/env bash + +set -o pipefail -eux + +declare -a args +IFS='/:' read -ra args <<< "$1" + +platform="${args[0]}" +version="${args[1]}" +python_version="${args[2]}" + +target="shippable/${platform}/incidental/" + +stage="${S:-prod}" +provider="${P:-default}" + +# python versions to test in order +# all versions run full tests +python_versions=( + 2.7 + 3.6 +) + +if [ "${python_version}" ]; then + # limit tests to a single python version + python_versions=("${python_version}") +fi + +for python_version in "${python_versions[@]}"; do + # terminate remote instances on the final python version tested + if [ "${python_version}" = "${python_versions[-1]}" ]; then + terminate="always" + else + terminate="never" + fi + + # shellcheck disable=SC2086 + ansible-test network-integration --color -v --retry-on-error "${target}" ${COVERAGE:+"$COVERAGE"} ${CHANGED:+"$CHANGED"} ${UNSTABLE:+"$UNSTABLE"} \ + --platform "${platform}/${version}" \ + --platform-connection "${platform}=ansible.netcommon.network_cli" \ + --platform-collection "vyos=vyos.vyos" \ + --platform-collection "ios=cisco.ios" \ + --enable-test-support \ + --docker default --python "${python_version}" \ + --remote-terminate "${terminate}" --remote-stage "${stage}" --remote-provider "${provider}" +done diff --git a/test/utils/shippable/incidental/vyos.sh b/test/utils/shippable/incidental/vyos.sh new file mode 120000 index 0000000000..cad3e41b70 --- /dev/null +++ b/test/utils/shippable/incidental/vyos.sh @@ -0,0 +1 @@ +network.sh \ No newline at end of file -- cgit v1.2.1