Issue #16277 has been updated by Dominic Cleal.

Jeff McCune wrote:
> @Dominic
> 
> Do you think this issue is the same issue as I'm seeing in this example:

I'm not sure it's exactly the same, but it's definitely related in the big 
bundle of loading issues.  I would have thought confdir would be initialised - 
I'm pretty sure it would have been in my case, as I was just seeing libdir not 
initialised.
----------------------------------------
Bug #16277: Initialise Puppet settings before running tests to enable autoloader
https://projects.puppetlabs.com/issues/16277#change-76313

Author: Dominic Cleal
Status: Investigating
Priority: Normal
Assignee: 
Category: testing
Target version: 3.x
Affected Puppet version: 3.0.0
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.

Reply via email to