mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Set environment variable that skips or tracks code coverage
Signed-off-by: Pedro Algarvio <palgarvio@vmware.com>
This commit is contained in:
parent
37f2fa6d12
commit
a4247b6a1d
2 changed files with 14 additions and 2 deletions
|
@ -1047,8 +1047,7 @@ def _ci_test(session, transport):
|
|||
runtests_log_filename = "runtests"
|
||||
|
||||
rerun_failures = os.environ.get("RERUN_FAILURES", "0") == "1"
|
||||
|
||||
track_code_coverage = os.environ.get("CI_TRACK_COVERAGE", "1") == "1"
|
||||
track_code_coverage = os.environ.get("SKIP_CODE_COVERAGE", "0") == "0"
|
||||
|
||||
common_pytest_args = [
|
||||
"--color=yes",
|
||||
|
|
13
tools/vm.py
13
tools/vm.py
|
@ -184,6 +184,14 @@ def rsync(ctx: Context, name: str):
|
|||
"--print-tests-selection",
|
||||
],
|
||||
},
|
||||
"skip_code_coverage": {
|
||||
"help": "Skip tracking code coverage",
|
||||
"action": "store_true",
|
||||
"flags": [
|
||||
"--scc",
|
||||
"--skip-code-coverage",
|
||||
],
|
||||
},
|
||||
}
|
||||
)
|
||||
def test(
|
||||
|
@ -194,6 +202,7 @@ def test(
|
|||
rerun_failures: bool = False,
|
||||
skip_requirements_install: bool = False,
|
||||
print_tests_selection: bool = False,
|
||||
skip_code_coverage: bool = False,
|
||||
):
|
||||
"""
|
||||
Run test in the VM.
|
||||
|
@ -204,6 +213,10 @@ def test(
|
|||
env["RERUN_FAILURES"] = "1"
|
||||
if print_tests_selection:
|
||||
env["PRINT_TEST_SELECTION"] = "1"
|
||||
if skip_code_coverage:
|
||||
env["SKIP_CODE_COVERAGE"] = "1"
|
||||
else:
|
||||
env["SKIP_CODE_COVERAGE"] = "0"
|
||||
if (
|
||||
skip_requirements_install
|
||||
or os.environ.get("SKIP_REQUIREMENTS_INSTALL", "0") == "1"
|
||||
|
|
Loading…
Add table
Reference in a new issue