diff --git a/osbuild-composer.spec b/osbuild-composer.spec index 06bf44a01..eb50093ce 100644 --- a/osbuild-composer.spec +++ b/osbuild-composer.spec @@ -2,6 +2,11 @@ # Pass --with tests to rpmbuild to override %bcond_with tests +# When --with relax_requires is specified osbuild-composer-tests +# will require osbuild-composer only by name, excluding version/release +# This is used internally during nightly pipeline testing! +%bcond_with relax_requires + %global goipath github.com/osbuild/osbuild-composer Version: 44 @@ -371,7 +376,11 @@ The dnf-json binary used by osbuild-composer and the workers. %package tests Summary: Integration tests +%if %{with relax_requires} +Requires: %{name} +%else Requires: %{name} = %{version}-%{release} +%endif Requires: composer-cli Requires: createrepo_c Requires: xorriso diff --git a/schutzbot/mockbuild.sh b/schutzbot/mockbuild.sh index 1770d6eb5..a7f35e8b4 100755 --- a/schutzbot/mockbuild.sh +++ b/schutzbot/mockbuild.sh @@ -99,10 +99,15 @@ sudo mock -r "$MOCK_CONFIG" --buildsrpm \ --sources "./osbuild-composer-${COMMIT}.tar.gz" \ --resultdir ./srpm +if [ "${NIGHTLY:=false}" == "true" ]; then + RELAX_REQUIRES="--with=relax_requires" +fi + greenprint "๐ŸŽ Building RPMs" sudo mock -r "$MOCK_CONFIG" \ --define "commit ${COMMIT}" \ --with=tests \ + ${RELAX_REQUIRES:+"$RELAX_REQUIRES"} \ --resultdir "$REPO_DIR" \ srpm/*.src.rpm @@ -112,6 +117,12 @@ sudo chown -R "$USER" "${REPO_DIR%%/*}" greenprint "๐Ÿงน Remove logs from mock build" rm "${REPO_DIR}"/*.log +# leave only -tests RPM to minimize interference when installing +# osbuild-composer.rpm from distro repositories +if [ "${NIGHTLY:=false}" == "true" ]; then + find "${REPO_DIR}" -type f -not -name "osbuild-composer-tests*.rpm" -exec rm -f "{}" \; +fi + # Create a repo of the built RPMs. greenprint "โ›“๏ธ Creating dnf repository" createrepo_c "${REPO_DIR}"