summaryrefslogtreecommitdiffstats
path: root/spec/unit/simple_graph.rb
Commit message (Collapse)AuthorAgeFilesLines
* [#3994] rename the specs to have _spec.rb at the endMarkus Roberts2010-06-231-544/+0
| | | | | | | | | Some spec files like active_record.rb had names that would confuse the load path and get loaded instead of the intended implentation when the spec was run from the same directory as the file. Author: Matt Robinson <matt@puppetlabs.com> Date: Fri Jun 11 15:29:33 2010 -0700
* Adding #2658 - Adding support for run stagesLuke Kanies2010-02-171-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | This allows you to specify a run stage for either a class or a resource. By default, all classes get directly added to the 'main' stage. You can create new stages as resources: stage { [pre, post]: } To order stages, use standard relationships: stage { pre: before => Stage[main] } Or use the new relationship syntax: stage { pre: } -> Stage[main] -> stage { post: } Then use the new class parameters to specify a stage: class { foo: stage => pre } If you set a stage on an individual resource, it will fail; stages can only be set on class resources. Signed-off-by: Luke Kanies <luke@puppetlabs.com>
* Changing SimpleGraph.matching_edges to expect one eventLuke Kanies2010-02-171-6/+5
| | | | | | | It previously worked with multiple, but the only caller actually only ever passed one event. Signed-off-by: Luke Kanies <luke@madstop.com>
* Removed extra whitespace from end of linesIan Taylor2009-06-061-6/+6
|
* Always making sure graph edges appear firstLuke Kanies2009-04-241-0/+7
| | | | | | | If we don't do this, there's a chance we'll get hit by the ruby yaml bug again. Signed-off-by: Luke Kanies <luke@madstop.com>
* Fixing #2181 - Using Sets instead of Arrays in SimpleGraphLuke Kanies2009-04-221-0/+1
| | | | | | This can cause a huge speedup for large numbers of edges. Signed-off-by: Luke Kanies <luke@madstop.com>
* Fixing #2111 - SimpleGraph only creates valid adjacenciesLuke Kanies2009-04-121-0/+9
| | | | | | | | | | | The way this class was testing edges was causing them to appear adjacencies to appear magically, because it was only testing that a hash had a key, not that the value had any edges. This fixes the infinite recursion mentioned in #2111. Signed-off-by: Luke Kanies <luke@madstop.com>
* Fixing #1949 - relationships now use attributes instead of a labelLuke Kanies2009-03-101-5/+5
| | | | | | | | | | | This was important because the use of the label to store attributes was a holdover from the GRATR library, and if we didn't cease its use before we switched to RESTful catalogs, then we'd be stuck with the @label instance variable forever, essentially. Now we can add and remove variables however we please. Signed-off-by: Luke Kanies <luke@madstop.com>
* Removing the PGraph class and subsuming it into SimpleGraph.Luke Kanies2008-11-061-214/+429
| | | | | | | This class is a holdover from when I was using GRATR, and it's obsolete now. Signed-off-by: Luke Kanies <luke@madstop.com>
* Moving Catalog#write_graph to SimpleGraph, where it belongs.Luke Kanies2008-11-061-0/+25
| | | | Signed-off-by: Luke Kanies <luke@madstop.com>
* Fixed #1021 -- the problem was that my method of determiningLuke Kanies2008-02-131-0/+11
| | | | | the in-degree sometimes resulted in a lower number than the number of in-edges.
* Removing the last remaining vestiges of GRATR --Luke Kanies2008-02-111-32/+32
| | | | removing the bangs from 'add_vertex!' and 'add_edge!'.
* Fixing #982 -- I have completely removed the GRATR graph libraryLuke Kanies2008-01-071-0/+40
| | | | from the system, and implemented my own topsort method.
* Fixing #937 -- I had not ported the dot methods at all,Luke Kanies2007-12-111-5/+7
| | | | and I had to make a few small changes to make them work.
* Fixing a SimpleGraph unit test so it doesn't dependLuke Kanies2007-11-181-1/+3
| | | | on hashing.
* Switching the graph base class from GRATR::DigraphLuke Kanies2007-11-071-0/+42
| | | | | | to Puppet::SimpleGraph, which should dramatically enhance performance. It should be largely functionally equivalent, with the only difference being that edges are no longer deduplicated.
* Adding a new graphing base class, because the GRATR stuffLuke Kanies2007-11-071-0/+183
is just too slow. This class has just about no iteration, and vertex deletation is dramatically (as in, 1000x) faster). Here are the results of some very simplistic graph operations: Vertex tests (add and remove 1000 vertices): gratr: Add: 0.01; Remove: 9.70 simple: Add: 0.02; Remove: 0.01 Edge tests (add and remove 1000 edges): gratr: Add: 0.02; Remove: 0.03 simple: Add: 0.07; Remove: 0.02 I expect I can get the cost of the edge addition down some, but even as it is, it's a couple of orders of magnitude faster. This doesn't even count things like searching, which I did some other testing on and got consistently faster results (somewhere between 1.5x and 1500x faster, depending on how the test was set up and how big the graph was).