Issue #16277 has been updated by Jeff McCune.
@Dominic
Do you think this issue is the same issue as I'm seeing in this example:
<pre>
$ irb
Welcome to IRB. You are using ruby 1.9.3p194 (2012-04-20 revision 35410)
[x86_64-darwin12.1.0]. Have fun ;)
>> require 'puppet' #=> true>> scope =
>> Puppet::Parser::Scope.new_for_test_harness('example')
Puppet::Error: Could not parse for environment production: Error converting
value for param 'manifest':
Error converting value for param 'manifestdir': Could not find value for
$confdir
from /workspace/puppet-3.x/src/puppet/lib/puppet/settings.rb:252:in
`block in convert'
...
from /workspace/puppet-3.x/src/puppet/lib/puppet/parser/scope.rb:61:in
`new'
from /workspace/puppet-3.x/src/puppet/lib/puppet/parser/scope.rb:61:in
`new_for_test_harness'
from (irb):2
>> scope = Puppet::Parser::Scope.new_for_test_harness('example') #=> Scope()
</pre>
I find it strange that the second invocation works, but the first doesn't.
This leads me to suspect `Puppet.settings.app_defaults_initialized?` is causing
the second call to succeed by side effect after the first call fails.
-Jeff
----------------------------------------
Bug #16277: Initialise Puppet settings before running tests to enable autoloader
https://projects.puppetlabs.com/issues/16277#change-76292
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.