Issue #16277 has been updated by Dominic Cleal.
eric sorenson wrote: > Seems valid, we'll add this to the backlog -- but I'm bumping the target > version as this is not a Telly blocker. Fair enough, I can work around it for 3.x in my spec_helper for now. This was the sort of thing I was thinking could fix it: https://github.com/domcleal/puppet/commit/0d20e53. We'd then call initialize() (probably a bad name actually) from the spec_helper at about the same time it's configuring RSpec, so the libdir's available when instantiating types for testing. Trouble is that Puppet uses the TestHelper for its own tests which include applications which then don't expect settings to have been initialised already, so the re-init of settings in after_each_test() breaks these tests. ---------------------------------------- Bug #16277: Initialise Puppet settings before running tests to enable autoloader https://projects.puppetlabs.com/issues/16277#change-70786 Author: Dominic Cleal Status: Investigating Priority: Normal Assignee: Category: testing Target version: 3.x Affected Puppet version: 3.0.0-rc5 Keywords: testhelper puppetlabs_spec_helper Branch: Puppet::Util::Autoload will only populate search paths once the app default settings have been loaded, which it does by calling `Puppet.settings.app_defaults_initialized?` (see the `module_directories` and `libdirs` methods). Puppet::Test::TestHelper doesn't use the proper initialisation routine of `Puppet.settings.initialize_app_defaults` added in e465c160 and sets settings individually, so the query method above never returns true and autoload never sets up paths as it waits for settings to be initialised. This means when testing a module (via the puppetlabs_spec_helper, which uses TestHelper) the autoload path hasn't been populated and you can't load types etc from other modules. Further to this, the settings were initialised just before each example, so the autoload path isn't available in order to construct types and providers that would later be needed for testing. This is a continuation of #15529, which is filed against puppetlabs_spec_helper. -- You have received this notification because you have either subscribed to it, or are involved in it. To change your notification preferences, please click here: http://projects.puppetlabs.com/my/account -- You received this message because you are subscribed to the Google Groups "Puppet Bugs" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/puppet-bugs?hl=en.
