2025-03-26 14:25:28 +01:00
#
# spec file for package python-pytest-salt-factories
#
2025-04-29 17:42:04 +02:00
# Copyright (c) 2025 SUSE LLC
2025-03-26 14:25:28 +01:00
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via https://bugs.opensuse.org/
#
2025-04-29 17:42:04 +02:00
%define _version 1.0.4
2025-03-26 14:25:28 +01:00
%if 0%{?suse_version} > 1500
%bcond_without libalternatives
%else
%bcond_with libalternatives
%endif
2025-04-29 17:42:04 +02:00
2025-03-26 14:25:28 +01:00
Name : python-pytest-salt-factories
2025-04-29 17:42:04 +02:00
Version : %{_version}
2025-03-26 14:25:28 +01:00
Release : 0
Summary : A pytest plugin for testing Salt
License : Apache-2.0
URL : https://pytest-salt-factories.readthedocs.io/en/latest/
2025-04-29 17:42:04 +02:00
Source0 : https://files.pythonhosted.org/packages/source/p/pytest-salt-factories/pytest_salt_factories-%{_version}.tar.gz
2025-03-26 14:25:28 +01:00
# 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
2025-04-29 17:42:04 +02:00
BuildRequires : %{python_module PyYAML}
2025-03-26 14:25:28 +01:00
BuildRequires : %{python_module devel}
BuildRequires : %{python_module docker}
BuildRequires : %{python_module importlib-metadata}
2025-04-29 17:42:04 +02:00
BuildRequires : %{python_module msgpack}
2025-03-26 14:25:28 +01:00
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-system-statistics}
2025-04-29 17:42:04 +02:00
BuildRequires : %{python_module pyzmq}
BuildRequires : %{python_module salt}
2025-03-26 14:25:28 +01:00
BuildRequires : %{python_module setuptools >= 50.3.2}
BuildRequires : %{python_module setuptools-declarative-requirements}
BuildRequires : %{python_module setuptools_scm}
2025-04-29 17:42:04 +02:00
BuildRequires : %{python_module tornado}
2025-03-26 14:25:28 +01:00
BuildRequires : %{python_module wheel}
BuildRequires : fdupes
BuildRequires : python-rpm-macros
BuildRequires : salt-master
2025-04-29 17:42:04 +02:00
Requires : python-PyYAML
2025-03-26 14:25:28 +01:00
Requires : python-attrs >= 19.2.0
Requires : python-msgpack
Requires : python-psutil
Requires : python-pytest >= 6.0.0
Requires : python-pytest-helpers-namespace >= 2021.4.29
Requires : python-pytest-shell-utilities >= 1.4.0
Requires : python-pytest-skip-markers >= 1.1.3
Requires : python-pytest-system-statistics >= 1.0.2
Requires : python-pyzmq
Requires : python-virtualenv
BuildArch : noarch
%if %{with libalternatives}
BuildRequires : alts
Requires : alts
%else
Requires(post) : update-alternatives
Requires(postun) : update-alternatives
%endif
%python_subpackages
%description
A pytest plugin for testing Salt.
%prep
2025-04-29 17:42:04 +02:00
%autosetup -p1 -n pytest_salt_factories-%{_version}
2025-03-26 14:25:28 +01:00
%build
%pyproject_wheel
%install
%pyproject_install
%python_clone -a %{buildroot} %{_bindir} /salt-factories
%python_expand %fdupes %{buildroot} %{$python_sitelib}
%check
export PYTHONDONTWRITEBYTECODE=1
# Run test and exclude some that doesn't work fine in OBS.
2025-04-29 17:42:04 +02:00
donttest=" s s h o r e c h o e x t "
# Flaky tests for aarch64, ppc, arm
donttest+=" o r t e s t _ a l l _ m e s s a g e s _ r e c e i v e d "
# All these tests are failing with python >3.11
# tests/integration/factories/cli/test_salt.py::test_merged_json_out
# tests/integration/factories/cli/test_salt.py::test_merged_json_out_disabled
python312_donttest=" o r t e s t _ m e r g e d _ j s o n _ o u t o r t e s t _ m e r g e d _ j s o n _ o u t _ d i s a b l e d "
# tests/integration/factories/daemons/master/test_master.py::test_salt_cp_minion_id_as_first_argument
python312_donttest+=" o r t e s t _ s a l t _ c p _ m i n i o n _ i d _ a s _ f i r s t _ a r g u m e n t "
# tests/integration/factories/daemons/master/test_master.py::test_salt_cp_explicit_minion_tgt
python312_donttest+=" o r t e s t _ s a l t _ c p _ e x p l i c i t _ m i n i o n _ t g t "
# tests/integration/factories/daemons/minion/test_minion.py::test_minion
python312_donttest+=" o r t e s t _ m i n i o n "
# tests/integration/factories/daemons/minion/test_minion.py::test_show_jid
# tests/integration/factories/daemons/proxy/test_proxy_minion.py::test_show_jid
python312_donttest+=" o r t e s t _ s h o w _ j i d "
# tests/integration/factories/daemons/proxy/test_proxy_minion.py::test_proxy_minion
python312_donttest+=" o r t e s t _ p r o x y _ m i n i o n "
# tests/integration/utils/saltext/test_log_handlers.py::test_logs_forwarded_from_sub_processes
python312_donttest+=" o r t e s t _ l o g s _ f o r w a r d e d _ f r o m _ s u b _ p r o c e s s e s "
python313_donttest=$python312_donttest
%pytest -k " n o t ( $ d o n t t e s t $ { $ p y t h o n _ d o n t t e s t } ) " ${$python_ignore}
2025-03-26 14:25:28 +01:00
%post
%python_install_alternative salt-factories
%postun
%python_uninstall_alternative salt-factories
%files %{python_files}
%license LICENSE
%doc README.rst CHANGELOG.rst
%{python_sitelib} /saltfactories
2025-04-29 17:42:04 +02:00
%{python_sitelib} /pytest_salt_factories-%{_version}*-info
2025-03-26 14:25:28 +01:00
%python_alternative %{_bindir} /salt-factories
%changelog