Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

broken by rspec-puppet 1.0.0+ #9

Closed
jhoblitt opened this issue Dec 22, 2013 · 10 comments
Closed

broken by rspec-puppet 1.0.0+ #9

jhoblitt opened this issue Dec 22, 2013 · 10 comments
Labels
Milestone

Comments

@jhoblitt
Copy link

I just hit test failures after running a bundle update. I haven't traced the root cause yet but both rspec-puppet 1.0.0 and 1.0.1 cause an exception to be raised by execute.with_change, aug_get, etc. Downgrading to rspec-puppet 0.1.6 fixes the test failures.

     Failure/Error: should execute.with_change
     ArgumentError:
       wrong number of arguments (0 for 1)
@domcleal
Copy link
Owner

I was relying on what was probably an internal API to rspec-puppet to get at the catalogue for the class. I've sent a PR up to rspec-puppet to make this fully public and restore the old behaviour, so we can easily create new rspec groups built on the existing catalogue: rodjek/rspec-puppet#145

@jhoblitt
Copy link
Author

Nice catch! I'm surprised this hasn't caused more breakage as I've seen a few module tests that mess with catalogue directly.

I don't understand all (most) of the magic that rspec does. Is there no way to access to the subject from a higher scope description block?

@domcleal
Copy link
Owner

rspec gives me a headache too, but I couldn't figure out a way if the subject was redefined.

@mcallaway
Copy link
Contributor

+1

Looks like your PR was merged.

@jhoblitt
Copy link
Author

I'm wondering if #9 should be reverted. puppetlabs_spec_helper now requires rspec-puppet > 1.0.1, so we're into dependency hell even when pulling rspec-puppet from git.

Bundler could not find compatible versions for gem "rspec-puppet":
  In Gemfile:
    rspec-puppet-augeas (= 0.3.0) ruby depends on
      rspec-puppet (< 1.0.0) ruby

    puppetlabs_spec_helper (>= 0) ruby depends on
      rspec-puppet (1.0.1)

jhoblitt pushed a commit to jhoblitt/rspec-puppet-augeas that referenced this issue May 17, 2014
jhoblitt pushed a commit to jhoblitt/puppet-mdadm that referenced this issue May 18, 2014
@wcooley
Copy link

wcooley commented Aug 18, 2014

Out of curiosity, do you even need rspec-puppet? Couldn't you setup and compile the catalog using just puppetlabs_spec_helper?

Presumably you'd also need to co-exist with rspec-puppet, but that's a whole other matter.

@jhoblitt
Copy link
Author

@wcooley puppetlabs_spec_helper depends on rspec-puppet.

@wcooley
Copy link

wcooley commented Aug 18, 2014

@jhoblitt Sure, I did triage on that bug: https://tickets.puppetlabs.com/browse/MODULES-1069

Whether rspec-puppet is ultimately loaded or depended upon is not the question -- the question is whether its API needs to be used (directly).

From a cursory glance, I suspect that everything this project needs is in lib/rspec-puppet/support.rb (and much of that probably belongs in puppetlabs_spec_helper to begin with).

(Maybe I'm a little grumpy that despite a number of requests in the rspec-puppet issue tracker, there hasn't been a new rspec-puppet release in >9 months, so the one project I'm using rspec-puppet-augeas is stuck depending on '< 1.0.0'.)

@jhoblitt
Copy link
Author

@domcleal I'm trying to move my modules that use rspec-puppet-augeas to a current version of rspec-puppet > 1 to support testing with the future parser enabled. Eg.

gem 'rspec-puppet',
  :git => 'https://github.com/rodjek/rspec-puppet.git',
  :ref => '6ac97993fa972a15851a73d55fe3d1c0a85172b5',
  :require => false

The good news is that the issue I originally reported in this ticket appears to have stayed resolved post the merger of your patch. The bad news is that things blowup with the future parser enabled. Do you want to close this issue out and open a new one or get details of that problem here as well?

@domcleal
Copy link
Owner

@jhoblitt I'd like to keep this ticket open until rspec-puppet > 1.0.1 is released, then I can remove the daft pinning of < 1 from r-p-a. Sorry about the state this is in.

If you could open a new ticket for the future parser issue, I'd be interested to read more, as I can't think what I'd need to change off the top of my head.

@domcleal domcleal modified the milestone: v0.4.0 Dec 4, 2014
@domcleal domcleal added the bug label Dec 4, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants