diff options
-rwxr-xr-x | test/language/parser.rb | 18 | ||||
-rwxr-xr-x | test/language/scope.rb | 7 |
2 files changed, 25 insertions, 0 deletions
diff --git a/test/language/parser.rb b/test/language/parser.rb index 30baea49f..7794c42fe 100755 --- a/test/language/parser.rb +++ b/test/language/parser.rb @@ -444,6 +444,9 @@ file { "/tmp/yayness": def test_virtualresources tests = [:virtual] if Puppet.features.rails? + catalog_cache_class = Puppet::Resource::Catalog.indirection.cache_class + facts_cache_class = Puppet::Node::Facts.indirection.cache_class + node_cache_class = Puppet::Node.indirection.cache_class Puppet[:storeconfigs] = true tests << :exported end @@ -496,11 +499,20 @@ file { "/tmp/yayness": check.call(res, "multiresource") end end + if Puppet.features.rails? + Puppet[:storeconfigs] = false + Puppet::Resource::Catalog.cache_class = catalog_cache_class + Puppet::Node::Facts.cache_class = facts_cache_class + Puppet::Node.cache_class = node_cache_class + end end def test_collections tests = [:virtual] if Puppet.features.rails? + catalog_cache_class = Puppet::Resource::Catalog.indirection.cache_class + facts_cache_class = Puppet::Node::Facts.indirection.cache_class + node_cache_class = Puppet::Node.indirection.cache_class Puppet[:storeconfigs] = true tests << :exported end @@ -523,6 +535,12 @@ file { "/tmp/yayness": assert_instance_of(AST::Collection, coll) assert_equal(form, coll.form) end + if Puppet.features.rails? + Puppet[:storeconfigs] = false + Puppet::Resource::Catalog.cache_class = catalog_cache_class + Puppet::Node::Facts.cache_class = facts_cache_class + Puppet::Node.cache_class = node_cache_class + end end def test_collectionexpressions diff --git a/test/language/scope.rb b/test/language/scope.rb index 77af950f5..32e1802a8 100755 --- a/test/language/scope.rb +++ b/test/language/scope.rb @@ -409,6 +409,9 @@ class TestScope < Test::Unit::TestCase # run, whether it's in the same scope as a collection or a different # scope. def test_storeandcollect + catalog_cache_class = Puppet::Resource::Catalog.indirection.cache_class + facts_cache_class = Puppet::Node::Facts.indirection.cache_class + node_cache_class = Puppet::Node.indirection.cache_class Puppet[:storeconfigs] = true Puppet::Rails.init sleep 1 @@ -442,6 +445,10 @@ Host <<||>>" assert(flat.find{|o| o.name == name }, "Did not find #{name}") end } + Puppet[:storeconfigs] = false + Puppet::Resource::Catalog.cache_class = catalog_cache_class + Puppet::Node::Facts.cache_class = facts_cache_class + Puppet::Node.cache_class = node_cache_class end else $stderr.puts "No ActiveRecord -- skipping collection tests" |