#489 Ruby guidelines: Updates for Minitest 5
Closed: Fixed None Opened 9 years ago by ktdreyer.

I'd like to propse the following [1] change into the Ruby packaging guidelines.

The testrb utility is deprecated and is not present in newer Ruby versions. The testrb utility should not be used during %check.

Instead of testrb, users should call ruby directly in the %check section, like so:

{{{
ruby -Ilib -e 'Dir.glob "./test/test_*.rb", &method(:require)'
}}}

You may need to adjust -Ilib to be -Ilib:test, or you may need to use a slightly different matching pattern for test_*.rb, etc. Packagers are expected to use the right pattern for each gem.

[1] https://fedoraproject.org/w/index.php?title=PackagingDrafts%2FRuby&diff=400075&oldid=379237


Please note that there might necessary also changes to Test::UNIT chapter:

https://lists.fedoraproject.org/pipermail/ruby-sig/2015-January/001729.html

We discussed this at this weeks meeting (​http://meetbot.fedoraproject.org/fedora-meeting-1/2015-01-08/fpc.2015-01-08-17.01.txt), summary is:

  • 489 Ruby guidelines: Updates for Minitest 5 (geppetto, 17:34:46)

  • LINK: https://fedorahosted.org/fpc/ticket/489 (geppetto, 17:34:46)
  • ACTION: Would be nice if one of the main ruby packagers for Fedora
    could make a macro for this. (geppetto, 17:40:48)
  • ACTION: Ruby guidelines: Update guidelines due to lack of testrb
    (+1:7, 0:0, -1:1) (geppetto, 17:45:30)

I am afraid the macro wouldn't be much better, since you very often need to adjust:

  • the globbing pattern, there are files such as test_.rb or _test.rb, sometime they could be even called *_spec.rb, they might be in various subdirectories, sometimes depends what is the current directory during execution.
  • the directories which are included by the -I parameter
  • additional files to require by -r parameter

And I believe that the testrb was removed in Ruby 2.2 since it did not fulfilled exactly the same expectations you have from the macro. This is still definitely better then using something like find and xarg, which people were doing quite often. Ruby developers typically tends to execute the test suite using Rake, but that on the other hand typically require more build dependencies.

BTW this applies not just to Ruby 2.2 and F21, but also to packages which are using MiniTest 5.x (which we have in F21 already), since testrb supports only MiniTest 4.x. Most of the packages went through this change already.

Announcement text:

The Ruby guidelines have been updated to account for the removal of the testrb utility. https://fedoraproject.org/wiki/Packaging:Ruby

Metadata Update from @vondruch:
- Issue assigned to tibbs

7 years ago

Login to comment on this ticket.

Metadata