Closed KeithWard closed 4 years ago
Same on puppet 5.5.21
An error occurred while loading ./spec/classes/profile_core_spec.rb.
Failure/Error: require 'puppetlabs_spec_helper/module_spec_helper'
NameError:
undefined local variable or method `default_env' for Puppet::Util:Module
# ./vendor/bundle/ruby/2.4.0/gems/rspec-puppet-2.7.8/lib/rspec-puppet/monkey_patches.rb:139:in `get_env'
# ./vendor/bundle/ruby/2.4.0/gems/puppet-5.5.21/lib/puppet/node/environment.rb:512:in `extralibs'
# ./vendor/bundle/ruby/2.4.0/gems/puppet-5.5.21/lib/puppet/node/environment.rb:50:in `create'
# ./vendor/bundle/ruby/2.4.0/gems/puppet-5.5.21/lib/puppet.rb:209:in `base_context'
# ./vendor/bundle/ruby/2.4.0/gems/puppet-5.5.21/lib/puppet/test/test_helper.rb:53:in `initialize'
# ./vendor/bundle/ruby/2.4.0/gems/rspec-puppet-2.7.8/lib/rspec-puppet.rb:77:in `block in <top (required)>'
# ./vendor/bundle/ruby/2.4.0/gems/rspec-puppet-2.7.8/lib/rspec-puppet.rb:34:in `<top (required)>'
# ./vendor/bundle/ruby/2.4.0/gems/puppetlabs_spec_helper-2.15.0/lib/puppetlabs_spec_helper/module_spec_helper.rb:1:in `require'
# ./vendor/bundle/ruby/2.4.0/gems/puppetlabs_spec_helper-2.15.0/lib/puppetlabs_spec_helper/module_spec_helper.rb:1:in `<top (required)>'
# ./spec/spec_helper.rb:5:in `require'
# ./spec/spec_helper.rb:5:in `<top (required)>'
# ./spec/classes/profile_core_spec.rb:3:in `require'
# ./spec/classes/profile_core_spec.rb:3:in `<top (required)>'
No examples found.
Finished in 0.00004 seconds (files took 1.57 seconds to load)
0 examples, 0 failures, 1 error occurred outside of examples
+1 same problem here
Got a quick fix for this up in a PR that hopefully someone from the maintainers can validate and/or improve since this is my first time dabbling in this repo: https://github.com/rodjek/rspec-puppet/pull/797
@sgnn7 @scotje was it intentional that 2.7.10 bases on 2.7.8 and not 2.7.9?
was it intentional that 2.7.10 bases on 2.7.8 and not 2.7.9?
@dlucredativ I don't know enough about this gem to answer that - the fix is independent of the base version though
was it intentional that 2.7.10 bases on 2.7.8 and not 2.7.9?
@dlucredativ I don't know enough about this gem to answer that - the fix is independent of the base version though
Ok it seems that you only created 73fbbe2f and @scotje cherry-picked it into b6807ebe. I just don't know why.
2.7.9 unintentionally included commits intended for 2.8.x (or 3.x) as they break some peoples existing tests. We yanked the 2.7.9 release and released 2.7.10 which is just 2.7.8 plus only the fix for default_env
.
It looks like default_env was removed in puppet 6.17 - specifically in this commit:
https://github.com/puppetlabs/puppet/commit/94df3c1a3992d89b2d7d5db8a70373c135bdd86b
This results in an exceptiion similar to the following when rspec tries to run tests:
Not sure about what way to go about fixing this.