Issue #17543 has been updated by Josh Cooper. Status changed from Investigating to Accepted Branch set to https://github.com/joshcooper/puppet/tree/ticket/master/17543-reinitialize_app_defaults
The issue occurs because `Puppet::Test::TestHelper.after_each_test` clears all of the settings, including the fact that app_defaults have been initialized. So when the second, third, etc rspec example runs, the `Puppet::Util::Autoload.search_directories` method gets called, and the `libdirs` and `module_directories` methods return empty arrays, assuming puppet is still in its bootstrapping phase (before app settings has been initialized). Since puppet's test_helper clears the settings it makes sense for it to initialize them also. It tries to do this by setting individual settings, but it should be at least initializing app_default_settings. I have a branch here, which resolves the issue for `rspec-puppet-test`, but it would be great to get some more feedback: <https://github.com/joshcooper/puppet/tree/ticket/master/17543-reinitialize_app_defaults> ---------------------------------------- Bug #17543: Puppet 3.0 rspec and custom resources no longer work https://projects.puppetlabs.com/issues/17543#change-78583 Author: Ashley Penney Status: Accepted Priority: Normal Assignee: eric sorenson Category: Target version: 3.1.0 Affected Puppet version: 3.0.0 Keywords: Branch: https://github.com/joshcooper/puppet/tree/ticket/master/17543-reinitialize_app_defaults Based on https://groups.google.com/forum/?fromgroups#!topic/puppet-users/l8jzYibbSL8 thread multiple users have reported they can no longer run their unit tests on modules. The problem lies in custom resources/functions, and can be easily tested with puppet 3.0 and puppetlabs-apt from github. When you run the tests you'll see failures along the lines of: Error: Puppet::Parser::AST::Resource failed with error ArgumentError: Invalid resource type anchor at /home/nrhuff/repos/puppet-os/spec/fixtures/modules/os/manifests/init.pp:2 on node enyo.localhost One of the users suffering this problem dug in further as mentioned on the list and said: <cite> So I dug into this a little more. It has something to do with how puppet is loading the type definitions. There appears to be some kind of cache that gets loaded with type definitions when the first manifest gets processed. If the first test that gets run is for a class that contains all the types necessary for classes that get tested later everything runs fine. If on the other hand if the first test run is for a class that doesn't contain all the types used in later classes the later test fails. </cite> -- 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.
