Fix up network testing on Shippable. (#67678)

This prepares for code coverage collection for initial setup of incidental test coverage.
This commit is contained in:
Matt Clay 2020-02-23 18:37:26 -08:00 committed by GitHub
parent dbaa421f9d
commit a64b562071
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
26 changed files with 34 additions and 38 deletions

View file

@ -63,7 +63,8 @@ matrix:
- env: T=windows/2016/7
- env: T=windows/2019/7
- env: T=network
- env: T=ios/csr1000v/1
- env: T=vyos/1.1.8/1
- env: T=aix/7.2/1
- env: T=osx/10.11/1

View file

@ -0,0 +1 @@
shippable/ios/group1

View file

@ -0,0 +1 @@
shippable/ios/group1

View file

@ -0,0 +1 @@
shippable/ios/group1

View file

@ -1 +1 @@
shippable/network
shippable/vyos/group1

View file

@ -1 +1 @@
shippable/network
shippable/vyos/group1

View file

@ -1 +1 @@
shippable/network
shippable/vyos/group1

View file

@ -1 +1 @@
shippable/network
shippable/vyos/group1

View file

@ -0,0 +1 @@
shippable/vyos/group1

View file

@ -1 +1 @@
shippable/network
shippable/vyos/group1

View file

@ -0,0 +1 @@
shippable/vyos/group1

View file

@ -0,0 +1 @@
shippable/vyos/group1

View file

@ -0,0 +1 @@
shippable/vyos/group1

View file

@ -0,0 +1 @@
shippable/vyos/group1

View file

@ -1 +1 @@
shippable/network
shippable/vyos/group1

View file

@ -0,0 +1 @@
shippable/vyos/group1

View file

@ -0,0 +1 @@
shippable/vyos/group1

View file

@ -1,2 +1,2 @@
ios/csr1000v connection=local
ios/csr1000v connection=network_cli
vyos/1.1.8 connection=local

1
test/utils/shippable/ios.sh Symbolic link
View file

@ -0,0 +1 @@
network.sh

View file

@ -2,17 +2,18 @@
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
platform="${args[0]}"
version="${args[1]}"
if [ "${#args[@]}" -gt 2 ]; then
target="shippable/${platform}/group${args[2]}/"
else
target="shippable/${platform}/"
fi
target="shippable/network/"
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

View file

@ -0,0 +1 @@
network.sh