From 72237b63e740e68113ad7e8bc4647382e4b2df53 Mon Sep 17 00:00:00 2001 From: Matt Clay Date: Tue, 3 Oct 2017 12:43:46 -0700 Subject: [PATCH] Run OS X and FreeBSD CI tests using groups. (#31254) * Run OS X and FreeBSD CI tests using groups. * Improve readability of Shippable jobs. --- shippable.yml | 102 ++++++++++++++++-------------- test/utils/shippable/cloud.sh | 2 +- test/utils/shippable/freebsd.sh | 8 +-- test/utils/shippable/linux.sh | 5 +- test/utils/shippable/osx.sh | 8 +-- test/utils/shippable/rhel.sh | 2 +- test/utils/shippable/shippable.sh | 10 +-- test/utils/shippable/timing.sh | 2 +- test/utils/shippable/units.sh | 2 +- test/utils/shippable/windows.sh | 2 +- 10 files changed, 75 insertions(+), 68 deletions(-) diff --git a/shippable.yml b/shippable.yml index efe6f8eff4..ac6b020e39 100644 --- a/shippable.yml +++ b/shippable.yml @@ -2,67 +2,71 @@ language: python env: matrix: - - TEST=none + - T=none matrix: exclude: - - env: TEST=none + - env: T=none include: - - env: TEST=other + - env: T=other - - env: TEST=units/2.6 - - env: TEST=units/2.7 - - env: TEST=units/3.5 - - env: TEST=units/3.6 + - env: T=units/2.6 + - env: T=units/2.7 + - env: T=units/3.5 + - env: T=units/3.6 - - env: TEST=osx/10.11 + - env: T=rhel/7.4 - - env: TEST=freebsd/10.3-STABLE - - env: TEST=freebsd/11.0-STABLE + - env: T=windows/1 + - env: T=windows/2 + - env: T=windows/3 - - env: TEST=rhel/7.4 + - env: T=network - - env: TEST=windows/1 - - env: TEST=windows/2 - - env: TEST=windows/3 + - env: T=osx/10.11/1 + - env: T=freebsd/10.3-STABLE/1 + - env: T=freebsd/11.0-STABLE/1 + - env: T=linux/centos6/1 + - env: T=linux/centos7/1 + - env: T=linux/fedora24/1 + - env: T=linux/fedora25/1 + - env: T=linux/opensuse42.2/1 + - env: T=linux/opensuse42.3/1 + - env: T=linux/ubuntu1404/1 + - env: T=linux/ubuntu1604/1 + - env: T=linux/ubuntu1604py3/1 - - env: TEST=network + - env: T=osx/10.11/2 + - env: T=freebsd/10.3-STABLE/2 + - env: T=freebsd/11.0-STABLE/2 + - env: T=linux/centos6/2 + - env: T=linux/centos7/2 + - env: T=linux/fedora24/2 + - env: T=linux/fedora25/2 + - env: T=linux/opensuse42.2/2 + - env: T=linux/opensuse42.3/2 + - env: T=linux/ubuntu1404/2 + - env: T=linux/ubuntu1604/2 + - env: T=linux/ubuntu1604py3/2 - - env: TEST=linux/centos6/1 - - env: TEST=linux/centos7/1 - - env: TEST=linux/fedora24/1 - - env: TEST=linux/fedora25/1 - - env: TEST=linux/opensuse42.2/1 - - env: TEST=linux/opensuse42.3/1 - - env: TEST=linux/ubuntu1404/1 - - env: TEST=linux/ubuntu1604/1 - - env: TEST=linux/ubuntu1604py3/1 + - env: T=osx/10.11/3 + - env: T=freebsd/10.3-STABLE/3 + - env: T=freebsd/11.0-STABLE/3 + - env: T=linux/centos6/3 + - env: T=linux/centos7/3 + - env: T=linux/fedora24/3 + - env: T=linux/fedora25/3 + - env: T=linux/opensuse42.2/3 + - env: T=linux/opensuse42.3/3 + - env: T=linux/ubuntu1404/3 + - env: T=linux/ubuntu1604/3 + - env: T=linux/ubuntu1604py3/3 - - env: TEST=linux/centos6/2 - - env: TEST=linux/centos7/2 - - env: TEST=linux/fedora24/2 - - env: TEST=linux/fedora25/2 - - env: TEST=linux/opensuse42.2/2 - - env: TEST=linux/opensuse42.3/2 - - env: TEST=linux/ubuntu1404/2 - - env: TEST=linux/ubuntu1604/2 - - env: TEST=linux/ubuntu1604py3/2 + - env: T=cloud/ubuntu1604/1 + - env: T=cloud/ubuntu1604py3/1 - - env: TEST=linux/centos6/3 - - env: TEST=linux/centos7/3 - - env: TEST=linux/fedora24/3 - - env: TEST=linux/fedora25/3 - - env: TEST=linux/opensuse42.2/3 - - env: TEST=linux/opensuse42.3/3 - - env: TEST=linux/ubuntu1404/3 - - env: TEST=linux/ubuntu1604/3 - - env: TEST=linux/ubuntu1604py3/3 - - - env: TEST=cloud/ubuntu1604/1 - - env: TEST=cloud/ubuntu1604py3/1 - - - env: TEST=cloud/ubuntu1604/2 - - env: TEST=cloud/ubuntu1604py3/2 + - env: T=cloud/ubuntu1604/2 + - env: T=cloud/ubuntu1604py3/2 branches: except: @@ -76,7 +80,7 @@ build: pull: false options: "--privileged=false --net=bridge" ci: - - test/utils/shippable/timing.sh test/utils/shippable/shippable.sh + - test/utils/shippable/timing.sh test/utils/shippable/shippable.sh $T integrations: notifications: diff --git a/test/utils/shippable/cloud.sh b/test/utils/shippable/cloud.sh index 6695d8a816..18e6269466 100755 --- a/test/utils/shippable/cloud.sh +++ b/test/utils/shippable/cloud.sh @@ -3,7 +3,7 @@ set -o pipefail declare -a args -IFS='/:' read -ra args <<< "${TEST}" +IFS='/:' read -ra args <<< "$1" image="ansible/ansible:${args[1]}" target="posix/ci/cloud/group${args[2]}/" diff --git a/test/utils/shippable/freebsd.sh b/test/utils/shippable/freebsd.sh index 1410abeddf..abd1bb2a9f 100755 --- a/test/utils/shippable/freebsd.sh +++ b/test/utils/shippable/freebsd.sh @@ -3,12 +3,12 @@ set -o pipefail declare -a args -IFS='/:' read -ra args <<< "${TEST}" +IFS='/:' read -ra args <<< "$1" platform="${args[0]}" version="${args[1]}" -target="posix/ci/" +target="posix/ci/group${args[2]}/" # shellcheck disable=SC2086 -ansible-test integration --color -v --retry-on-error "${target}" --remote "${platform}/${version}" ${COVERAGE:+"$COVERAGE"} ${CHANGED:+"$CHANGED"} \ - --exclude "posix/ci/cloud/" +ansible-test integration --color -v --retry-on-error "${target}" ${COVERAGE:+"$COVERAGE"} ${CHANGED:+"$CHANGED"} \ + --remote "${platform}/${version}" --remote-terminate always diff --git a/test/utils/shippable/linux.sh b/test/utils/shippable/linux.sh index c42af17941..4acbc1d4b5 100755 --- a/test/utils/shippable/linux.sh +++ b/test/utils/shippable/linux.sh @@ -3,10 +3,11 @@ set -o pipefail declare -a args -IFS='/:' read -ra args <<< "${TEST}" +IFS='/:' read -ra args <<< "$1" image="ansible/ansible:${args[1]}" target="posix/ci/group${args[2]}/" # shellcheck disable=SC2086 -ansible-test integration --color -v --retry-on-error "${target}" --docker "${image}" ${COVERAGE:+"$COVERAGE"} ${CHANGED:+"$CHANGED"} \ +ansible-test integration --color -v --retry-on-error "${target}" ${COVERAGE:+"$COVERAGE"} ${CHANGED:+"$CHANGED"} \ + --docker "${image}" diff --git a/test/utils/shippable/osx.sh b/test/utils/shippable/osx.sh index d66112c7f2..abd1bb2a9f 100755 --- a/test/utils/shippable/osx.sh +++ b/test/utils/shippable/osx.sh @@ -3,12 +3,12 @@ set -o pipefail declare -a args -IFS='/:' read -ra args <<< "${TEST}" +IFS='/:' read -ra args <<< "$1" platform="${args[0]}" version="${args[1]}" -target="posix/ci/" +target="posix/ci/group${args[2]}/" # shellcheck disable=SC2086 -ansible-test integration --color -v --retry-on-error "${target}" --remote "${platform}/${version}" ${COVERAGE:+"$COVERAGE"} ${CHANGED:+"$CHANGED"} \ - --exclude "posix/ci/cloud/" --remote-terminate always +ansible-test integration --color -v --retry-on-error "${target}" ${COVERAGE:+"$COVERAGE"} ${CHANGED:+"$CHANGED"} \ + --remote "${platform}/${version}" --remote-terminate always diff --git a/test/utils/shippable/rhel.sh b/test/utils/shippable/rhel.sh index 1410abeddf..a7459d72d1 100755 --- a/test/utils/shippable/rhel.sh +++ b/test/utils/shippable/rhel.sh @@ -3,7 +3,7 @@ set -o pipefail declare -a args -IFS='/:' read -ra args <<< "${TEST}" +IFS='/:' read -ra args <<< "$1" platform="${args[0]}" version="${args[1]}" diff --git a/test/utils/shippable/shippable.sh b/test/utils/shippable/shippable.sh index 92b3700870..8a8de55965 100755 --- a/test/utils/shippable/shippable.sh +++ b/test/utils/shippable/shippable.sh @@ -3,10 +3,12 @@ set -o pipefail declare -a args -IFS='/:' read -ra args <<< "${TEST}" +IFS='/:' read -ra args <<< "$1" script="${args[0]}" +test="$1" + docker images ansible/ansible docker ps @@ -58,7 +60,7 @@ function cleanup { if find test/results/coverage/ -mindepth 1 -name '.*' -prune -o -print -quit | grep -q .; then # for complete on-demand coverage generate a report for all files with no coverage on the "other" job so we only have one copy - if [ "${COVERAGE}" ] && [ "${CHANGED}" == "" ] && [ "${TEST}" == "other" ]; then + if [ "${COVERAGE}" ] && [ "${CHANGED}" == "" ] && [ "${test}" == "other" ]; then stub="--stub" else stub="" @@ -79,7 +81,7 @@ function cleanup bash <(curl -s https://codecov.io/bash) \ -f "${file}" \ -F "${flags}" \ - -n "${TEST}" \ + -n "${test}" \ -t 83cd8957-dc76-488c-9ada-210dcea51633 \ -X coveragepy \ -X gcov \ @@ -98,4 +100,4 @@ function cleanup trap cleanup EXIT -"test/utils/shippable/${script}.sh" +"test/utils/shippable/${script}.sh" "${test}" diff --git a/test/utils/shippable/timing.sh b/test/utils/shippable/timing.sh index bbae07d7b8..9cfdeb395e 100755 --- a/test/utils/shippable/timing.sh +++ b/test/utils/shippable/timing.sh @@ -2,4 +2,4 @@ set -o pipefail -"$1" 2>&1 | gawk '{ print strftime("%Y-%m-%d %H:%M:%S"), $0; fflush(); }' +"$@" 2>&1 | gawk '{ print strftime("%Y-%m-%d %H:%M:%S"), $0; fflush(); }' diff --git a/test/utils/shippable/units.sh b/test/utils/shippable/units.sh index 74332762f9..a099c7a464 100755 --- a/test/utils/shippable/units.sh +++ b/test/utils/shippable/units.sh @@ -3,7 +3,7 @@ set -o pipefail declare -a args -IFS='/:' read -ra args <<< "${TEST}" +IFS='/:' read -ra args <<< "$1" version="${args[1]}" diff --git a/test/utils/shippable/windows.sh b/test/utils/shippable/windows.sh index 5f02f2d78e..c2189c17c4 100755 --- a/test/utils/shippable/windows.sh +++ b/test/utils/shippable/windows.sh @@ -3,7 +3,7 @@ set -o pipefail declare -a args -IFS='/:' read -ra args <<< "${TEST}" +IFS='/:' read -ra args <<< "$1" target="windows/ci/group${args[1]}/"