mirror of
https://github.com/saltstack/salt.git
synced 2025-04-16 09:40:20 +00:00
Include COVERAGE_FILE
as an env variable.
This will tell coverage where to save all coverage files.
This commit is contained in:
parent
0af561ef24
commit
8948b690b1
2 changed files with 7 additions and 0 deletions
|
@ -253,7 +253,12 @@ def _run_with_coverage(session, *test_cmd):
|
|||
session.run(
|
||||
*test_cmd,
|
||||
env={
|
||||
# The updated python path so that sitecustomize is importable
|
||||
'PYTHONPATH': python_path_env_var,
|
||||
# The full path to the .coverage data file. Makes sure we always write
|
||||
# them to the same directory
|
||||
'COVERAGE_FILE': os.path.abspath(os.path.join(REPO_ROOT, '.coverage')),
|
||||
# Instruct sub processes to also run under coverage
|
||||
'COVERAGE_PROCESS_START': os.path.join(REPO_ROOT, '.coveragerc')
|
||||
}
|
||||
)
|
||||
|
|
|
@ -103,6 +103,7 @@ SCRIPT_TEMPLATES = {
|
|||
'coverage': textwrap.dedent(
|
||||
'''
|
||||
SITECUSTOMIZE_DIR = os.path.join(CODE_DIR, 'tests', 'support', 'coverage')
|
||||
COVERAGE_FILE = os.path.join(CODE_DIR, '.coverage')
|
||||
COVERAGE_PROCESS_START = os.path.join(CODE_DIR, '.coveragerc')
|
||||
PYTHONPATH = os.environ.get('PYTHONPATH') or None
|
||||
if PYTHONPATH is None:
|
||||
|
@ -114,6 +115,7 @@ SCRIPT_TEMPLATES = {
|
|||
PYTHON_PATH_ENTRIES.insert(0, SITECUSTOMIZE_DIR)
|
||||
PYTHONPATH_ENV_VAR = os.pathsep.join(PYTHON_PATH_ENTRIES)
|
||||
os.environ['PYTHONPATH'] = PYTHONPATH_ENV_VAR
|
||||
os.environ['COVERAGE_FILE'] = COVERAGE_FILE
|
||||
os.environ['COVERAGE_PROCESS_START'] = COVERAGE_PROCESS_START
|
||||
'''
|
||||
)
|
||||
|
|
Loading…
Add table
Reference in a new issue