[Pkg-puppet-devel] [SCM] Puppet packaging for Debian branch, experimental, updated. debian/2.6.8-1-844-g7ec39d5

Paul Berry paul at puppetlabs.com
Tue May 10 07:58:58 UTC 2011


The following commit has been merged in the experimental branch:
commit 1ba536eb533e99d0f400178184ce929f18457b03
Author: Paul Berry <paul at puppetlabs.com>
Date:   Tue Aug 31 11:46:36 2010 -0700

    [3782] Test isolation problem in test/ral/providers/cron/crontab.rb
    
    The test in question (test_parse_line) was nondeterministic because it
    was relying on the sort order of a Hash whose keys were symbols.  When
    the sort order caused a blank line to appear at the end of the file
    under test, the blank line was elided by the crontab parser, causing a
    failure.
    
    Modified the test to execute in a deterministic order that doesn't
    place the blank line at the end.

diff --git a/test/ral/providers/cron/crontab.rb b/test/ral/providers/cron/crontab.rb
index 0c87a5b..be2af1e 100755
--- a/test/ral/providers/cron/crontab.rb
+++ b/test/ral/providers/cron/crontab.rb
@@ -97,7 +97,10 @@ class TestCronParsedProvider < Test::Unit::TestCase
     # Then do them all at once.
     records = []
     text = ""
-    sample_records.each do |name, options|
+    # Sort sample_records so that the :empty entry does not come last
+    # (if it does, the test will fail because the empty last line will
+    # be ignored)
+    sample_records.sort { |a, b| a.first.to_s <=> b.first.to_s }.each do |name, options|
       records << options[:record]
       text += options[:text] + "\n"
     end

-- 
Puppet packaging for Debian



More information about the Pkg-puppet-devel mailing list