mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Only set ONEDIR_TESTRUN
if onedir
is True
Signed-off-by: Pedro Algarvio <palgarvio@vmware.com>
This commit is contained in:
parent
16eb2efa10
commit
c4fa5a641f
3 changed files with 5 additions and 5 deletions
|
@ -1045,9 +1045,9 @@ def _pytest(session, coverage, cmd_args, env=None):
|
|||
def _ci_test(session, transport, onedir=False):
|
||||
# Install requirements
|
||||
_install_requirements(session, transport, onedir=onedir)
|
||||
env = {
|
||||
"ONEDIR_TESTRUN": "1",
|
||||
}
|
||||
env = {}
|
||||
if onedir:
|
||||
env["ONEDIR_TESTRUN"] = "1"
|
||||
chunks = {
|
||||
"unit": [
|
||||
"tests/unit",
|
||||
|
|
|
@ -4,7 +4,7 @@ import sys
|
|||
|
||||
_repo_root = pathlib.Path(__file__).parent.parent
|
||||
|
||||
if "ONEDIR_TESTRUN" in os.environ:
|
||||
if os.environ.get("ONEDIR_TESTRUN", "0") == "1":
|
||||
# In this particular case, we want to make sure that the repo root
|
||||
# is not part if sys.path so that when we import salt, we import salt from
|
||||
# the onedir and not the code checkout
|
||||
|
|
|
@ -801,7 +801,7 @@ def salt_factories_config():
|
|||
else:
|
||||
start_timeout = 60
|
||||
|
||||
if "ONEDIR_TESTRUN" in os.environ:
|
||||
if os.environ.get("ONEDIR_TESTRUN", "0") == "1":
|
||||
code_dir = None
|
||||
else:
|
||||
code_dir = str(CODE_DIR)
|
||||
|
|
Loading…
Add table
Reference in a new issue