1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

Implement on-demand coverage on Shippable. (#24535)

This commit is contained in:
Matt Clay 2017-05-14 01:08:42 +08:00 committed by GitHub
parent eb5e906014
commit 5cb5228cde
8 changed files with 25 additions and 10 deletions

View file

@ -8,4 +8,5 @@ IFS='/:' read -ra args <<< "${TEST}"
image="ansible/ansible:${args[1]}"
target="posix/ci/cloud/"
ansible-test integration --color -v --retry-on-error "${target}" --docker "${image}"
# shellcheck disable=SC2086
ansible-test integration --color -v --retry-on-error "${target}" --docker "${image}" ${COVERAGE:+"$COVERAGE"}

View file

@ -9,4 +9,5 @@ platform="${args[0]}"
version="${args[1]}"
target="posix/ci/"
ansible-test integration --color -v --retry-on-error "${target}" --remote "${platform}/${version}" --exclude "posix/ci/cloud/"
# shellcheck disable=SC2086
ansible-test integration --color -v --retry-on-error "${target}" --remote "${platform}/${version}" --exclude "posix/ci/cloud/" ${COVERAGE:+"$COVERAGE"}

View file

@ -8,4 +8,5 @@ IFS='/:' read -ra args <<< "${TEST}"
image="ansible/ansible:${args[1]}"
target="posix/ci/group${args[2]}/"
ansible-test integration --color -v --retry-on-error "${target}" --docker "${image}"
# shellcheck disable=SC2086
ansible-test integration --color -v --retry-on-error "${target}" --docker "${image}" ${COVERAGE:+"$COVERAGE"}

View file

@ -12,7 +12,8 @@ if [ -s /tmp/network.txt ]; then
echo "Running network integration tests for multiple platforms concurrently."
ansible-test network-integration --color -v --retry-on-error "${target}" --requirements \
# shellcheck disable=SC2086
ansible-test network-integration --color -v --retry-on-error "${target}" --requirements ${COVERAGE:+"$COVERAGE"} \
--platform vyos/1.1.0 \
--platform ios/csr1000v \
@ -20,6 +21,7 @@ else
echo "No changes requiring integration tests specific to networking were detected."
echo "Running network integration tests for a single platform only."
ansible-test network-integration --color -v --retry-on-error "${target}" --requirements \
# shellcheck disable=SC2086
ansible-test network-integration --color -v --retry-on-error "${target}" --requirements ${COVERAGE:+"$COVERAGE"} \
--platform vyos/1.1.0
fi

View file

@ -9,4 +9,6 @@ platform="${args[0]}"
version="${args[1]}"
target="posix/ci/"
ansible-test integration --color -v --retry-on-error "${target}" --remote "${platform}/${version}" --remote-terminate success --exclude "posix/ci/cloud/"
# shellcheck disable=SC2086
ansible-test integration --color -v --retry-on-error "${target}" --remote "${platform}/${version}" --remote-terminate success --exclude "posix/ci/cloud/" \
${COVERAGE:+"$COVERAGE"}

View file

@ -10,8 +10,8 @@ retry.py pip install tox --disable-pip-version-check
echo '{"verified": false, "results": []}' > test/results/bot/ansible-test-failure.json
ansible-test compile --failure-ok --color -v --junit --requirements
ansible-test sanity --failure-ok --color -v --junit --tox --skip-test ansible-doc --python 3.5
ansible-test compile --failure-ok --color -v --junit --requirements --coverage
ansible-test sanity --failure-ok --color -v --junit --tox --skip-test ansible-doc --python 3.5 --coverage
ansible-test sanity --failure-ok --color -v --junit --tox --test ansible-doc --coverage
rm test/results/bot/ansible-test-failure.json

View file

@ -23,6 +23,12 @@ pip list --disable-pip-version-check
export PATH="test/runner:${PATH}"
export PYTHONIOENCODING='utf-8'
export COVERAGE="${COVERAGE:-}"
# run integration coverage if 'ci_coverage' is in the commit message or the COVERAGE var is non-empty
if [[ "${COMMIT_MESSAGE}" =~ ci_coverage ]] || [ -n "${COVERAGE}" ]; then
export COVERAGE="--coverage"
fi
# remove empty core/extras module directories from PRs created prior to the repo-merge
find lib/ansible/modules -type d -empty -print -delete

View file

@ -22,7 +22,8 @@ if [ -s /tmp/windows.txt ]; then
target="windows/ci/"
ansible-test windows-integration --color -v --retry-on-error "${target}" --requirements \
# shellcheck disable=SC2086
ansible-test windows-integration --color -v --retry-on-error "${target}" --requirements ${COVERAGE:+"$COVERAGE"} \
--windows 2008-SP2 \
--windows 2008-R2_SP1 \
--windows 2012-RTM \
@ -34,6 +35,7 @@ else
target="windows/ci/group${job}/"
ansible-test windows-integration --color -v --retry-on-error "${target}" --requirements \
# shellcheck disable=SC2086
ansible-test windows-integration --color -v --retry-on-error "${target}" --requirements ${COVERAGE:+"$COVERAGE"} \
--windows 2012-R2_RTM
fi