summaryrefslogtreecommitdiff
path: root/spec/lib/puppet_spec/compiler.rb
AgeCommit message (Collapse)AuthorFilesLines
2014-08-18(maint) Extract language specification toolsAndrew Parker1-0/+2
The resource_expressions_spec contained a useful way of writing language specification tests. This extracts those out so that they can be reused in other places.
2014-08-01(PUP-501) Check virtual and exported resourcesAndrew Parker1-1/+2
This adds checks for the specification's assertions that virutal and exported resources are not in the produced catalog, but are available for later operations (realization) and reference (reading a parameter value). This cannot check that the exported resources are made available to catalog processors, since that is implementation dependent. In order to check this the compile_to_catalog method needed to be changed to filter out expoerted resources, just like the catalog indirection does. This required a change to the create_resources test.
2014-06-09(maint) spec: allow expectations of resources from compiled manifestsFelix Frank1-1/+11
Add logic to the PuppetSpec::Compiler.apply_compiled_manifest method so that a spec test can supply a block that processes the single resources that comprise that catalog that was compiled before it is run in a transaction. As a proof of concept and general helper, add a apply_with_error_checks method, that adds an expectation to never send an :err signal to each resource. This makes spectest debugging much easier, because without expectations, the transaction will just finish and the only reported error will be that the end result is not as expected. When the expectation is added to each resource, rspec will display all resource error messages as failed expectations.
2013-09-09(#8040) Test order of application for contained classesPatrick Carlisle1-0/+6
This also includes some minor refactoring of the contain function.
2013-08-16(#22205) Chose a Prioritizer based on Puppet[:ordering]Andrew Parker1-5/+9
This ties the selection of the Puppet::Graph::Prioritizer to the Puppet[:ordering] setting. In order to make it easier to ensure that all of the uses of the prioritizer use the same one (because it needs to track state) this also moves around the relationship of the catalog and the transaction. Previously the catalog was responsible for converting itself into a relationship graph. This now puts that responsibility on the transaction, which much now be constructed with the desired Prioritizer. The selection is still done in the catalog (because that is where #apply lives, which is the public starting point of applying a catalog). Additionally this adds a random prioritizer.
2013-08-13(#18508) Ensure that no two resources have the same priorityAndrew Parker1-0/+1
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.
2013-08-09(#18508) Ensure resource ordering in interesting casesAndrew Parker1-2/+9
From the the accepted proposal for this functionality some of the example cases have been captured as test cases.
2013-06-11(#14652) Add check for self-dependency cyclesAndrew Parker1-0/+12
With some changes that were made to how the graph is processed, puppet 2.7.0 lost the ability to detect dependency cycles where a resource requires itself. Instead of erroring, the resource ended up being silently ignored. This restores the behavior that existed in 2.6 where this was considered a cyclic dependency. The erroneous code had considered any single vertex, strongly connected component to not be a cycle. This was done because by definition any single vertex is a strongly connected component, no matter what edges are involved. By always excluding those vertices, the case of a self-referencing vertex was not handled. This adds a check for a single vertex SCC that is adjacent to itself in order to find dependency cycles of a single resource. Paired-with: Josh Cooper <josh@puppetlabs.com>
2013-01-24Revert "Merge branch 'new-ruby-dsl-by-mlen'"Patrick Carlisle1-11/+0
This reverts commit 751efa9174adfe1bc0a5707855e6ba16ff2aed43, reversing changes made to 023cffdbb9b30945fbf4dcaded4f63428ce54ea7. Conflicts: lib/puppet/dsl/context.rb spec/unit/dsl/context_spec.rb
2012-11-27Add new Ruby DSL by Mateusz Lenik.Mateusz Lenik1-0/+11
This adds new Ruby DSL features by Mateusz Lenik. This was developed as a Google Summer of Code project. This commit contains all of the new Ruby DSL work in one single commit.
2012-04-20Added tests around enc usageAndrew Parker1-2/+2
Scoping for classes included by an ENC follow some rules that are not immediately obvious. These tests should nail down and clarify that behaviour
2012-04-16Re-apply "Merge remote-tracking branch 'upstream/2.7.x'"Andrew Parker1-0/+6
This reverts commit 6d399e087372b77566dd3737d4b444aca2e61050.
2012-04-16Revert "Merge remote-tracking branch 'upstream/2.7.x'"Andrew Parker1-6/+0
This reverts commit 7a430815424e053d6e6c5925eef711ca5edd8373, reversing changes made to 32172d5d8de35f5cdbc31bce327b3567e078bb83.
2012-04-16Removed duplication of compiling a catalogAndrew Parker1-0/+6
Created a PuppetSpec::Compiler module for helping out testing things that want to compile some code to a catalog