From 5575282ab38b3c596e6bc65d6e2b8f3e764c9179 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20Budai?= Date: Wed, 23 Mar 2022 15:36:41 +0100 Subject: [PATCH] spec: don't push tests into Fedora koji-osbuild-tests is dependent on osbuild-composer-tests but this package is not shipped into Fedora because it provides zero value to users. Let's do the same for koji-osbuild. koji-osbuild-tests will be built only in our upstream CI but not built in the official Koji. --- koji-osbuild.spec | 12 ++++++++++++ schutzbot/mockbuild.sh | 1 + 2 files changed, 13 insertions(+) diff --git a/koji-osbuild.spec b/koji-osbuild.spec index d29e8b2..0ebaa57 100644 --- a/koji-osbuild.spec +++ b/koji-osbuild.spec @@ -1,3 +1,7 @@ +# Do not build with tests by default +# Pass --with tests to rpmbuild to override +%bcond_with tests + %global forgeurl https://github.com/osbuild/koji-osbuild Name: koji-osbuild @@ -63,6 +67,8 @@ install -d %{buildroot}%{python3_sitelib}/koji_cli_plugins install -p -m 0644 plugins/cli/osbuild.py %{buildroot}%{python3_sitelib}/koji_cli_plugins/osbuild.py %py_byte_compile %{__python3} %{buildroot}%{python3_sitelib}/koji_cli_plugins/osbuild.py + +%if %{with tests} # Tests install -m 0755 -vd %{buildroot}/%{_libexecdir}/tests/%{name} install -m 0755 -vp test/integration.sh %{buildroot}/%{_libexecdir}/tests/%{name}/ @@ -107,6 +113,8 @@ install -m 0755 -vp test/container/hub/web.conf %{buildroot}/%{_ install -m 0755 -vd %{buildroot}/%{_datadir}/%{name}-tests/container/hub/plugin install -m 0755 -vp test/container/hub/plugin/osbuild.py %{buildroot}/%{_datadir}/%{name}-tests/container/hub/ +%endif + %files %license LICENSE %doc README.md @@ -123,6 +131,8 @@ install -m 0755 -vp test/container/hub/plugin/osbuild.py %{buildroot}/%{_ %{python3_sitelib}/koji_cli_plugins/osbuild.py %{python3_sitelib}/koji_cli_plugins/__pycache__/osbuild.* +%if %{with tests} + %package tests Summary: Integration tests for koji-osbuild Requires: %{name} = %{version}-%{release} @@ -151,6 +161,8 @@ Integration tests for koji-osbuild. To be run on a dedicated system. %{_libexecdir}/%{name}-tests %{_datadir}/%{name}-tests +%endif + %changelog # the changelog is distribution-specific, therefore there's just one entry diff --git a/schutzbot/mockbuild.sh b/schutzbot/mockbuild.sh index 52c7c0e..55ad64a 100755 --- a/schutzbot/mockbuild.sh +++ b/schutzbot/mockbuild.sh @@ -76,6 +76,7 @@ sudo mock -v -r "$MOCK_CONFIG" --buildsrpm \ greenprint "🎁 Building RPMs" sudo mock -v -r $MOCK_CONFIG \ --define "commit ${GIT_SHA}" \ + --with=tests \ --resultdir $REPO_DIR \ srpm/*.src.rpm