[DRE-maint] Bug#715013: Tests not automatically run on package build
Robie Basak
robie.basak at ubuntu.com
Fri Jul 5 12:52:35 UTC 2013
Package: ruby-indentation
Version: 0.0.7-1
User: ubuntu-devel at lists.ubuntu.com
Usertags: origin-ubuntu saucy ubuntu-patch
Downstream bug: https://launchpad.net/bugs/1197894
ruby-indentation upstream provides test in spec/indentation_spec.rb, but
these are not automatically run by dh_ruby --test as part of the package
build.
The problem seems to be that although debian/ruby-test-files.yaml lists
spec/indentation_spec.rb, running spec/indentation_spec.rb itself does not
actually run the tests. So I think the problem here is that the packaging makes
assumptions about the tests provided by upstream, which don't hold, so dh_ruby
--test does not test anything.
Adding:
require 'rspec/autorun'
below the rspec require line in spec/spec_helper.rb fixes the problem,
as does adding an override_dh_auto_test of "rspec".
I'm not a Ruby specialist, so I don't know what the best practice fix
for this would be. It looks like using rspec/autotest is optional as far
as rspec upstream are concerned, so if upstream don't want to use it,
then perhaps the Debian packaging should use a different test
specification to dh_ruby, or override dh_auto_test as above.
I've applied the following fix in Ubuntu for now:
diff -Nru ruby-indentation-0.0.7/debian/rules ruby-indentation-0.0.7/debian/rules
--- ruby-indentation-0.0.7/debian/rules 2013-05-06 02:39:32.000000000 +0000
+++ ruby-indentation-0.0.7/debian/rules 2013-07-05 12:38:30.000000000 +0000
@@ -13,3 +13,8 @@
%:
dh $@ --buildsystem=ruby --with ruby
+
+override_dh_auto_test:
+ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
+ rspec
+endif
More information about the Pkg-ruby-extras-maintainers
mailing list