From 80561ccef0759682cf5bcd810d76fccbb508dfdc Mon Sep 17 00:00:00 2001 From: Matt Clay Date: Fri, 7 Feb 2020 12:31:22 -0800 Subject: [PATCH] Improve sanity test handling in CI after migration. --- test/utils/shippable/sanity.sh | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/test/utils/shippable/sanity.sh b/test/utils/shippable/sanity.sh index d44970be955..72cd83abeaa 100755 --- a/test/utils/shippable/sanity.sh +++ b/test/utils/shippable/sanity.sh @@ -16,11 +16,22 @@ fi case "${group}" in 1) options=(--skip-test pylint --skip-test ansible-doc --skip-test docs-build --skip-test package-data --skip-test validate-modules) ;; 2) options=( --test ansible-doc --test docs-build --test package-data) ;; - 3) options=(--test pylint --exclude test/units/ --exclude lib/ansible/module_utils/ --exclude lib/ansible/modules/network/) ;; - 4) options=(--test pylint test/units/ lib/ansible/module_utils/ lib/ansible/modules/network/) ;; + 3) options=(--test pylint --exclude test/units/ --exclude lib/ansible/module_utils/) ;; + 4) options=(--test pylint test/units/ lib/ansible/module_utils/) ;; 5) options=( --test validate-modules) ;; esac +# allow collection migration sanity tests for groups 3 and 4 to pass without updating this script during migration +network_path="lib/ansible/modules/network/" + +if [ -d "${network_path}" ]; then + if [ "${group}" -eq 3 ]; then + options+=(--exclude "${network_path}") + elif [ "${group}" -eq 4 ]; then + options+=("${network_path}") + fi +fi + # shellcheck disable=SC2086 ansible-test sanity --color -v --junit ${COVERAGE:+"$COVERAGE"} ${CHANGED:+"$CHANGED"} \ --docker --docker-keep-git --base-branch "${base_branch}" \