diff options
| author | Markus Roberts <Markus@reality.com> | 2011-04-04 12:13:53 -0700 |
|---|---|---|
| committer | Markus Roberts <Markus@reality.com> | 2011-04-06 16:26:57 -0700 |
| commit | 2a6c6cb8fabf82d2f2127c90db670c1a856427c5 (patch) | |
| tree | 70dfb4300a4832d0edb1fdeab265b457e56f31a5 /test/lib/puppettest | |
| parent | 5dc994c594680203a4bbbbaa3d6f3b00640c1530 (diff) | |
| download | puppet-2a6c6cb8fabf82d2f2127c90db670c1a856427c5.tar.gz puppet-2a6c6cb8fabf82d2f2127c90db670c1a856427c5.tar.xz puppet-2a6c6cb8fabf82d2f2127c90db670c1a856427c5.zip | |
(5200) -- replace containers with sentinals
This commit removes the last remaining use of topsort (in SimpleGraph#splice!) by
fixing #5200 in a way that is compatible with graph fontiers. Instead of replacing
containers with many-to-many relationships, we now replace them with a pair of
sentinals (whits) that bracket them.
Thus a graph consisting of two containers, each containing ten resources, and a
dependency between the containers, which would have gone from 21 edges to 100
edges will instead have only 43, and a graph consisting of two containers (e.g.
stages) each containing a similar graph, which would have gone from 45 edges to
400 will only go to 95.
This change had minor consequences on many parts of the system and required lots
of small changes for consistancy, but the core of it is in Catelog#splice! (which
replaces SimpleGraph#splice!) and Transaction#eval_generate. Everything else is
just adjustments to the fact that some one-step edges are now two-step edges and
tests, event propagation, etc. need to reflect that.
Paired-with: Jesse Wolfe
Diffstat (limited to 'test/lib/puppettest')
| -rw-r--r-- | test/lib/puppettest/support/assertions.rb | 7 | ||||
| -rw-r--r-- | test/lib/puppettest/support/utils.rb | 19 |
2 files changed, 6 insertions, 20 deletions
diff --git a/test/lib/puppettest/support/assertions.rb b/test/lib/puppettest/support/assertions.rb index 31fa3f1da..758c126ce 100644 --- a/test/lib/puppettest/support/assertions.rb +++ b/test/lib/puppettest/support/assertions.rb @@ -46,7 +46,12 @@ module PuppetTest config = resources2catalog(*resources) transaction = Puppet::Transaction.new(config) - run_events(:evaluate, transaction, events, msg) + transaction.evaluate + newevents = transaction.events. + reject { |e| ['failure', 'audit'].include? e.status }. + collect { |e| e.name } + + assert_equal(events, newevents, "Incorrect evaluate #{msg} events") transaction end diff --git a/test/lib/puppettest/support/utils.rb b/test/lib/puppettest/support/utils.rb index bca5d9634..4ecc3819e 100644 --- a/test/lib/puppettest/support/utils.rb +++ b/test/lib/puppettest/support/utils.rb @@ -82,25 +82,6 @@ module PuppetTest::Support::Utils @mygroup = group end - def run_events(type, trans, events, msg) - case type - when :evaluate, :rollback # things are hunky-dory - else - raise Puppet::DevError, "Incorrect run_events type" - end - - method = type - - trans.send(method) - newevents = trans.events.reject { |e| ['failure', 'audit'].include? e.status }.collect { |e| - e.name - } - - assert_equal(events, newevents, "Incorrect #{type} #{msg} events") - - trans - end - def fakefile(name) ary = [basedir, "test"] ary += name.split("/") |
