Age | Commit message (Collapse) | Author | Files | Lines |
|
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.
|
|
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.
|
|
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.
|
|
This also includes some minor refactoring of the contain function.
|
|
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.
|
|
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.
|
|
From the the accepted proposal for this functionality some of the
example cases have been captured as test cases.
|
|
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>
|
|
This reverts commit 751efa9174adfe1bc0a5707855e6ba16ff2aed43, reversing
changes made to 023cffdbb9b30945fbf4dcaded4f63428ce54ea7.
Conflicts:
lib/puppet/dsl/context.rb
spec/unit/dsl/context_spec.rb
|
|
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.
|
|
Scoping for classes included by an ENC follow some rules that are not
immediately obvious. These tests should nail down and clarify that
behaviour
|
|
This reverts commit 6d399e087372b77566dd3737d4b444aca2e61050.
|
|
This reverts commit 7a430815424e053d6e6c5925eef711ca5edd8373, reversing
changes made to 32172d5d8de35f5cdbc31bce327b3567e078bb83.
|
|
Created a PuppetSpec::Compiler module for helping out testing things
that want to compile some code to a catalog
|