forked from pool/python-pytest-salt-factories
Compare commits
7 Commits
| Author | SHA256 | Date | |
|---|---|---|---|
| 62db507dce | |||
| dcec4a944c | |||
| 0e3bbefacb | |||
| cf95116be5 | |||
| 479cee3c56 | |||
| 84a6521d7d | |||
| 55c4fec2b4 |
BIN
pytest_salt_factories-1.0.4.tar.gz
(Stored with Git LFS)
BIN
pytest_salt_factories-1.0.4.tar.gz
(Stored with Git LFS)
Binary file not shown.
3
pytest_salt_factories-1.0.5.tar.gz
Normal file
3
pytest_salt_factories-1.0.5.tar.gz
Normal file
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:13e020a938292ffc33d2247c5d094a532c53fd89d3ecb70bcda98f15d7846bc7
|
||||
size 171553
|
||||
@@ -1,3 +1,16 @@
|
||||
-------------------------------------------------------------------
|
||||
Fri Nov 28 05:13:27 UTC 2025 - Steve Kowalik <steven.kowalik@suse.com>
|
||||
|
||||
- Only require pytest-subtests with pytest < 9.
|
||||
- Add patch support-pytest-9.patch:
|
||||
* Do not overload fixture names and do not mark fixtures.
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Wed Sep 3 01:44:28 UTC 2025 - Steve Kowalik <steven.kowalik@suse.com>
|
||||
|
||||
- Update to 1.0.5:
|
||||
* Support pytest 8.4+
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Thu Apr 10 11:22:32 UTC 2025 - Daniel Garcia <daniel.garcia@suse.com>
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#
|
||||
# spec file for package python-pytest-salt-factories
|
||||
#
|
||||
# Copyright (c) 2025 SUSE LLC
|
||||
# Copyright (c) 2025 SUSE LLC and contributors
|
||||
#
|
||||
# All modifications and additions to the file contributed by third parties
|
||||
# remain the property of their copyright owners, unless otherwise agreed
|
||||
@@ -16,7 +16,6 @@
|
||||
#
|
||||
|
||||
|
||||
%define _version 1.0.4
|
||||
%if 0%{?suse_version} > 1500
|
||||
%bcond_without libalternatives
|
||||
%else
|
||||
@@ -24,14 +23,16 @@
|
||||
%endif
|
||||
|
||||
Name: python-pytest-salt-factories
|
||||
Version: %{_version}
|
||||
Version: 1.0.5
|
||||
Release: 0
|
||||
Summary: A pytest plugin for testing Salt
|
||||
License: Apache-2.0
|
||||
URL: https://pytest-salt-factories.readthedocs.io/en/latest/
|
||||
Source0: https://files.pythonhosted.org/packages/source/p/pytest-salt-factories/pytest_salt_factories-%{_version}.tar.gz
|
||||
Source0: https://files.pythonhosted.org/packages/source/p/pytest-salt-factories/pytest_salt_factories-%{version}.tar.gz
|
||||
# PATCH-FIX-OPENSUSE fix_unit_tests.patch this patch is removing the workaround in the unit test implementation so the test can pass when using our openSUSE Salt 3006.0 package
|
||||
Patch1: fix_unit_tests.patch
|
||||
# PATCH-FIX-UPSTREAM gh#saltstack/pytest-salt-factories#194 & gh#saltstack/pytest-salt-factories#195
|
||||
Patch2: support-pytest-9.patch
|
||||
BuildRequires: %{python_module PyYAML}
|
||||
BuildRequires: %{python_module devel}
|
||||
BuildRequires: %{python_module docker}
|
||||
@@ -40,7 +41,7 @@ BuildRequires: %{python_module msgpack}
|
||||
BuildRequires: %{python_module pip}
|
||||
BuildRequires: %{python_module pytest >= 6.0.0}
|
||||
BuildRequires: %{python_module pytest-shell-utilities}
|
||||
BuildRequires: %{python_module pytest-subtests}
|
||||
BuildRequires: %{python_module pytest-subtests if %python-pytest < 9}
|
||||
BuildRequires: %{python_module pytest-system-statistics}
|
||||
BuildRequires: %{python_module pyzmq}
|
||||
BuildRequires: %{python_module salt}
|
||||
@@ -77,7 +78,7 @@ Requires(postun): update-alternatives
|
||||
A pytest plugin for testing Salt.
|
||||
|
||||
%prep
|
||||
%autosetup -p1 -n pytest_salt_factories-%{_version}
|
||||
%autosetup -p1 -n pytest_salt_factories-%{version}
|
||||
|
||||
%build
|
||||
%pyproject_wheel
|
||||
@@ -88,7 +89,6 @@ A pytest plugin for testing Salt.
|
||||
%python_expand %fdupes %{buildroot}%{$python_sitelib}
|
||||
|
||||
%check
|
||||
export PYTHONDONTWRITEBYTECODE=1
|
||||
# Run test and exclude some that doesn't work fine in OBS.
|
||||
donttest="ssh or echoext"
|
||||
# Flaky tests for aarch64, ppc, arm
|
||||
@@ -125,7 +125,7 @@ python313_donttest=$python312_donttest
|
||||
%license LICENSE
|
||||
%doc README.rst CHANGELOG.rst
|
||||
%{python_sitelib}/saltfactories
|
||||
%{python_sitelib}/pytest_salt_factories-%{_version}*-info
|
||||
%{python_sitelib}/pytest_salt_factories-%{version}.dist-info
|
||||
%python_alternative %{_bindir}/salt-factories
|
||||
|
||||
%changelog
|
||||
|
||||
120
support-pytest-9.patch
Normal file
120
support-pytest-9.patch
Normal file
@@ -0,0 +1,120 @@
|
||||
From 625f80869ea897cb06e17c3d74ddd2f134c7db38 Mon Sep 17 00:00:00 2001
|
||||
From: Steve Kowalik <steven@wedontsleep.org>
|
||||
Date: Fri, 28 Nov 2025 14:58:26 +1100
|
||||
Subject: [PATCH] Do not overload docker_client fixtures
|
||||
|
||||
pytest fixtures are now executed in the order they are found, which
|
||||
means a redeclared fixture will take precedence. This means that an
|
||||
attempt to spin up the salt_factories fixture in the container
|
||||
integration tests now has a dependency loop. Remove the overloaded
|
||||
fixture, and perform the check further up the fixture chain.
|
||||
---
|
||||
.../factories/daemons/container/test_master.py | 12 ++++--------
|
||||
.../factories/daemons/container/test_minion.py | 11 +++--------
|
||||
2 files changed, 7 insertions(+), 16 deletions(-)
|
||||
|
||||
diff --git a/tests/integration/factories/daemons/container/test_master.py b/tests/integration/factories/daemons/container/test_master.py
|
||||
index 8f0a655c..221cb4e5 100644
|
||||
--- a/tests/integration/factories/daemons/container/test_master.py
|
||||
+++ b/tests/integration/factories/daemons/container/test_master.py
|
||||
@@ -21,14 +21,6 @@
|
||||
]
|
||||
|
||||
|
||||
-@pytest.fixture(scope="session")
|
||||
-def docker_client(salt_factories, docker_client):
|
||||
- if salt_factories.system_service: # pragma: no cover
|
||||
- msg = "Test should not run against system install of Salt"
|
||||
- raise pytest.skip.Exception(msg, _use_item_location=True)
|
||||
- return docker_client
|
||||
-
|
||||
-
|
||||
@pytest.fixture(scope="module")
|
||||
def minion_id(salt_version):
|
||||
return random_string(f"salt-minion-{salt_version}-", uppercase=False)
|
||||
@@ -43,6 +35,10 @@ def master_id(salt_version):
|
||||
def salt_master(
|
||||
salt_factories, docker_client, docker_network_name, master_id, host_docker_network_ip_address
|
||||
):
|
||||
+ if salt_factories.system_service: # pragma: no cover
|
||||
+ msg = "Test should not run against system install of Salt"
|
||||
+ raise pytest.skip.Exception(msg, _use_item_location=True)
|
||||
+
|
||||
config_overrides = {
|
||||
"open_mode": True,
|
||||
"user": "root",
|
||||
diff --git a/tests/integration/factories/daemons/container/test_minion.py b/tests/integration/factories/daemons/container/test_minion.py
|
||||
index 89a92feb..dc1909a2 100644
|
||||
--- a/tests/integration/factories/daemons/container/test_minion.py
|
||||
+++ b/tests/integration/factories/daemons/container/test_minion.py
|
||||
@@ -23,14 +23,6 @@
|
||||
]
|
||||
|
||||
|
||||
-@pytest.fixture(scope="session")
|
||||
-def docker_client(salt_factories, docker_client):
|
||||
- if salt_factories.system_service: # pragma: no cover
|
||||
- msg = "Test should not run against system install of Salt"
|
||||
- raise pytest.skip.Exception(msg, _use_item_location=True)
|
||||
- return docker_client
|
||||
-
|
||||
-
|
||||
@pytest.fixture
|
||||
def minion_id(salt_version):
|
||||
return random_string(f"salt-minion-{salt_version}-", uppercase=False)
|
||||
@@ -38,6 +30,9 @@ def minion_id(salt_version):
|
||||
|
||||
@pytest.fixture(scope="module")
|
||||
def salt_master(salt_factories, host_docker_network_ip_address):
|
||||
+ if salt_factories.system_service: # pragma: no cover
|
||||
+ msg = "Test should not run against system install of Salt"
|
||||
+ raise pytest.skip.Exception(msg, _use_item_location=True)
|
||||
config_overrides = {
|
||||
"interface": host_docker_network_ip_address,
|
||||
"log_level_logfile": "quiet",
|
||||
From 7bf6da9ccaf6acab3688503bbd62315ae8fdcb98 Mon Sep 17 00:00:00 2001
|
||||
From: Steve Kowalik <steven@wedontsleep.org>
|
||||
Date: Fri, 28 Nov 2025 15:04:38 +1100
|
||||
Subject: [PATCH] Do not apply a mark to a fixture
|
||||
|
||||
pytest 9 now errors if marks are applied to a fixture, which has never
|
||||
had any effect, but now causes an error. Move the skipping check to the
|
||||
test cases.
|
||||
---
|
||||
tests/integration/factories/daemons/ssh/test_salt_ssh.py | 2 +-
|
||||
tests/integration/factories/daemons/sshd/test_sshd.py | 2 +-
|
||||
2 files changed, 2 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/tests/integration/factories/daemons/ssh/test_salt_ssh.py b/tests/integration/factories/daemons/ssh/test_salt_ssh.py
|
||||
index 2e8fbed1..3c063947 100644
|
||||
--- a/tests/integration/factories/daemons/ssh/test_salt_ssh.py
|
||||
+++ b/tests/integration/factories/daemons/ssh/test_salt_ssh.py
|
||||
@@ -15,7 +15,6 @@
|
||||
|
||||
|
||||
@pytest.fixture(scope="module")
|
||||
-@pytest.mark.skip_if_binaries_missing("sshd", "ssh-keygen")
|
||||
def sshd(salt_factories):
|
||||
# Set StrictModes to no because our config directory lives in /tmp and those permissions
|
||||
# are not acceptable by sshd strict paranoia.
|
||||
@@ -54,6 +53,7 @@ def salt_ssh_cli(sshd, salt_factories, master):
|
||||
|
||||
|
||||
@pytest.mark.skip_on_windows
|
||||
+@pytest.mark.skip_if_binaries_missing("ssh", "sshd", "ssh-keygen")
|
||||
def test_salt_ssh(salt_ssh_cli):
|
||||
ret = salt_ssh_cli.run("test.echo", "It Works!", minion_tgt="localhost")
|
||||
assert ret.returncode == 0
|
||||
diff --git a/tests/integration/factories/daemons/sshd/test_sshd.py b/tests/integration/factories/daemons/sshd/test_sshd.py
|
||||
index 873a8dd2..0b4076bc 100644
|
||||
--- a/tests/integration/factories/daemons/sshd/test_sshd.py
|
||||
+++ b/tests/integration/factories/daemons/sshd/test_sshd.py
|
||||
@@ -37,7 +37,7 @@ def test_sshd(sshd):
|
||||
|
||||
|
||||
@pytest.mark.skip_on_windows
|
||||
-@pytest.mark.skip_if_binaries_missing("ssh")
|
||||
+@pytest.mark.skip_if_binaries_missing("ssh", "sshd", "ssh-keygen")
|
||||
def test_connect(sshd, known_hosts_file):
|
||||
ssh = shutil.which("ssh")
|
||||
assert ssh is not None
|
||||
Reference in New Issue
Block a user