Move CI coverage stub to sanity/5. (#66827)
This commit is contained in:
parent
cba0feab18
commit
5c1fe78685
1 changed files with 16 additions and 6 deletions
|
@ -73,15 +73,25 @@ find lib/ansible/modules -type d -empty -print -delete
|
||||||
|
|
||||||
function cleanup
|
function cleanup
|
||||||
{
|
{
|
||||||
|
# for complete on-demand coverage generate a report for all files with no coverage on the "sanity/5" job so we only have one copy
|
||||||
|
if [ "${COVERAGE}" == "--coverage" ] && [ "${CHANGED}" == "" ] && [ "${test}" == "sanity/5" ]; then
|
||||||
|
stub="--stub"
|
||||||
|
# trigger coverage reporting for stubs even if no other coverage data exists
|
||||||
|
mkdir -p test/results/coverage/
|
||||||
|
else
|
||||||
|
stub=""
|
||||||
|
fi
|
||||||
|
|
||||||
if [ -d test/results/coverage/ ]; then
|
if [ -d test/results/coverage/ ]; then
|
||||||
if find test/results/coverage/ -mindepth 1 -name '.*' -prune -o -print -quit | grep -q .; then
|
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
|
process_coverage='yes' # process existing coverage files
|
||||||
if [ "${COVERAGE}" == "--coverage" ] && [ "${CHANGED}" == "" ] && [ "${test}" == "sanity/1" ]; then
|
elif [ "${stub}" ]; then
|
||||||
stub="--stub"
|
process_coverage='yes' # process coverage when stubs are enabled
|
||||||
else
|
else
|
||||||
stub=""
|
process_coverage=''
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if [ "${process_coverage}" ]; then
|
||||||
# use python 3.7 for coverage to avoid running out of memory during coverage xml processing
|
# use python 3.7 for coverage to avoid running out of memory during coverage xml processing
|
||||||
# only use it for coverage to avoid the additional overhead of setting up a virtual environment for a potential no-op job
|
# only use it for coverage to avoid the additional overhead of setting up a virtual environment for a potential no-op job
|
||||||
virtualenv --python /usr/bin/python3.7 ~/ansible-venv
|
virtualenv --python /usr/bin/python3.7 ~/ansible-venv
|
||||||
|
|
Loading…
Reference in a new issue