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,15 +245,18 @@ 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)
session.run( try:
*test_cmd, session.run(
env={ *test_cmd,
'PYTHONPATH': python_path_env_var, env={
'COVERAGE_PROCESS_START': os.path.join(REPO_ROOT, '.coveragerc') 'PYTHONPATH': python_path_env_var,
} 'COVERAGE_PROCESS_START': os.path.join(REPO_ROOT, '.coveragerc')
) }
session.run('coverage', 'combine') )
session.run('coverage', 'xml', '-o', os.path.join(REPO_ROOT, 'artifacts', 'coverage', 'coverage.xml')) finally:
# Always combine and generate the XML coverage report
session.run('coverage', 'combine')
session.run('coverage', 'xml', '-o', os.path.join(REPO_ROOT, 'artifacts', 'coverage', 'coverage.xml'))
def _runtests(session, coverage, cmd_args): def _runtests(session, coverage, cmd_args):