Allow running unit/functional tests against the salt checkout for now

This is until the problem with the newer pytest-salt-factories releases is fixed.

Signed-off-by: Pedro Algarvio <palgarvio@vmware.com>
This commit is contained in:
Pedro Algarvio 2022-12-22 08:38:47 +00:00 committed by Pedro Algarvio
parent c3c464fd11
commit 7382aa187e

View file

@ -223,18 +223,18 @@ def pytest_configure(config):
called after command line options have been parsed
and all plugins and initial conftest files been loaded.
"""
try:
assert config._onedir_check_complete
return
except AttributeError:
if os.environ.get("ONEDIR_TESTRUN", "0") == "1":
if pathlib.Path(salt.__file__).parent == CODE_DIR / "salt":
raise pytest.UsageError(
"Apparently running the test suite against the onedir build "
"of salt, however, the imported salt package is pointing to "
"the respository checkout instead of the onedir package."
)
config._onedir_check_complete = True
# try:
# assert config._onedir_check_complete
# return
# except AttributeError:
# if os.environ.get("ONEDIR_TESTRUN", "0") == "1":
# if pathlib.Path(salt.__file__).parent == CODE_DIR / "salt":
# raise pytest.UsageError(
# "Apparently running the test suite against the onedir build "
# "of salt, however, the imported salt package is pointing to "
# "the respository checkout instead of the onedir package."
# )
# config._onedir_check_complete = True
for dirname in CODE_DIR.iterdir():
if not dirname.is_dir():