Use a different pytest.ini file for the package tests

Signed-off-by: Pedro Algarvio <palgarvio@vmware.com>
This commit is contained in:
Pedro Algarvio 2023-06-14 18:51:55 +01:00 committed by Pedro Algarvio
parent 98cb28e04d
commit 464c4e5eb2
2 changed files with 17 additions and 3 deletions

View file

@ -1743,18 +1743,18 @@ def test_pkgs_onedir(session):
chunks = { chunks = {
"install": ["pkg/tests/"], "install": ["pkg/tests/"],
"upgrade": [ "upgrade": [
"pkg/tests/upgrade/test_salt_upgrade.py::test_salt_upgrade",
"--upgrade", "--upgrade",
"--no-uninstall", "--no-uninstall",
"pkg/tests/upgrade/",
], ],
"upgrade-classic": [ "upgrade-classic": [
"pkg/tests/upgrade/test_salt_upgrade.py::test_salt_upgrade",
"--upgrade", "--upgrade",
"--no-uninstall", "--no-uninstall",
"pkg/tests/upgrade/",
], ],
"download-pkgs": [ "download-pkgs": [
"--download-pkgs", "--download-pkgs",
"pkg/tests/download/test_pkg_download.py", "pkg/tests/download/",
], ],
} }
@ -1802,6 +1802,8 @@ def test_pkgs_onedir(session):
pytest_args = ( pytest_args = (
cmd_args[:] cmd_args[:]
+ [ + [
"-c",
str(REPO_ROOT / "pkg-tests-pytest.ini"),
f"--junitxml=artifacts/xml-unittests-output/{junit_report_filename}.xml", f"--junitxml=artifacts/xml-unittests-output/{junit_report_filename}.xml",
f"--log-file=artifacts/logs/{runtests_log_filename}.log", f"--log-file=artifacts/logs/{runtests_log_filename}.log",
] ]
@ -1813,6 +1815,8 @@ def test_pkgs_onedir(session):
pytest_args = ( pytest_args = (
cmd_args[:] cmd_args[:]
+ [ + [
"-c",
str(REPO_ROOT / "pkg-tests-pytest.ini"),
"--no-install", "--no-install",
f"--junitxml=artifacts/xml-unittests-output/{junit_report_filename}.xml", f"--junitxml=artifacts/xml-unittests-output/{junit_report_filename}.xml",
f"--log-file=artifacts/logs/{runtests_log_filename}.log", f"--log-file=artifacts/logs/{runtests_log_filename}.log",

10
pkg-tests-pytest.ini Normal file
View file

@ -0,0 +1,10 @@
[pytest]
log_date_format=%H:%M:%S
log_cli_format=%(asctime)s,%(msecs)03.0f [%(name)-5s:%(lineno)-4d][%(levelname)-8s][%(processName)s(%(process)s)] %(message)s
log_file_format=%(asctime)s,%(msecs)03d [%(name)-17s:%(lineno)-4d][%(levelname)-8s][%(processName)s(%(process)d)] %(message)s
norecursedirs=templates tests/
testpaths=pkg/tests
python_files=test_*.py
python_classes=Test*
python_functions = test_*
junit_family=xunit2