test(conftest): adjust PATH on macOS jobs only (not Vagrant)

This commit is contained in:
Imran Iqbal 2022-06-08 09:10:12 +01:00
parent 1b0f65538d
commit 9818c45d88
No known key found for this signature in database
GPG key ID: 6D8629439D2B7819

View file

@ -9,7 +9,7 @@ log = logging.getLogger(__name__)
@pytest.fixture(scope="session") @pytest.fixture(scope="session")
def host(): def host():
if os.environ.get("RUNNER_OS", "") == "macOS": if os.environ.get("RUNNER_OS", "") == "macOS" and os.environ.get("KITCHEN_LOCAL_YAML", "") == "kitchen.macos.yml":
# Adjust the `PATH` so that the `salt-call` executable can be found # Adjust the `PATH` so that the `salt-call` executable can be found
os.environ["PATH"] = "/opt/salt/bin{}{}".format(os.pathsep, os.environ["PATH"]) os.environ["PATH"] = "/opt/salt/bin{}{}".format(os.pathsep, os.environ["PATH"])
return testinfra.get_host("local://", sudo=True) return testinfra.get_host("local://", sudo=True)