summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrice Figureau <brice-puppet@daysofwonder.com>2009-05-01 13:26:00 +0200
committerJames Turnbull <james@lovedthanlost.net>2009-05-15 09:56:58 +1000
commit2d580c257e6d8aa0821fd443e8b817027407212c (patch)
tree97849c93ab68fa02c41d3d0e4ceeefd76946f23e
parent8c718c9f678809ad7bc6a0cc5b5356847a625ca5 (diff)
downloadpuppet-2d580c257e6d8aa0821fd443e8b817027407212c.tar.gz
puppet-2d580c257e6d8aa0821fd443e8b817027407212c.tar.xz
puppet-2d580c257e6d8aa0821fd443e8b817027407212c.zip
Fix snippets tests failing because of activated storeconfigs
All the snippets tests were failing because some parser and scope tests activated storeconfigs without reseting the state. Activating storeconfigs is not undoable at the moment by just setting storeconfig=false as some terminus are changed. Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
-rwxr-xr-xtest/language/parser.rb18
-rwxr-xr-xtest/language/scope.rb7
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"