Always combine and generate the XML coverage report

This commit is contained in:
Pedro Algarvio 2019-04-20 11:53:27 +01:00
parent 666ca9f7cd
commit e52ab8762b
No known key found for this signature in database
GPG Key ID: BB36BF6584A298FF

View File

@ -245,6 +245,7 @@ def _run_with_coverage(session, *test_cmd):
python_path_env_var = SITECUSTOMIZE_DIR python_path_env_var = SITECUSTOMIZE_DIR
else: else:
python_path_env_var = '{}:{}'.format(SITECUSTOMIZE_DIR, python_path_env_var) python_path_env_var = '{}:{}'.format(SITECUSTOMIZE_DIR, python_path_env_var)
try:
session.run( session.run(
*test_cmd, *test_cmd,
env={ env={
@ -252,6 +253,8 @@ def _run_with_coverage(session, *test_cmd):
'COVERAGE_PROCESS_START': os.path.join(REPO_ROOT, '.coveragerc') 'COVERAGE_PROCESS_START': os.path.join(REPO_ROOT, '.coveragerc')
} }
) )
finally:
# Always combine and generate the XML coverage report
session.run('coverage', 'combine') session.run('coverage', 'combine')
session.run('coverage', 'xml', '-o', os.path.join(REPO_ROOT, 'artifacts', 'coverage', 'coverage.xml')) session.run('coverage', 'xml', '-o', os.path.join(REPO_ROOT, 'artifacts', 'coverage', 'coverage.xml'))