mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-22 12:50:22 -07:00
Convert ansible-test compile into a sanity test.
This commit is contained in:
parent
0ce8d389a4
commit
7abdab6c9e
13 changed files with 166 additions and 198 deletions
|
@ -1,24 +0,0 @@
|
|||
#!/bin/bash -eux
|
||||
|
||||
set -o pipefail
|
||||
|
||||
shippable.py
|
||||
|
||||
echo '{"verified": false, "results": []}' > test/results/bot/ansible-test-failure.json
|
||||
|
||||
if [ "${BASE_BRANCH:-}" ]; then
|
||||
base_branch="origin/${BASE_BRANCH}"
|
||||
else
|
||||
base_branch=""
|
||||
fi
|
||||
# shellcheck disable=SC2086
|
||||
ansible-test compile --failure-ok --color -v --junit ${COVERAGE:+"$COVERAGE"} ${CHANGED:+"$CHANGED"} --docker default
|
||||
# shellcheck disable=SC2086
|
||||
ansible-test sanity --failure-ok --color -v --junit ${COVERAGE:+"$COVERAGE"} ${CHANGED:+"$CHANGED"} --docker default --docker-keep-git --base-branch "${base_branch}"
|
||||
|
||||
rm test/results/bot/ansible-test-failure.json
|
||||
|
||||
if find test/results/bot/ -mindepth 1 -name '.*' -prune -o -print -quit | grep -q .; then
|
||||
echo "One or more of the above tests reported at least one failure."
|
||||
exit 1
|
||||
fi
|
26
test/utils/shippable/sanity.sh
Executable file
26
test/utils/shippable/sanity.sh
Executable file
|
@ -0,0 +1,26 @@
|
|||
#!/bin/bash -eux
|
||||
|
||||
set -o pipefail
|
||||
|
||||
declare -a args
|
||||
IFS='/:' read -ra args <<< "$1"
|
||||
|
||||
group="${args[1]}"
|
||||
|
||||
shippable.py
|
||||
|
||||
if [ "${BASE_BRANCH:-}" ]; then
|
||||
base_branch="origin/${BASE_BRANCH}"
|
||||
else
|
||||
base_branch=""
|
||||
fi
|
||||
|
||||
case "${group}" in
|
||||
1) options=(--skip-test pylint) ;;
|
||||
2) options=(--test pylint) ;;
|
||||
esac
|
||||
|
||||
# shellcheck disable=SC2086
|
||||
ansible-test sanity --color -v --junit ${COVERAGE:+"$COVERAGE"} ${CHANGED:+"$CHANGED"} \
|
||||
--docker --docker-keep-git --base-branch "${base_branch}" \
|
||||
"${options[@]}"
|
Loading…
Add table
Add a link
Reference in a new issue