shippable/units.sh from a/a:devel

This commit is contained in:
John Barker 2020-03-10 10:48:46 +00:00
parent 43b2291283
commit 90644705d0

View file

@ -9,22 +9,48 @@ version="${args[1]}"
group="${args[2]}" group="${args[2]}"
if [[ "${COVERAGE:-}" == "--coverage" ]]; then if [[ "${COVERAGE:-}" == "--coverage" ]]; then
timeout=60 timeout=90
else else
timeout=15 timeout=30
fi fi
group1=() group1=()
group2=() group2=()
group3=()
# create two groups by putting long running network tests into one group # create three groups by putting network tests into separate groups
# add or remove more network platforms as needed to balance the two groups # add or remove network platforms as needed to balance the groups
networks=( networks2=(
aireos
apconos
aruba
asa
avi
check_point
cloudengine
cloudvision
cnos
cumulus
dellos10
dellos6
dellos9
edgeos
edgeswitch
enos
eos
eric_eccli
exos
f5 f5
fortimanager fortimanager
fortios frr
ftd
icx
ingate
ios ios
iosxr
ironware
itential
junos junos
netact netact
netscaler netscaler
@ -43,8 +69,12 @@ networks=(
vyos vyos
) )
for network in "${networks[@]}"; do networks3=(
test_path="tests/unit/modules/network/${network}/" fortios
)
for network in "${networks2[@]}"; do
test_path="test/units/modules/network/${network}/"
if [ -d "${test_path}" ]; then if [ -d "${test_path}" ]; then
group1+=(--exclude "${test_path}") group1+=(--exclude "${test_path}")
@ -52,13 +82,23 @@ for network in "${networks[@]}"; do
fi fi
done done
for network in "${networks3[@]}"; do
test_path="test/units/modules/network/${network}/"
if [ -d "${test_path}" ]; then
group1+=(--exclude "${test_path}")
group3+=("${test_path}")
fi
done
case "${group}" in case "${group}" in
1) options=("${group1[@]:+${group1[@]}}") ;; 1) options=("${group1[@]:+${group1[@]}}") ;;
2) options=("${group2[@]:+${group2[@]}}") ;; 2) options=("${group2[@]:+${group2[@]}}") ;;
3) options=("${group3[@]:+${group3[@]}}") ;;
esac esac
if [ ${#options[@]} -eq 0 ] && [ "${group}" -eq 2 ]; then if [ ${#options[@]} -eq 0 ] && [ "${group}" -gt 1 ]; then
# allow collection migration unit tests for group 2 to "pass" without updating shippable.yml or this script during migration # allow collection migration unit tests for groups other than 1 to "pass" without updating shippable.yml or this script during migration
echo "No unit tests found for group ${group}." echo "No unit tests found for group ${group}."
exit exit
fi fi