Skip to content

Commit

Permalink
Fix renovate tag, don't run SSH wrapper tests with 3006/3.12
Browse files Browse the repository at this point in the history
3006 has issues with Python 3.12, which is the system default Python
version of the new `ubuntu-24.04` runner.
  • Loading branch information
lkubb committed Oct 8, 2024
1 parent 3e0b393 commit 565bb8e
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .github/workflows/test-action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
fetch-depth: 2 # coverage: Issue detecting commit SHA

- name: Setup Vault
# renovate: datasource=git-tags depName=https://github.com/eLco/setup-vault depType=action
# renovate:
uses: eLco/setup-vault@5d0ddffdfca9650484ae1378dafc376a9ebcd15e # v1.0.3
with:
vault_version: 1.15.4
Expand Down
22 changes: 22 additions & 0 deletions tests/integration/wrapper/conftest.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import pytest
import salt.version
from packaging.version import Version


@pytest.fixture(scope="module", autouse=True)
def _check_host_python(salt_ssh_cli):
"""
When testing Salt 3006.*, the host's default Python version
needs to be <3.12, otherwise Salt just crashes with an ImportError
regarding ``backports.ssl_match_hostname``.
"""
if Version(salt.version.__version__) >= Version("3007"):
return
ret = salt_ssh_cli.run("--raw", "python3 --version")
assert ret.returncode == 0
assert isinstance(ret.data, dict)
python_version = Version(ret.data["stdout"].split(" ")[1])
if python_version >= Version("3.12"):
pytest.skip(
f"The host Python ({python_version}) is not supported by Salt {salt.version.__version__}"
)

0 comments on commit 565bb8e

Please sign in to comment.