Please review pull request #768: Fix unit test failure in fileserver due to modules opened by (nicklewis)
Description:
This test is setting modulepath, and then testing that it can find
modules from the modulepath. However, the recent change to module find
causing it to read from the cached list of modules requires the cache be
cleared after changing the modulepath in order for the modules to be
found.
Also, the structure of the test changed a bit because we have to put the
modules on disk, THEN refresh the cache, THEN we can find them, rather
than putting them on disk and immediately finding them.
- Opened: Fri May 11 23:13:19 UTC 2012
- Based on: puppetlabs:2.7.x (ea246b12942fa3420b894b7c3350169237f280f5)
- Requested merge: nicklewis:fix-fileserver-test-failure (95b75e120dc4b5acb98ee8af3e58f93389897690)
Diff follows:
diff --git a/test/network/handler/fileserver.rb b/test/network/handler/fileserver.rb
index b76f8e1..2eb88ee 100755
--- a/test/network/handler/fileserver.rb
+++ b/test/network/handler/fileserver.rb
@@ -1100,14 +1100,20 @@ def test_modules_default
mounts = {}
Puppet[:modulepath] = moddir
- mods = %w{green red}.collect do |name|
+ %w{green red}.each do |name|
path = File::join(moddir, name, Puppet::Module::FILES)
FileUtils::mkdir_p(path)
if name == "green"
file = File::join(path, "test.txt")
File::open(file, "w") { |f| f.print name }
end
+ end
+
+ # We changed modulepath, so we have to clear the environment cache to
+ # refresh it
+ Puppet::Node::Environment.current.modules = nil
+ mods = %w{green red}.map do |name|
Puppet::Module::find(name)
end
-- You received this message because you are subscribed to the Google Groups "Puppet Developers" 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-dev?hl=en.
