Skip to content

Commit 8ad9b24

Browse files
committed
Allow to run test at build time
1 parent eb4ef38 commit 8ad9b24

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

package/python-kiwi-spec-template

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,12 @@ Source1: %{name}-rpmlintrc
6161
## PATCH-FIX-OPENSUSE kiwi-revert-bls-default-for-suse.patch -- temporary until opensuse has bls
6262
Patch1001: kiwi-revert-bls-default-for-suse.patch
6363
BuildRoot: %{_tmppath}/%{name}-%{version}-build
64+
BuildRequires: kiwi-systemdeps
65+
BuildRequires: python%{python3_pkgversion}-pytest
66+
BuildRequires: python%{python3_pkgversion}-pip
67+
BuildRequires: python%{python3_pkgversion}-anymarkup-core
68+
BuildRequires: python%{python3_pkgversion}-toml
69+
BuildRequires: python%{python3_pkgversion}-xmltodict
6470
%if 0%{?fedora} || 0%{?suse_version}
6571
BuildRequires: fdupes
6672
%endif
@@ -664,6 +670,11 @@ make -C doc man
664670
# Build application wheel
665671
%{__python3} -m build --no-isolation --wheel
666672

673+
# Run tests
674+
pip install --break-system-packages dist/kiwi-%{version}-py3-none-any.whl
675+
cd test/unit
676+
pytest
677+
667678
%install
668679
# Install application
669680
%{__python3} -m installer --destdir %{buildroot} %{?is_deb:--no-compile-bytecode} dist/*.whl

0 commit comments

Comments
 (0)