Uploaded image for project: 'Puppet'
  1. Puppet
  2. PUP-5601

Puppet settings not setup prior to test runs due to PUP-1118 implementation

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Normal
    • Resolution: Cannot Reproduce
    • Affects Version/s: PUP 3.5.0, PUP 3.5.1, PUP 3.6.0, PUP 3.6.1, PUP 3.6.2, PUP 3.7.0, PUP 3.7.1, PUP 3.7.2, PUP 3.7.3, PUP 3.7.4, PUP 3.7.5, PUP 3.8.0, PUP 3.8.1, PUP 3.8.2, PUP 3.8.3, PUP 3.8.4
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None
    • Template:

      Description

      I believe I have found a regression for https://projects.puppetlabs.com/issues/15529.
      With the removal of as part of initialize_settings_before_each from the Puppet::Test::TestHelper.initalize as part of https://github.com/puppetlabs/puppet/commit/8781d0da2fe6ad2fef954c8c2da54d573181d561#diff-0f072f04864a42b92c59db020665c212L36, if you attempt to access any internals via PuppetlabsSpec::PuppetInternals.scope before a test is run then rspec will error. The resulting error seems to be a regression for https://projects.puppetlabs.com/issues/15529 where this was added in to the TestHelper in the first place.

      The resulting error and stack trace is:

      /Users/aschultz/.rvm/gems/ruby-2.1.5@fuel/gems/puppet-3.8.4/lib/puppet/settings.rb:1348:in `block in convert': Error converting value for param 'modulepath': Error converting value for param 'basemodulepath': Could not find value for $confdir (Puppet::Settings::InterpolationError)
      from /Users/aschultz/.rvm/gems/ruby-2.1.5@fuel/gems/puppet-3.8.4/lib/puppet/settings.rb:1337:in `gsub'
      from /Users/aschultz/.rvm/gems/ruby-2.1.5@fuel/gems/puppet-3.8.4/lib/puppet/settings.rb:1337:in `convert'
      from /Users/aschultz/.rvm/gems/ruby-2.1.5@fuel/gems/puppet-3.8.4/lib/puppet/settings.rb:1315:in `interpolate'
      from /Users/aschultz/.rvm/gems/ruby-2.1.5@fuel/gems/puppet-3.8.4/lib/puppet/settings.rb:1345:in `block in convert'
      from /Users/aschultz/.rvm/gems/ruby-2.1.5@fuel/gems/puppet-3.8.4/lib/puppet/settings.rb:1337:in `gsub'
      from /Users/aschultz/.rvm/gems/ruby-2.1.5@fuel/gems/puppet-3.8.4/lib/puppet/settings.rb:1337:in `convert'
      from /Users/aschultz/.rvm/gems/ruby-2.1.5@fuel/gems/puppet-3.8.4/lib/puppet/settings.rb:1315:in `interpolate'
      from /Users/aschultz/.rvm/gems/ruby-2.1.5@fuel/gems/puppet-3.8.4/lib/puppet/settings.rb:1060:in `value'
      from /Users/aschultz/.rvm/gems/ruby-2.1.5@fuel/gems/puppet-3.8.4/lib/puppet/node/environment.rb:67:in `new'
      from /Users/aschultz/.rvm/gems/ruby-2.1.5@fuel/gems/puppetlabs_spec_helper-1.0.1/lib/puppetlabs_spec_helper/puppetlabs_spec/puppet_internals.rb:53:in `node'
      from /Users/aschultz/.rvm/gems/ruby-2.1.5@fuel/gems/puppetlabs_spec_helper-1.0.1/lib/puppetlabs_spec_helper/puppetlabs_spec/puppet_internals.rb:42:in `compiler'
      from /Users/aschultz/.rvm/gems/ruby-2.1.5@fuel/gems/puppetlabs_spec_helper-1.0.1/lib/puppetlabs_spec_helper/puppetlabs_spec/puppet_internals.rb:18:in `scope'
      from /Users/aschultz/Documents/workspace/fuel/fuel-library/tests/noop/spec/lib/helpers.rb:19:in `puppet_scope'
      from /Users/aschultz/Documents/workspace/fuel/fuel-library/tests/noop/spec/lib/helpers.rb:32:in `puppet_function'
      from /Users/aschultz/Documents/workspace/fuel/fuel-library/tests/noop/spec/hosts/ceilometer/controller_spec.rb:15:in `block (2 levels) in <top (required)>'
      from /Users/aschultz/.rvm/gems/ruby-2.1.5@fuel/gems/rspec-core-3.4.1/lib/rspec/core/example_group.rb:374:in `module_exec'
      from /Users/aschultz/.rvm/gems/ruby-2.1.5@fuel/gems/rspec-core-3.4.1/lib/rspec/core/example_group.rb:374:in `block in find_and_eval_shared'
      from /Users/aschultz/.rvm/gems/ruby-2.1.5@fuel/gems/rspec-core-3.4.1/lib/rspec/core/example_group.rb:740:in `with_frame'
      from /Users/aschultz/.rvm/gems/ruby-2.1.5@fuel/gems/rspec-core-3.4.1/lib/rspec/core/example_group.rb:373:in `find_and_eval_shared'
      from /Users/aschultz/.rvm/gems/ruby-2.1.5@fuel/gems/rspec-core-3.4.1/lib/rspec/core/example_group.rb:341:in `include_examples'
      from /Users/aschultz/Documents/workspace/fuel/fuel-library/tests/noop/spec/shared-examples.rb:60:in `block in <top (required)>'
      from /Users/aschultz/.rvm/gems/ruby-2.1.5@fuel/gems/rspec-core-3.4.1/lib/rspec/core/example_group.rb:374:in `module_exec'
      from /Users/aschultz/.rvm/gems/ruby-2.1.5@fuel/gems/rspec-core-3.4.1/lib/rspec/core/example_group.rb:374:in `block in find_and_eval_shared'
      from /Users/aschultz/.rvm/gems/ruby-2.1.5@fuel/gems/rspec-core-3.4.1/lib/rspec/core/example_group.rb:740:in `with_frame'
      from /Users/aschultz/.rvm/gems/ruby-2.1.5@fuel/gems/rspec-core-3.4.1/lib/rspec/core/example_group.rb:373:in `find_and_eval_shared'
      from /Users/aschultz/.rvm/gems/ruby-2.1.5@fuel/gems/rspec-core-3.4.1/lib/rspec/core/example_group.rb:341:in `include_examples'
      from /Users/aschultz/Documents/workspace/fuel/fuel-library/tests/noop/spec/shared-examples.rb:126:in `block in run_test'
      from /Users/aschultz/.rvm/gems/ruby-2.1.5@fuel/gems/rspec-core-3.4.1/lib/rspec/core/example_group.rb:385:in `module_exec'
      from /Users/aschultz/.rvm/gems/ruby-2.1.5@fuel/gems/rspec-core-3.4.1/lib/rspec/core/example_group.rb:385:in `subclass'
      from /Users/aschultz/.rvm/gems/ruby-2.1.5@fuel/gems/rspec-core-3.4.1/lib/rspec/core/example_group.rb:255:in `block in define_example_group_method'
      from /Users/aschultz/Documents/workspace/fuel/fuel-library/tests/noop/spec/shared-examples.rb:116:in `run_test'
      from /Users/aschultz/Documents/workspace/fuel/fuel-library/tests/noop/spec/shared-examples.rb:76:in `test_ubuntu_and_centos'
      from /Users/aschultz/Documents/workspace/fuel/fuel-library/tests/noop/spec/hosts/ceilometer/controller_spec.rb:53:in `block in <top (required)>'
      from /Users/aschultz/.rvm/gems/ruby-2.1.5@fuel/gems/rspec-core-3.4.1/lib/rspec/core/example_group.rb:385:in `module_exec'
      from /Users/aschultz/.rvm/gems/ruby-2.1.5@fuel/gems/rspec-core-3.4.1/lib/rspec/core/example_group.rb:385:in `subclass'
      from /Users/aschultz/.rvm/gems/ruby-2.1.5@fuel/gems/rspec-core-3.4.1/lib/rspec/core/example_group.rb:255:in `block in define_example_group_method'
      from /Users/aschultz/.rvm/gems/ruby-2.1.5@fuel/gems/rspec-core-3.4.1/lib/rspec/core/dsl.rb:43:in `block in expose_example_group_alias'
      from /Users/aschultz/.rvm/gems/ruby-2.1.5@fuel/gems/rspec-core-3.4.1/lib/rspec/core/dsl.rb:82:in `block (2 levels) in expose_example_group_alias_globally'
      from /Users/aschultz/Documents/workspace/fuel/fuel-library/tests/noop/spec/hosts/ceilometer/controller_spec.rb:5:in `<top (required)>'
      from /Users/aschultz/.rvm/gems/ruby-2.1.5@fuel/gems/rspec-core-3.4.1/lib/rspec/core/configuration.rb:1361:in `load'
      from /Users/aschultz/.rvm/gems/ruby-2.1.5@fuel/gems/rspec-core-3.4.1/lib/rspec/core/configuration.rb:1361:in `block in load_spec_files'
      from /Users/aschultz/.rvm/gems/ruby-2.1.5@fuel/gems/rspec-core-3.4.1/lib/rspec/core/configuration.rb:1359:in `each'
      from /Users/aschultz/.rvm/gems/ruby-2.1.5@fuel/gems/rspec-core-3.4.1/lib/rspec/core/configuration.rb:1359:in `load_spec_files'
      from /Users/aschultz/.rvm/gems/ruby-2.1.5@fuel/gems/rspec-core-3.4.1/lib/rspec/core/runner.rb:102:in `setup'
      from /Users/aschultz/.rvm/gems/ruby-2.1.5@fuel/gems/rspec-core-3.4.1/lib/rspec/core/runner.rb:88:in `run'
      from /Users/aschultz/.rvm/gems/ruby-2.1.5@fuel/gems/rspec-core-3.4.1/lib/rspec/core/runner.rb:73:in `run'
      from /Users/aschultz/.rvm/gems/ruby-2.1.5@fuel/gems/rspec-core-3.4.1/lib/rspec/core/runner.rb:41:in `invoke'
      from /Users/aschultz/.rvm/gems/ruby-2.1.5@fuel/gems/rspec-core-3.4.1/exe/rspec:4:in `<top (required)>'
      from /Users/aschultz/.rvm/gems/ruby-2.1.5@fuel/bin/rspec:23:in `load'
      from /Users/aschultz/.rvm/gems/ruby-2.1.5@fuel/bin/rspec:23:in `<main>'

      I was able to fix this in by code by adding the initalize_app_defaults code (https://github.com/puppetlabs/puppet/blob/master/lib/puppet/test/test_helper.rb#L211) into my spec helper and running it prior to testing.

      The code for this is over at https://review.openstack.org/#/c/242638/4

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              mwhahaha Alex Schultz
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Zendesk Support