mirror of
https://github.com/saltstack/salt.git
synced 2025-04-16 09:40:20 +00:00
Update salt_factories_default_root_dir GH runners
Updates salt_factories_default_root_dir to use $RUNNER_TEMP if running in CI and using Windows. This is setup by the Github Runner and should be on the same disk as the checked out repo. Without doing that, the salt_factories_default_root_dir will be in the user's temp dir which is on a different disk. This causes the fileserver to throw an error as it tries to combine file_roots from the repo and pytest-salt-factories.
This commit is contained in:
parent
9a327c5919
commit
b0a06655e4
1 changed files with 9 additions and 1 deletions
|
@ -16,6 +16,7 @@ import _pytest.logging
|
|||
import _pytest.skipping
|
||||
import more_itertools
|
||||
import pytest
|
||||
import pytestskipmarkers
|
||||
|
||||
import salt
|
||||
import salt._logging
|
||||
|
@ -426,7 +427,8 @@ def pytest_itemcollected(item):
|
|||
pytest.fail(
|
||||
"The test {!r} appears to be written for pytest but it's not under"
|
||||
" {!r}. Please move it there.".format(
|
||||
item.nodeid, str(PYTESTS_DIR.relative_to(CODE_DIR)), pytrace=False
|
||||
item.nodeid,
|
||||
str(PYTESTS_DIR.relative_to(CODE_DIR)),
|
||||
)
|
||||
)
|
||||
|
||||
|
@ -801,6 +803,12 @@ def salt_factories_default_root_dir(salt_factories_default_root_dir):
|
|||
dictionary, then that's the value used, and not the one returned by
|
||||
this fixture.
|
||||
"""
|
||||
if os.environ.get("CI") and pytestskipmarkers.utils.platform.is_windows():
|
||||
tempdir = pathlib.Path(
|
||||
os.environ.get("RUNNER_TEMP", r"C:\Windows\Temp")
|
||||
).resolve()
|
||||
return tempdir / "stsuite"
|
||||
|
||||
return salt_factories_default_root_dir / "stsuite"
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue