mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Use the VM slug as the code coverage default context
Signed-off-by: Pedro Algarvio <palgarvio@vmware.com>
This commit is contained in:
parent
0441daca90
commit
5ed925ea5e
2 changed files with 6 additions and 0 deletions
|
@ -1053,12 +1053,16 @@ def _pytest(session, coverage, cmd_args, env=None):
|
|||
return
|
||||
|
||||
if coverage is True:
|
||||
_coverage_cmd_args = []
|
||||
if "COVERAGE_CONTEXT" in os.environ:
|
||||
_coverage_cmd_args.append(f"--context={os.environ['COVERAGE_CONTEXT']}")
|
||||
_run_with_coverage(
|
||||
session,
|
||||
"python",
|
||||
"-m",
|
||||
"coverage",
|
||||
"run",
|
||||
*_coverage_cmd_args,
|
||||
"-m",
|
||||
"pytest",
|
||||
*args,
|
||||
|
@ -1361,6 +1365,7 @@ def create_html_coverage_report(session):
|
|||
"-d",
|
||||
str(COVERAGE_OUTPUT_DIR.joinpath("html").relative_to(REPO_ROOT)),
|
||||
"--include=salt/*,tests/*",
|
||||
"--show-contexts",
|
||||
env=env,
|
||||
)
|
||||
|
||||
|
|
|
@ -311,6 +311,7 @@ def test(
|
|||
"PRINT_TEST_PLAN_ONLY": "0",
|
||||
"SKIP_INITIAL_ONEDIR_FAILURES": "1",
|
||||
"SKIP_INITIAL_GH_ACTIONS_FAILURES": "1",
|
||||
"COVERAGE_CONTEXT": name,
|
||||
}
|
||||
if "LANG" in os.environ:
|
||||
env["LANG"] = os.environ["LANG"]
|
||||
|
|
Loading…
Add table
Reference in a new issue