Bug 1085029

Summary: Ruby tests fail with latest Ruby
Product: [Community] Virtualization Tools Reporter: Richard W.M. Jones <rjones>
Component: libguestfsAssignee: Pino Toscano <ptoscano>
Status: CLOSED UPSTREAM QA Contact:
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: unspecifiedCC: acathrow, mbooth, ptoscano
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-04-22 12:36:10 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Richard W.M. Jones 2014-04-07 14:57:36 UTC
Description of problem:

The Ruby tests fail with the latest Ruby packages in Rawhide.
(Originally I thought this bug was going to be caused by Ruby 2.1,
but this is NOT with Ruby 2.1 packages).

/builddir/build/BUILD/libguestfs-1.27.3/run --test ./run-ruby-tests
rake test TEST=t/tc_010_load.rb
Warning: you should require 'minitest/autorun' instead.
Warning: or add 'gem "minitest"' before 'require "minitest/autorun"'
From:
  /usr/share/ruby/test/unit.rb:3:in `<top (required)>'
  /builddir/build/BUILD/libguestfs-1.27.3/ruby/t/tc_010_load.rb:18:in `<top (required)>'
  /usr/share/gems/gems/rake-10.0.4/lib/rake/rake_test_loader.rb:15:in `block in <main>'
  /usr/share/gems/gems/rake-10.0.4/lib/rake/rake_test_loader.rb:4:in `select'
  /usr/share/gems/gems/rake-10.0.4/lib/rake/rake_test_loader.rb:4:in `<main>'
MiniTest::Unit::TestCase is now Minitest::Test. From /usr/share/ruby/test/unit/testcase.rb:8:in `<module:Unit>'
/usr/share/ruby/test/unit.rb:670:in `<class:Runner>': undefined method `_run_suite' for class `Test::Unit::Runner' (NameError)
	from /usr/share/ruby/test/unit.rb:255:in `<module:Unit>'
	from /usr/share/ruby/test/unit.rb:9:in `<module:Test>'
	from /usr/share/ruby/test/unit.rb:8:in `<top (required)>'
	from /usr/share/rubygems/rubygems/core_ext/kernel_require.rb:55:in `require'
	from /usr/share/rubygems/rubygems/core_ext/kernel_require.rb:55:in `require'
	from /builddir/build/BUILD/libguestfs-1.27.3/ruby/t/tc_010_load.rb:18:in `<top (required)>'
	from /usr/share/rubygems/rubygems/core_ext/kernel_require.rb:55:in `require'
	from /usr/share/rubygems/rubygems/core_ext/kernel_require.rb:55:in `require'
	from /usr/share/gems/gems/rake-10.0.4/lib/rake/rake_test_loader.rb:15:in `block in <main>'
	from /usr/share/gems/gems/rake-10.0.4/lib/rake/rake_test_loader.rb:4:in `select'
	from /usr/share/gems/gems/rake-10.0.4/lib/rake/rake_test_loader.rb:4:in `<main>'
rake aborted!
Command failed with status (1): [ruby -I"lib:ext/guestfs" -I"/usr/share/gems/gems/rake-10.0.4/lib" "/usr/share/gems/gems/rake-10.0.4/lib/rake/rake_test_loader.rb" "t/tc_010_load.rb" ]
Tasks: TOP => test
(See full trace by running task with --trace)
/builddir/build/BUILD/libguestfs-1.27.3/run: command failed with exit code 1
FAIL: run-ruby-tests

Version-Release number of selected component (if applicable):

libguestfs 1.27.3

DEBUG util.py:281:   ruby-devel                    x86_64 2.0.0.353-17.fc21             build 124 k
DEBUG util.py:281:   ruby-irb                      noarch 2.0.0.353-17.fc21             build  85 k
DEBUG util.py:281:   rubygem-minitest              noarch 5.3.1-1.fc21                  build  46 k
DEBUG util.py:281:   rubygem-rake                  noarch 10.0.4-1.fc20.1               build  59 k

How reproducible:

Unknown, at least once.

Steps to Reproduce:
1. Build & test libguestfs from git with Ruby packages from Rawhide.

Comment 1 Richard W.M. Jones 2014-04-07 19:08:57 UTC
This seems to be because rubygem-minitest version has jumped from
4.x to 5.x.

I was able to reproduce it on Rawhide by updating that package
and running 'make -C ruby check'.

Comment 2 Richard W.M. Jones 2014-04-07 19:24:04 UTC
Uninstalling rubygem-minitest and installing rubygem-unit-test
fixes the problem.  Unfortunately if you install rubygem-minitest
then the test breaks again (even if rubygem-unit-test is installed).

I have no idea what sort of horror in the Ruby language/environment
causes this nonsense.

Comment 3 Pino Toscano 2014-04-18 09:48:05 UTC
Patches posted to mailing list:
  https://www.redhat.com/archives/libguestfs/2014-April/msg00049.html
  https://www.redhat.com/archives/libguestfs/2014-April/msg00050.html

With the above, should be possible to use rubygem-minitest again.