Rubygem package smoke testing [was: Re: F35 Change: Python Packaging Guidelines overhaul (System-Wide Change proposal)]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Jun 16, 2021 at 01:17:31PM +0200, Vít Ondruch wrote:

Dne 15. 06. 21 v 19:34 Ewoud Kohl van Wijngaarden napsal(a):
On Tue, Jun 15, 2021 at 01:51:12PM +0200, Miro Hrončok wrote:
On 15. 06. 21 13:46, Vitaly Zaitsev via devel wrote:
If that is not possible with reasonable effort,
at least a basic smoke test (such as importing the packaged module)
*MUST* be run in `+%check+`.

A simple scriplet should be introduced I think:

%check
%do_import_test

Already on it:
https://src.fedoraproject.org/rpms/python-rpm-macros/pull-request/99

This may be not be the right place, but in Foreman's Ruby packaging we've also felt a similar pain. Mostly with C extensions that were built in the wrong directory. We also added a %check section to do a basic "import" (require) test.

Is there a similar macro for Ruby smoke testing?


No, there is no similar macro for Ruby. Historically, it was not clear what should be actually required. With Bundler putting into place more conventions, the situation is better.

Nevertheless, what is the specific issue you are referring to above? There are many examples of fixing such issue, e.g.

https://src.fedoraproject.org/rpms/rubygem-bcrypt/blob/rawhide/f/rubygem-bcrypt.spec#_52

And there are probably more complex cases.

Perhaps we should take this to a separate discussion, but we found that there are various bugs in SCL macros that s.o ended up in the wrong directories so it wouldn't load.

Our specific case is that we have our own SCL that depends on rh-ruby27 and must override GEM_PATH[1], GEM_HOME[2] and replace %%gem_install[3]. We forgot this at some point. Providing the explicit paths masked this failure. Perhaps this simply can't work inside RPM builds and you need to really install it in some chroot to test it.

[1]: https://github.com/theforeman/foreman-packaging/blob/7b1dd67c08f4f17b818dd0b7d2b80e243c652211/packages/foreman/tfm/tfm.spec#L220
[2]: https://github.com/theforeman/foreman-packaging/blob/7b1dd67c08f4f17b818dd0b7d2b80e243c652211/packages/foreman/tfm/tfm.spec#L221
[3]: https://github.com/theforeman/foreman-packaging/blob/7b1dd67c08f4f17b818dd0b7d2b80e243c652211/packages/foreman/tfm/macros.tfm#L1-L13


And for those of us who also maintain packages for EL7/8, what's the availability of these macros?


RHEL7 is in Maintenance Support 2 Phase [1], so don't expect too much. There are better chances to get such macro into RHEL8, but in the context of Ruby, there are 3 supported versions ATM, therefore it might get complex.

Anyway, it is good idea to use such macros in the following way:


~~~

%{?import_smoke_test}

~~~


This does the right thing where such macro is supported and is ignored elsewhere, where such macro is not available.

Thanks! That makes sense.
_______________________________________________
devel mailing list -- devel@xxxxxxxxxxxxxxxxxxxxxxx
To unsubscribe send an email to devel-leave@xxxxxxxxxxxxxxxxxxxxxxx
Fedora Code of Conduct: https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: https://lists.fedoraproject.org/archives/list/devel@xxxxxxxxxxxxxxxxxxxxxxx
Do not reply to spam on the list, report it: https://pagure.io/fedora-infrastructure




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Fedora Announce]     [Fedora Users]     [Fedora Kernel]     [Fedora Testing]     [Fedora Formulas]     [Fedora PHP Devel]     [Kernel Development]     [Fedora Legacy]     [Fedora Maintainers]     [Fedora Desktop]     [PAM]     [Red Hat Development]     [Gimp]     [Yosemite News]

  Powered by Linux