summaryrefslogtreecommitdiff
path: root/spec/unit/graph
AgeCommit message (Collapse)AuthorFilesLines
2013-09-09(#8040) Test order of application for contained classesPatrick Carlisle1-6/+0
This also includes some minor refactoring of the contain function.
2013-08-16(#22191) Rename cancelled to canceledJosh Cooper1-7/+7
Prefer the current American spelling from the past 30 years.
2013-08-16(#22191) Add cancelled resource handlerJosh Cooper1-0/+42
This commit adds the ability to pass a cancelled resource handler callback to the traverse method such that if the traversal is cancelled, then the callback is invoked once for each resource that is ready, but not yet evaluated. In addition, the resource is "finished", which unblocks its dependents, so that the callback can handle those as well. While writing tests for this, we found a bug in the main while loop. Previously, the loop was removing the next ready resource, and then checking if the loop had been cancelled. But if the loop was ever cancelled, the removed resource was effectively lost. This commit reverses the order so that we only remove the next ready resource if we intend to evaluate it. Paired-with: Patrick Carlisle <patrick@puppetlabs.com>
2013-08-15(#22205) Re-introduce old ordering as a PrioritizerAndrew Parker1-0/+49
This creates an old prioritizer for resources as it existed in commit f51e967b73ff0154801f514aff40ca524bdd8ab1.
2013-08-15(#22205) Extract class for generating resource prioritiesAndrew Parker2-9/+34
Previously the code for generating priorities was scattered throughout the places that needed to add vertices to the relationship graph. This pulls out that logic into a class that can generate the priorities for resources, and those contained in other resources. This is needed to be able to make this strategy pluggable.
2013-08-13(Maint) Move most graph related code to Puppet::GraphAndrew Parker3-0/+1651
We often talk about "the graph", but until now there hasn't been a clear graph that we were talking about. The relationship graph that is used for evaluation is the best candidate to fill this role, since it contains all of the ordering information that is needed. This also removes Puppet::Util::Graph, which was unused.
2013-08-13(#18508) Ensure that no two resources have the same priorityAndrew Parker1-0/+41
The underlying red-black tree that is used as the priority queue for tracking what resources to evaluate will only allow a single value per key. This means that when generated resources are added they need to get unique priority keys. However there could be an arbitrary number of these resources added in between existing resources. This commit provides a Puppet::Graph::Key that behaves like the numbering scheme of an outline so that priorities can be arbitrarily nested and the nested priorities are between the priorities at the outer level. The integration tests for the file type caught this error. It only showed up when 2 unique, new resources are generated.