#6 [frontend] spec: allow 'rpmbuild --without check'
Merged 7 years ago by clime. Opened 7 years ago by praiskup.
Unknown source praiskup-without-check  into  master

file modified
+7 -3
@@ -1,4 +1,5 @@

- %global with_test 1

+ %bcond_without check

+ 

  %if 0%{?rhel} < 7 && 0%{?rhel} > 0

  %global _pkgdocdir %{_docdir}/%{name}-%{version}

  %global __python2 %{__python}
@@ -60,6 +61,7 @@

  Requires:   python-marshmallow >= 2.0.0

  Requires:   python2-modulemd

  Requires:   python-pygments

+ 

  # for tests:

  Requires:   pytest

  Requires:   python-flexmock
@@ -92,7 +94,8 @@

  %if 0%{?rhel} < 7 && 0%{?rhel} > 0

  BuildRequires: python-argparse

  %endif

- # check

+ 

+ %if %{with check}

  BuildRequires: python-six

  BuildRequires: python-flask

  BuildRequires: python-flask-script
@@ -119,6 +122,7 @@

  BuildRequires: python-whoosh

  BuildRequires: python-blinker

  BuildRequires: python-pygments

+ %endif

  

  %if 0%{?with_python3}

  Requires:   dnf
@@ -232,7 +236,7 @@

  ln -fs /usr/share/copr/coprs_frontend/manage.py %{buildroot}/%{_bindir}/copr-frontend

  

  %check

- %if %{with_test} && "%{_arch}" == "x86_64"

+ %if %{with check} && "%{_arch}" == "x86_64"

      pushd coprs_frontend

      REDIS_PORT=7777

      redis-server --port $REDIS_PORT & #&> _redis.log &

I'm not sure whether 'with_test' macro was used previously ... so I'm rather go the pull request way.

rebased

7 years ago

Wrong, the %if condition wraps 'Requires', not 'BuildRequires', I'll update.

rebased

7 years ago

Done, but actually do we need the 'Requires' "for tests"?

Done, but actually do we need the 'Requires' "for tests"?

No, we don't. Note that out of those marked as "for tests" only these packages:
pytest, python-flexmock, python-mock, python-decorator
are required only for tests. The rest is there probably by mistake and
yum is not required at all. Also python2-modulemd is still required even without
check when it is not needed, in fact. I think the spec could take some care.

Pull-Request has been merged by clime

7 years ago
Metadata