Spec URL: http://www.ephaone.org/~misc/specs/rubygem-rspec-puppet.spec SRPM URL: http://www.ephaone.org/~misc/specs/rubygem-rspec-puppet-0.1.1-1.fc16.src.rpm Description: RSpec tests for your Puppet manifests This package add various modules used to create non regression tests based on RSpec for puppet manifests.
Taking this one.
Ok, so first of all, you should use the macros from rubygem-devel package, which is available from F17 above. [1] Also, please note, that ruby(abi) is 1.9.1 for these. - If you want to use the package in F16 and below or EPEL, you will need to define the all the macros (gem_name, gem_dir, ...) conditionally. - You should mark the LICENSE file as %doc (but leave it in the main package). - You should also mark the README file as %doc, but probably move it to the -doc subpackage. - Otherwise, it would be good to proceed once you convert the specfile to the F17 way (you can use the newest gem2rpm for that). [1] https://fedoraproject.org/wiki/Packaging:Ruby#Macros
Ok, i first need to review the new ruby policy, I have put aside this package until the release of fedora 17 ( waiting until the policy got a little bit more stable and having more time ).
Spec URL: http://nytefyre.net/rpms/rubygem-rspec-puppet.spec SRPM URL: http://http://nytefyre.net/rpms/rubygem-rspec-puppet-0.1.5-1.fc17.src.rpm So I checked this out and think I've got a revised version working. I've tested the build on f17 and centos6 (centos5 blew up.. gem had a buffer overflow ) I'm willing to go forward with this package, if you aren't available to continue reviewing this can you let me know so that I can look for a reviewer. thanks!
Looks much better now, but still some comments: - License is MIT (see the LICENSE file) - Please run specs in %check section, it's always good to make sure that the tests provided with package work on Fedora
* puppet dependency - It seems that there should be Require: puppet, otherwise I get these errors: $ rspec-puppet-init /usr/share/rubygems/rubygems/custom_require.rb:36:in `require': cannot load such file -- puppet (LoadError) from /usr/share/rubygems/rubygems/custom_require.rb:36:in `require' from /usr/share/gems/gems/rspec-puppet-0.1.5/lib/rspec-puppet.rb:1:in `<top (required)>' from /usr/share/rubygems/rubygems/custom_require.rb:36:in `require' from /usr/share/rubygems/rubygems/custom_require.rb:36:in `require' from /usr/share/gems/gems/rspec-puppet-0.1.5/bin/rspec-puppet-init:5:in `<top (required)>' from /usr/bin/rspec-puppet-init:23:in `load' from /usr/bin/rspec-puppet-init:23:in `<main>' $ irb irb(main):001:0> require 'rspec-puppet' LoadError: cannot load such file -- puppet from /usr/share/rubygems/rubygems/custom_require.rb:36:in `require' from /usr/share/rubygems/rubygems/custom_require.rb:36:in `require' from /usr/share/gems/gems/rspec-puppet-0.1.5/lib/rspec-puppet.rb:1:in `<top (required)>' from /usr/share/rubygems/rubygems/custom_require.rb:60:in `require' from /usr/share/rubygems/rubygems/custom_require.rb:60:in `rescue in require' from /usr/share/rubygems/rubygems/custom_require.rb:35:in `require' from (irb):2 from /usr/bin/irb:12:in `<main>' * Missing puppetlabs_spec_helper dependency - After installing puppet, I got another error (show bellow). So it seems there is missing another prerequisite in Fedora. However it looks like to be circular dependency and bootstrap might be required :/ $ irb irb(main):001:0> require 'rspec-puppet' /usr/share/rubygems/rubygems/custom_require.rb:36:in `require': iconv will be deprecated in the future, use String#encode instead. LoadError: cannot load such file -- puppetlabs_spec_helper/puppetlabs_spec/puppet_internals from /usr/share/rubygems/rubygems/custom_require.rb:36:in `require' from /usr/share/rubygems/rubygems/custom_require.rb:36:in `require' from /usr/share/gems/gems/rspec-puppet-0.1.5/lib/rspec-puppet/example/function_example_group.rb:1:in `<top (required)>' from /usr/share/rubygems/rubygems/custom_require.rb:36:in `require' from /usr/share/rubygems/rubygems/custom_require.rb:36:in `require' from /usr/share/gems/gems/rspec-puppet-0.1.5/lib/rspec-puppet/example.rb:4:in `<top (required)>' from /usr/share/rubygems/rubygems/custom_require.rb:36:in `require' from /usr/share/rubygems/rubygems/custom_require.rb:36:in `require' from /usr/share/gems/gems/rspec-puppet-0.1.5/lib/rspec-puppet.rb:6:in `<top (required)>' from /usr/share/rubygems/rubygems/custom_require.rb:60:in `require' from /usr/share/rubygems/rubygems/custom_require.rb:60:in `rescue in require' from /usr/share/rubygems/rubygems/custom_require.rb:35:in `require' from (irb):1 from /usr/bin/irb:12:in `<main>'
So from the original spec file: %check # disabled because this segfault in mock # requires to have a working setup of puppet # see # https://github.com/rodjek/rspec-puppet/issues/15 # https://projects.puppetlabs.com/issues/11191 #mkdir -p ~/.puppet/manifests/ #touch ~/.puppet/manifests/site.pp #cd %{buildroot}%{geminstdir} #rake spec --trace I can add it in commented, and I should have since I saw it in the original, but it doesn't seem to be a 'good' idea to enable based on this. Thoughts?
The test suite pases for me: $ rspec /usr/share/rubygems/rubygems/custom_require.rb:36:in `require': iconv will be deprecated in the future, use String#encode instead. Mocha deprecation warning: Test::Unit or MiniTest must be loaded *before* Mocha. Mocha deprecation warning: If you're integrating with another test library, you should probably require 'mocha_standalone' instead of 'mocha' ....................... Finished in 0.69772 seconds 23 examples, 0 failures However, I had to install the puppet_labs_helper which pulled in other dependencies: $ gem list *** LOCAL GEMS *** bigdecimal (1.1.0) diff-lcs (1.1.3) io-console (0.3) json (1.6.5) metaclass (0.0.1) mocha (0.12.6) puppetlabs_spec_helper (0.3.0) rake (0.9.2.2) rdoc (3.12) rspec (2.11.0, 2.8.0) rspec-core (2.11.1, 2.8.0) rspec-expectations (2.11.3, 2.8.0) rspec-mocks (2.11.3, 2.8.0) rspec-puppet (0.1.5) So there is a chance that the test suite will run as soon as the dependencies will be available.
Please note that I did not need to create the site.pp file or anything else.
As Vit points out, the specs are runnable with the puppetlabs_spec_helper Gem, so I would advise to first package that one. As mentioned in Comment 6, it is also needed to do "require 'rspec-puppet'", e.g. this Gem won't work without it. So please first package puppetlabs_spec_helper.
(In reply to comment #10) > As Vit points out, the specs are runnable with the puppetlabs_spec_helper > Gem, so I would advise to first package that one. As mentioned in Comment 6, > it is also needed to do "require 'rspec-puppet'", e.g. this Gem won't work > without it. So please first package puppetlabs_spec_helper. This is where things get entertaining. From puppetlabs_spec_helper.gemspec : s.add_dependency(%q<rspec-puppet>, [">= 0.1.1"]) So in order to install puppetlabs_spec_helper rspec-puppet needs to already be there. However to actually run rspec-puppet you need puppetlabs_spec_helper... https://github.com/rodjek/rspec-puppet/issues/56 Is this a full stop issue until upstream sorts things out?
I've filed an upstream bug against puppetlabs_spec_helper to refactor the gem to no longer require rspec-puppet but it's gotten no response. https://projects.puppetlabs.com/issues/18913 Thankfully the maintainer of rspec-puppet has committed to refactoring his gem so that it will no longer require puppetlabs_spec_helper in order to resolve the circular dependency issue. https://github.com/rodjek/rspec-puppet/issues/56#issuecomment-12667834
Looks like rspec-puppet folks submitted a workaround: https://github.com/rodjek/rspec-puppet/issues/56 It's not ideal but as far as I can see there should be no dependency cycle anymore.
Since there seems to be no progress here, I'm closing this bug. Feel free to reopen if you wish to restart the review.
We still might want to bring that package into RDO. There is ongoing work with pre-generating puppet catalogs that relies on that puppet-rspec gem to present in puppet config containers...