Le 23 février 2012 23:18, Cédric Boutillier
<cedric.boutillier@gmail.com> a écrit :
Hi Vincent,
Hi Cedric
On Thu, Feb 23, 2012 at 08:53:05PM +0100, Vincent Carmona wrote:
> Hello all
> I am working on the packaging of ruby-taglib2 0.1.5 for debian. My work can
> be seen in the git repository of the team.
> The actual state of the repository leads to a failure of the building
> process due to errors during tests.
> I can now reproduce these test errors by running tests with ruby 1.8
> whereas the library was build with ruby1.9.
> If XS-Ruby-Versions field of d/control file is changed from 'all' to
> "ruby1.8" or "ruby1.9.1" the package is correctly built.
> I believe gem2deb is running tests with the wrong version of the library.
> Can you confirm this assumption? Or did I mess up somewhere with my
> packaging?
I think I spotted a possible cause of the error: in tests/tests.rb, the
Ruby LOAD_PATH is overriden to load the library from lib/. I commented
out some of theses commands (and a few more related to compat, just to
be sure). And now the tests for Ruby1.8 are passing, but I got
complaints about tests/tmp not empty when running the tests for
Ruby1.9.1. (patch attached).
Thanks for spotting that LOAD_PATH is overriden. I failed to see it until now!
I removed then ruby-minitest_after_tests from debian/patches/series, and
I got the tests running for Ruby1.9.1 too, except 2 errors:
************************************************
taglib2 version 0.1.5
Run options: --seed 32447
# Running tests:
.............TagLib: Could not open file /home/boutil/debian/pkg-ruby-extras/ruby-taglib2/tests/tmp/read.wav
ETagLib: Could not open file /home/boutil/debian/pkg-ruby-extras/ruby-taglib2/tests/tmp/exceptions.ogg
TagLib: Ogg::File::packet() -- Could not find the requested packet.
TagLib: Vorbis::File::read() - Could not find the Vorbis comment header.
..TagLib: Could not open file /home/boutil/debian/pkg-ruby-extras/ruby-taglib2/tests/tmp/read.wav
.TagLib: Could not open file /home/boutil/debian/pkg-ruby-extras/ruby-taglib2/tests/tmp/read.wav
TagLib: Ogg::File::packet() -- Could not find the requested packet.
TagLib: Vorbis::File::read() - Could not find the Vorbis comment header.
.TagLib: Could not open file /home/boutil/debian/pkg-ruby-extras/ruby-taglib2/tests/tmp/write.wav
ETagLib: Could not open file /home/boutil/debian/pkg-ruby-extras/ruby-taglib2/tests/tmp/exceptions.ogg
TagLib: Ogg::File::packet() -- Could not find the requested packet.
TagLib: Vorbis::File::read() - Could not find the Vorbis comment header.
.TagLib: Could not open file /home/boutil/debian/pkg-ruby-extras/ruby-taglib2/tests/tmp/read.wav
.
Finished tests in 0.002533s, 8291.7135 tests/s, 7896.8700 assertions/s.
1) Error:
test_readtag(TagLibFileTest):
TagLib::BadTag: Bad tag
/home/boutil/debian/pkg-ruby-extras/ruby-taglib2/tests/file.rb:67:in `title'
/home/boutil/debian/pkg-ruby-extras/ruby-taglib2/tests/file.rb:67:in `check_tag'
/home/boutil/debian/pkg-ruby-extras/ruby-taglib2/tests/file.rb:79:in `test_readtag'
/usr/lib/ruby/vendor_ruby/minitest/unit.rb:1036:in `run'
/usr/lib/ruby/vendor_ruby/minitest/unit.rb:825:in `block in _run_suite'
/usr/lib/ruby/vendor_ruby/minitest/unit.rb:818:in `map'
/usr/lib/ruby/vendor_ruby/minitest/unit.rb:818:in `_run_suite'
/usr/lib/ruby/vendor_ruby/minitest/unit.rb:805:in `block in _run_suites'
/usr/lib/ruby/vendor_ruby/minitest/unit.rb:805:in `map'
/usr/lib/ruby/vendor_ruby/minitest/unit.rb:805:in `_run_suites'
/usr/lib/ruby/vendor_ruby/minitest/unit.rb:778:in `_run_anything'
/usr/lib/ruby/vendor_ruby/minitest/unit.rb:947:in `run_tests'
/usr/lib/ruby/vendor_ruby/minitest/unit.rb:934:in `block in _run'
/usr/lib/ruby/vendor_ruby/minitest/unit.rb:933:in `each'
/usr/lib/ruby/vendor_ruby/minitest/unit.rb:933:in `_run'
/usr/lib/ruby/vendor_ruby/minitest/unit.rb:922:in `run'
/usr/lib/ruby/vendor_ruby/minitest/unit.rb:690:in `block in autorun'
2) Error:
test_write(TagLibFileTest):
TagLib::BadTag: Bad tag
/home/boutil/debian/pkg-ruby-extras/ruby-taglib2/tests/file.rb:90:in `title='
/home/boutil/debian/pkg-ruby-extras/ruby-taglib2/tests/file.rb:90:in `test_write'
/usr/lib/ruby/vendor_ruby/minitest/unit.rb:1036:in `run'
/usr/lib/ruby/vendor_ruby/minitest/unit.rb:825:in `block in _run_suite'
/usr/lib/ruby/vendor_ruby/minitest/unit.rb:818:in `map'
/usr/lib/ruby/vendor_ruby/minitest/unit.rb:818:in `_run_suite'
/usr/lib/ruby/vendor_ruby/minitest/unit.rb:805:in `block in _run_suites'
/usr/lib/ruby/vendor_ruby/minitest/unit.rb:805:in `map'
/usr/lib/ruby/vendor_ruby/minitest/unit.rb:805:in `_run_suites'
/usr/lib/ruby/vendor_ruby/minitest/unit.rb:778:in `_run_anything'
/usr/lib/ruby/vendor_ruby/minitest/unit.rb:947:in `run_tests'
/usr/lib/ruby/vendor_ruby/minitest/unit.rb:934:in `block in _run'
/usr/lib/ruby/vendor_ruby/minitest/unit.rb:933:in `each'
/usr/lib/ruby/vendor_ruby/minitest/unit.rb:933:in `_run'
/usr/lib/ruby/vendor_ruby/minitest/unit.rb:922:in `run'
/usr/lib/ruby/vendor_ruby/minitest/unit.rb:690:in `block in autorun'
21 tests, 20 assertions, 0 failures, 2 errors, 0 skips
********************************
For some reasons, the files in tests/tmp seem to be deleted just before
they are copied, and the
MiniTest::Unit.after_tests{FileUtils.remove_entry_secure(tmp)} seems not
to wait for the end of tests. That is certainly the reason for the
presence of ruby-minitest_after_tests patch...
That is the reason of ruby-minitest_after_tests patch.
I need to find a better way to fix that problem.
I hope it will help you to go further.
Best wishes,
Cédric