voxpupuli / onceover

Your gateway drug to automated infrastructure testing with Puppet
141 stars 45 forks source link

NoMethodError: undefined method `each' for :defaults:Symbol #255

Closed smortex closed 4 years ago

smortex commented 4 years ago

Hi!

Just when I am about to go on vacation, I hit this:

romain@marvin ~ % bundle exec onceover run spec --force --parallel=4 --trace
# ... r10k output
Error while running: #<NoMethodError: undefined method `each' for :defaults:Symbol>
(erb):23:in `write_spec_helper'
/usr/lib/ruby/2.5.0/erb.rb:876:in `eval'
/usr/lib/ruby/2.5.0/erb.rb:876:in `result'
/home/romain/.bundle/vendor/gems/onceover-3.15.0/lib/onceover/controlrepo.rb:565:in `evaluate_template'
/home/romain/.bundle/vendor/gems/onceover-3.15.0/lib/onceover/testconfig.rb:226:in `write_spec_helper'
/home/romain/.bundle/vendor/gems/onceover-3.15.0/lib/onceover/runner.rb:34:in `prepare!'
/home/romain/.bundle/vendor/gems/onceover-3.15.0/lib/onceover/cli/run.rb:50:in `block (2 levels) in command'
/home/romain/.bundle/vendor/gems/cri-2.15.10/lib/cri/command.rb:360:in `run_this'
/home/romain/.bundle/vendor/gems/cri-2.15.10/lib/cri/command.rb:296:in `run'
/home/romain/.bundle/vendor/gems/cri-2.15.10/lib/cri/command.rb:314:in `run'
/home/romain/.bundle/vendor/gems/cri-2.15.10/lib/cri/command.rb:314:in `run'
/home/romain/.bundle/vendor/gems/onceover-3.15.0/bin/onceover:7:in `<top (required)>'
/home/romain/.bundle/vendor/bin/onceover:23:in `load'
/home/romain/.bundle/vendor/bin/onceover:23:in `<main>'

This happened after I updated my bundle:

romain@marvin ~ % bundle update
Fetching https://github.com/opus-codium/melt.git
Fetching https://github.com/mcanevet/puppet-lint-roles_and_profiles-check.git
Fetching gem metadata from https://rubygems.org/...........
Fetching gem metadata from https://rubygems.org/.
Resolving dependencies...
Using rake 13.0.1
Using backticks 1.0.2
Using blockenspiel 0.5.0
Using bundler 1.17.3
Using colored 1.2
Using deep_merge 1.2.1
Using diff-lcs 1.3
Using facter 2.5.7
Using multipart-post 2.1.1
Using fast_gettext 1.1.2
Using locale 2.1.3
Using text 1.3.1
Using rchardet 1.8.0
Using hiera 3.6.0
Using hocon 1.3.0
Using httpclient 2.8.3
Using ipaddress 0.8.3
Using little-plugger 1.1.4
Using log4r 1.1.10
Using multi_json 1.14.1
Using thor 1.0.1
Using minitar 0.9
Using mocha 1.11.2
Using parallel 1.19.1
Using semantic_puppet 1.0.2
Using pathspec 0.2.1
Using puppet-lint 2.3.6
Using rspec-support 3.9.2
Using table_print 1.5.6
Using versionomy 0.5.0
Using faraday 0.17.3
Using gettext 3.2.9
Using git 1.6.0
Using puppet-resource_api 1.8.12
Using logging 2.2.2
Using melt 0.1.0 from https://github.com/opus-codium/melt.git (at master@7158506)
Using concurrent-ruby 1.1.6
Using parallel_tests 2.31.0
Using rspec-core 3.9.1
Using rspec-expectations 3.9.0
Using rspec-mocks 3.9.1
Using puppet-lint-absolute_template_path 1.0.1
Using puppet-lint-duplicate_class_parameters-check 1.0.5
Using puppet-lint-legacy_facts-check 1.0.3
Using puppet-lint-param-types 0.0.1
Using puppet-lint-resource_reference_syntax 1.0.14
Using puppet-lint-roles_and_profiles-check 0.1.1 from https://github.com/mcanevet/puppet-lint-roles_and_profiles-check.git (at e550b7f@e550b7f)
Fetching cri 2.15.10 (was 2.15.6)
Using colored2 3.1.2
Using puppet-lint-strict_indent-check 2.0.7
Using puppet-lint-template_file_extension-check 0.1.2
Using puppet-lint-top_scope_facts-check 1.0.1
Using puppet-lint-trailing_comma-check 0.4.2
Using puppet-lint-trailing_newline-check 1.1.0
Using puppet-lint-unquoted_string-check 1.0.0
Using puppet-lint-variable_contains_upcase 1.2.0
Using puppet-lint-world_writable_files-check 0.0.2
Using faraday_middleware 0.13.1
Using gettext-setup 0.34
Using puppet 6.13.0
Using rspec_junit_formatter 0.4.1
Using rspec 3.9.0
Using puppet_forge 2.3.3
Using puppet-syntax 2.6.1
Using rspec-puppet 2.7.8
Using puppetlabs_spec_helper 2.14.1
Installing cri 2.15.10 (was 2.15.6)
Fetching r10k 3.4.1 (was 3.4.0)
Installing r10k 3.4.1 (was 3.4.0)
Using onceover 3.15.0
Bundle updated!

Looks like the r10k update allowed a more recent version of cri which is causing trouble, but I had no much time to dig in this deeper.

jessereynolds commented 4 years ago

I'm hitting this too. Pinning r10k to 3.4.0 works around the issue.

alexjfisher commented 4 years ago

It looks like the problem is actually having a newer version of cri (which r10k 3.4.1 allows). See https://github.com/puppetlabs/r10k/pull/1019