Add support for ansible-test --coverage-check. (#53573)

This commit is contained in:
Matt Clay
2019-03-11 15:13:09 -07:00
committed by GitHub
parent 9ff25c0167
commit 887ab35656
8 changed files with 49 additions and 13 deletions

View File

@@ -6,7 +6,7 @@ set -o pipefail -eux
ansible-test network-integration --explain ${CHANGED:+"$CHANGED"} ${UNSTABLE:+"$UNSTABLE"} 2>&1 \
| { grep ' network-integration: .* (targeted)$' || true; } > /tmp/network.txt
if [ "${COVERAGE}" ]; then
if [ "${COVERAGE}" == "--coverage" ]; then
# when on-demand coverage is enabled, force tests to run for all network platforms
echo "coverage" > /tmp/network.txt
fi

View File

@@ -46,7 +46,7 @@ elif [[ "${COMMIT_MESSAGE}" =~ ci_coverage ]]; then
export COVERAGE="--coverage"
else
# on-demand coverage reporting disabled (default behavior, always-on coverage reporting remains enabled)
export COVERAGE=""
export COVERAGE="--coverage-check"
fi
if [ -n "${COMPLETE:-}" ]; then
@@ -75,7 +75,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}" == "sanity/1" ]; then
if [ "${COVERAGE}" == "--coverage" ] && [ "${CHANGED}" == "" ] && [ "${test}" == "sanity/1" ]; then
stub="--stub"
else
stub=""
@@ -86,7 +86,7 @@ function cleanup
cp -a test/results/reports/coverage=*.xml shippable/codecoverage/
# upload coverage report to codecov.io only when using complete on-demand coverage
if [ "${COVERAGE}" ] && [ "${CHANGED}" == "" ]; then
if [ "${COVERAGE}" == "--coverage" ] && [ "${CHANGED}" == "" ]; then
for file in test/results/reports/coverage=*.xml; do
flags="${file##*/coverage=}"
flags="${flags%.xml}"
@@ -116,7 +116,7 @@ function cleanup
trap cleanup EXIT
if [[ "${COVERAGE:-}" ]]; then
if [[ "${COVERAGE:-}" == "--coverage" ]]; then
timeout=60
else
timeout=45

View File

@@ -7,7 +7,7 @@ IFS='/:' read -ra args <<< "$1"
version="${args[1]}"
if [[ "${COVERAGE:-}" ]]; then
if [[ "${COVERAGE:-}" == "--coverage" ]]; then
timeout=90
else
timeout=10