Use Python 3.7 to run ansible-test coverage in CI. (#57555)
Generating XML for coverage reports on Python 3.7 uses far less memory than on Python 2.7. This change should avoid the MemoryError we've been seeing in the nightly coverage runs.
This commit is contained in:
parent
b211b24862
commit
79685a4a2d
1 changed files with 7 additions and 0 deletions
|
@ -81,6 +81,13 @@ function cleanup
|
|||
stub=""
|
||||
fi
|
||||
|
||||
# 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
|
||||
virtualenv --python /usr/bin/python3.7 ~/ansible-venv
|
||||
set +ux
|
||||
. ~/ansible-venv/bin/activate
|
||||
set -ux
|
||||
|
||||
# shellcheck disable=SC2086
|
||||
ansible-test coverage xml --color -v --requirements --group-by command --group-by version ${stub:+"$stub"}
|
||||
cp -a test/results/reports/coverage=*.xml shippable/codecoverage/
|
||||
|
|
Loading…
Reference in a new issue