From 79685a4a2d670aae0578dfe230533cdbe87ba86c Mon Sep 17 00:00:00 2001 From: Matt Clay Date: Fri, 7 Jun 2019 15:48:17 -0700 Subject: [PATCH] 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. --- test/utils/shippable/shippable.sh | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/test/utils/shippable/shippable.sh b/test/utils/shippable/shippable.sh index 90e0d5f9089..3571d3de4a4 100755 --- a/test/utils/shippable/shippable.sh +++ b/test/utils/shippable/shippable.sh @@ -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/