mirror of
https://github.com/saltstack/salt.git
synced 2025-04-16 09:40:20 +00:00
On VMs, use Salt's onedir to combine code coverage
And newer Python versions where we don't want to download the onedir Signed-off-by: Pedro Algarvio <palgarvio@vmware.com>
This commit is contained in:
parent
7f2d7c342f
commit
d53eff39fd
4 changed files with 25 additions and 3 deletions
2
.github/workflows/test-action-macos.yml
vendored
2
.github/workflows/test-action-macos.yml
vendored
|
@ -20,7 +20,7 @@ on:
|
|||
required: false
|
||||
type: string
|
||||
description: The python version to run tests with
|
||||
default: "3.9"
|
||||
default: "3.11"
|
||||
salt-version:
|
||||
type: string
|
||||
required: true
|
||||
|
|
|
@ -43,7 +43,7 @@ on:
|
|||
required: false
|
||||
type: string
|
||||
description: The python version to run tests with
|
||||
default: "3.10"
|
||||
default: "3.11"
|
||||
package-name:
|
||||
required: false
|
||||
type: string
|
||||
|
|
22
noxfile.py
22
noxfile.py
|
@ -1327,6 +1327,28 @@ def combine_coverage(session):
|
|||
pass
|
||||
|
||||
|
||||
@nox.session(
|
||||
python=str(ONEDIR_PYTHON_PATH),
|
||||
name="combine-coverage-onedir",
|
||||
venv_params=["--system-site-packages"],
|
||||
)
|
||||
def combine_coverage_onedir(session):
|
||||
_install_coverage_requirement(session)
|
||||
env = {
|
||||
# The full path to the .coverage data file. Makes sure we always write
|
||||
# them to the same directory
|
||||
"COVERAGE_FILE": str(COVERAGE_FILE),
|
||||
}
|
||||
|
||||
# Always combine and generate the XML coverage report
|
||||
try:
|
||||
session.run("coverage", "combine", env=env)
|
||||
except CommandFailed:
|
||||
# Sometimes some of the coverage files are corrupt which would trigger a CommandFailed
|
||||
# exception
|
||||
pass
|
||||
|
||||
|
||||
@nox.session(python="3", name="create-html-coverage-report")
|
||||
def create_html_coverage_report(session):
|
||||
_install_coverage_requirement(session)
|
||||
|
|
|
@ -1432,7 +1432,7 @@ class VM:
|
|||
"""
|
||||
Combine the code coverage databases
|
||||
"""
|
||||
return self.run_nox("combine-coverage", session_args=[self.name])
|
||||
return self.run_nox("combine-coverage-onedir", session_args=[self.name])
|
||||
|
||||
def create_xml_coverage_reports(self):
|
||||
"""
|
||||
|
|
Loading…
Add table
Reference in a new issue