[DRE-maint] Bug#645357: Default tests

Antonio Terceiro terceiro at debian.org
Sun Oct 16 16:50:58 UTC 2011


Gunnar Wolf escreveu isso aí:
> Paul van Tilburg dijo [Sun, Oct 02, 2011 at 09:37:07PM +0200]:
> > (...)
> > As you all know, not all gems ship tests or working tests.  So some libs
> > have tests disabled or no build-time test suite just yet.
> > So, what if we put, by default, a very stupid syntax/load test in the
> > generated debian-dir of a gem2debianized lib (e.g. ruby1.X -r<lib> or
> > ruby -c <lib>.rb).  We would already catch problems such as the one for
> > ruby-rchardet (dbts #643770).  (I also recall Ruby extentions that
> > segfault when loaded by Ruby 1.9.1 in the past).
> > 
> > Now, it maybe hard to determine what <lib> should be in some cases,
> > but if the gem2deb-generated boilerplate by default assumes <lib>
> > to be the argument passed to gem2deb, we can get quite far.
> > (Possible we can also figure it out from the gemspec?) One needs to
> > change the boiler plate anyway, so it's easy to also touch
> > debian/ruby-test.rb and it might even encourage people to fix/expand the
> > tests.
> > 
> > Any thoughts?
> 
> Yes, I find it very sensible. Of course, this could be part of the
> gem2deb procedure, overridable in case <lib> is either not correctly
> guessed, or in case there is more than one library. The ideal would be
> to include every source file shipped as a library - Although there
> are many cases where libraries depend on symbols declared on other
> libraries, so we cannot just do a recursive "ruby -l $foo" on all
> lib/*.rb... But it would be the best way.

We could change gem2deb in a way that it runs something equivalent to
the following unconditionally, independent of the actual unit tests:

$ for ruby in ruby1.8 ruby1.9.1; do for file in $(find lib -name \*.rb); do $ruby -c $file; done; done
Syntax OK
Syntax OK
Syntax OK
Syntax OK
Syntax OK
Syntax OK
Syntax OK
Syntax OK
Syntax OK
Syntax OK
Syntax OK
Syntax OK
Syntax OK
Syntax OK
Syntax OK
Syntax OK
Syntax OK
Syntax OK
Syntax OK
Syntax OK

This would make sure all code has proper syntax, at least for the Ruby versions
the package claims to support.

What do you guys think about this?

-- 
Antonio Terceiro <terceiro at debian.org>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://lists.alioth.debian.org/pipermail/pkg-ruby-extras-maintainers/attachments/20111016/e81e2323/attachment.pgp>


More information about the Pkg-ruby-extras-maintainers mailing list