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

Fix tests to work with rspec-puppet 2.8.0 #93

Merged
merged 1 commit into from
Nov 16, 2020

Conversation

alexjfisher
Copy link
Member

2.7.9 contains rodjek/rspec-puppet#781 and that
appears to have broken our tests. Fix was pretty simple, but not sure
the rspec-puppet PR was meant to break existing test suites like this.

@alexjfisher alexjfisher mentioned this pull request Jul 15, 2020
@chrekh
Copy link
Contributor

chrekh commented Jul 15, 2020

It looks right, but doesn't work with the PDK I'm using

$ rpm -q pdk
pdk-1.18.0.0-1.el8.x86_64

$ pdk test unit
...
Failures:

  1) chrony on archlinux-5-x86_64 chrony::config using defaults 
     Failure/Error: it { is_expected.to contain_file('/etc/chrony.keys').with_content(sensitive("0 xyzzy\n")) }
     
     NoMethodError:
       undefined method `sensitive' for #<RSpec::ExampleGroups::Chrony::OnArchlinux5X8664::ChronyConfig::UsingDefaults:0x00000000074279d8>
     # /opt/puppetlabs/pdk/share/cache/ruby/2.5.0/gems/rspec-puppet-2.7.8/lib/rspec-puppet/matchers/dynamic_matchers.rb:7:in `method_missing'
     # ./spec/classes/chrony_spec.rb:42:in `block (6 levels) in <top (required)>'

@alexjfisher
Copy link
Member Author

It looks right, but doesn't work with the PDK I'm using

pdk bundle update rspec-puppet might work?

@chrekh
Copy link
Contributor

chrekh commented Jul 15, 2020

It looks right, but doesn't work with the PDK I'm using

pdk bundle update rspec-puppet might work?

Indeed it did. Thanks!

@ekohl
Copy link
Member

ekohl commented Jul 15, 2020

pdk bundle update rspec-puppet might work?

I'm wondering if we should require rspec-puppet >= 2.7.9 in Gemfile. While it's part of the PDK, that makes it clear we really need that version to work.

@alexjfisher
Copy link
Member Author

From slack...

we’ll work on a PDK release that includes that package
in the interim, pdk bundle update rspec-puppet might also work

@alexjfisher
Copy link
Member Author

rspec-puppet 2.7.9 has been yanked from rubygems

2.7.9 contained rodjek/rspec-puppet#781 and that
broke our tests.

2.7.9 was pulled from rubygems, but this breaking change is back in
2.8.0 :(
@alexjfisher alexjfisher force-pushed the fix_rspec_puppet_2_7_9 branch from f5827f6 to f3814fa Compare November 16, 2020 19:28
@alexjfisher alexjfisher changed the title Fix tests to work with rspec-puppet 2.7.9 Fix tests to work with rspec-puppet 2.8.0 Nov 16, 2020
@alexjfisher
Copy link
Member Author

2.8.0 of rspec-puppet has been released, and contains the breaking changes originally introduced in 2.7.9, (but then reverted and yanked from rubygems). I've reopened this PR and rebased. Hopefully the fix is still the same.

@kenyon kenyon merged commit 9119507 into voxpupuli:master Nov 16, 2020
@alexjfisher alexjfisher deleted the fix_rspec_puppet_2_7_9 branch November 16, 2020 21:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants