Age | Commit message (Collapse) | Author | Files | Lines |
|
From RSpec:
DEPRECATION: `expect { }.not_to raise_error(SpecificErrorClass, message)` is deprecated. Use `expect { }.not_to raise_error` (with no args) instead.
This commit removes all args from `.to_not raise_error` expectations.
|
|
This commit moves the shared behavior for iterative functions to
shared_behaviours/iterative_functions.
|
|
The data_binding/hiera_spec.rb had a specific after block to clear up
the hiera terminus for following tests. Moved this to the
shared_behaviors/hiera_indirections so that both indirector/hiera_spec
and data_binding/hiera_spec would be cleaned up, preventing order
dependent errors caused by global terminus state leaking between tests.
|
|
Puppet::Indirector::Hiera and Puppet::DataBinding::Hiera had
identical implementations. Puppet::DataBinding::Hiera is now a subclass
of Puppet::Indirector::Hiera. Common behavior in their specs was also
moved into spec/shared_behaviors.
|
|
This changes the API in a new implementation in a file called file_.rb
The intent is that it should replace the implemntation in File,
or perhaps directly in a Puppet::FileSystem class.
|
|
- All previous File and FileTest calls to exist? or exists? go through
the new FileSystem::File abstraction so that the implementation can
later be swapped for a Windows specific one to support symlinks
|
|
This was unDRY, AND the methods had differing behavior. (The faces one didn't
make exceptions for first-line underhang, which demanded unintuitive source
formatting.)
This commit just replaces the implementation of the faces scrubber with a
scrub() call.
Spec test change: This method trims trailing newlines from strings.
|
|
Without this patch Ruby 1.9 is still complaining loudly about trying to
parse the spec files. The previous attempt to clean up this problem in
edc3ddf works for Ruby 1.8 but not 1.9.
I'd prefer to remove the shebang lines entirely, but doing so will cause
encoding errors in Ruby 1.9. This patch strives for a happy middle
ground of convincing Ruby it is actually working with Ruby while not
confusing it to think it should exec() to rspec.
This patch is the result of the following command run against the source
tree:
find spec -type f -print0 | \
xargs -0 perl -pl -i -e 's,^\#\!\s?/(.*)rspec,\#! /usr/bin/env ruby,'
|
|
* 2.7.x:
Use rspec 2.11 compatible block syntax
Conflicts:
spec/integration/faces/ca_spec.rb
spec/integration/network/server/mongrel_spec.rb
spec/unit/application_spec.rb
spec/unit/face/help_spec.rb
spec/unit/network/handler/fileserver_spec.rb
spec/unit/parser/functions/create_resources_spec.rb
spec/unit/provider/nameservice/directoryservice_spec.rb
spec/unit/type/file_spec.rb
spec/unit/type_spec.rb
|
|
In rspec 2.11, expectations on a block must take the form of expect...to or
lambda...should. Other combinations of those are no longer accepted. This
commit converts all mixed cases to use expect...to, as it seems to be the
preferred syntax now.
|
|
* 2.7.x: (26 commits)
Extract host validation in store report processor
Use cross-platform absolute paths in file_serving tests
(#15221) Create /etc/puppet/modules directory for puppet module tool
(Maint:) Fix bad doc strings for two settings ("wether")
Try again to avoid circular dependency in file indirections
Remove useless tests for Envelope
Clear deprecation warnings between tests
Avoid circular requirement in FileMetadata indirection
(Maint) Document common Windows issues
Update CHANGELOG lib/puppet.rb conf/redhat/puppet.spec for 2.7.18
Maint: Note in docs that the file type's "replace" attribute defaults to true
Reject directory traversal in store report processor
Tighten permissions on classfile, resourcefile, lastrunfile, and lastrunreport.
Use "inspect" when listing certificates
Don't allow the creation of SSL objects with invalid certnames
Validate CSR CN and provided certname before signing
Add specs for selector terminuses of file_{content,metadata}
Fix whitespace inside parentheses
Use head method to determine if file is in file bucket
Always use the local file_bucket on master
...
Conflicts:
CHANGELOG
conf/redhat/puppet.spec
lib/puppet.rb
lib/puppet/application/master.rb
lib/puppet/defaults.rb
lib/puppet/file_serving/terminus_selector.rb
lib/puppet/reports/store.rb
lib/puppet/test/test_helper.rb
spec/integration/file_serving/content_spec.rb
spec/integration/file_serving/metadata_spec.rb
spec/shared_behaviours/file_serving.rb
spec/unit/file_serving/terminus_selector_spec.rb
spec/unit/network/handler/ca_spec.rb
test/ral/manager/attributes.rb
|
|
The file_serving tests were failing on windows because they used unix style
paths. This makes them absolute on both posix and windows.
|
|
Without this patch some spec files are using `ruby -S rspec` and others
are using `rspec`.
We should standardize on a single form of the interpreter used for spec
files.
`ruby -S rspec` is the best choice because it correctly informs editors
such as Vim with Syntastic that the file is a Ruby file rather than an
Rspec file.
|
|
|
|
This terminus is now the default, and encapsulates the behavior that was
previously in the IndirectionHooks. That is, we dynamically select the
terminus to use for a file request based on the key. However, for the
puppet master, we instead explicitly always use the FileServer terminus,
so that *all* requests for files from the master will go through
the file server. This ensures that we will never accidentally
serve local files on the puppet master.
|
|
This setting is used to determine the default source of files accessed
with a puppet: url and no server specified, e.g. puppet:///path/to/file.
Before now, this was done by checking if Puppet[:name] was `apply`. Since
Puppet[:name] is removed and we don't want application specific logic spread
throughout the code, we are adding a setting specific to this particular
behavior. The `apply` application sets a default value of `file_terminus`,
which retains the previous behavior of `apply`. Otherwise the default value is
`rest`, causing Puppet[:server] to be used to retrieve the file.
|
|
Puppet::Indirector::Request#initialize had a weird implementation giving
variable semantics to positional arguments. This makes it normal again.
|
|
* 2.7.x:
(maint) Remove unnecessary step from puppet module build help
(#13659) Convert fact values to string when searching database
(#13649) Restrict module name matching
(#13643) Make the use of FileUtils.rm_rf secure
(#13642) Move search notice message
(#13639) Don't send errors directly to stderr
(#13638) Add SemVer#pre function
(#3581) Stop forking around: Add fork helper method
(#13397) fix gem provider ensure=>latest bug
(#12101) Make Puppet::Util::absolute_path? usable in autoloader
(#12101) Add shared context for specs to imitate windows or posix
Conflicts:
lib/puppet/util.rb
spec/unit/util_spec.rb
|
|
Add "windows" and "posix" shared contexts to rspec. If you give :as_platform
=> :posix or :as_platform => :windows as argument to a describe block, it will
automatically stub the relevant facts and path behavior to imitate windows or
posix.
|
|
Major changes include:
* support multiple config files (/etc/puppet, ~/.puppet). we no longer
use "run_mode" to determine the location of the config file.
* remove all references to application run_mode/state from defaults
* make the typing of settings a little more strict
* create a new setting type for directories, to make us a little less vulnerable to the terrible matching algorithm in FileSetting
|
|
This reverts commit edc544d73bc8f9f7de07de4b30e344d1f4db3178.
This doesn't work with rspec < 2.6.0 and it's breaking continuous integration.
|
|
Add "windows" and "posix" shared contexts to rspec. If you give :as_platform
=> :posix or :as_platform => :windows as argument to a describe block, it will
automatically stub the relevant facts and path behavior to imitate windows or
posix.
|
|
Previously, specifying a Windows file URI of the form 'file:///C:/foo'
as a file source failed to strip the leading slash when attempting to
source the file. Also there was ambiguity after values were munged (a
value of the form 'C:/foo' could either be a Windows file path or a
URI whose scheme is 'C').
This commit changes the file source to be more deliberate in how it
validates source properties, including only allowing absolute paths
and 'puppet' and 'file' URIs, which are both absolute and
hierarchical. Also it uses the Puppet::Util.path_to_uri method to
handle file path to URI translation issues.
Previously, if a request was created using a Windows file URI of the
form 'file:///C:/foo', then the set_uri_key method wasn't stripping
the leading slash, and setting the request key to '/C:/foo'. This
caused problems when attempting to collect metadata for Windows
files. This commit changes the request class to use the
Puppet::Util.uri_to_path method to handle URI path to file path
translation issues.
Previously, if a file URI was created programmatically using ruby's
built-in URI class, such as occurs when specifying file source URIs,
then calling URI#to_s omits the authority component, e.g. 'file:/foo'
instead of 'file:///foo'. This commit changes the URI regex to not
require two slashes, but note that the order of operations is
important as Windows file paths will match the URI regex and can be
successfully parsed: URI.parse('c:/foo').scheme == 'c'
|
|
into 2.7.x
* feature/2.7.x/9051-storeconfig-backend-should-be-configurable:
(#9051) de-ActiveRecord-ify Collection expressions.
(#9051) Port query tests into the indirection.
(#9051) Implement the `resource` terminus for StoreConfigs.
(#9051) Make generic tagging imported resource origins.
(#9051) Whitespace cleanup for puppet/parser/collector
(#9051) Dead code elimination in the compiler terminus.
(#9051) Get the compiler out of the ActiveRecord business.
(#9051) Implement the StoreConfigs indirection itself.
(#9051) Add configuration around StoreConfigs indirection.
Reviewed-by: Jeff McCune
|
|
A Puppet::Parameter::Path's value is valid if it is fully qualified (or
in the case of an array, if each of its elements is fully qualified).
This class was previously using its own method to validate whether a
path was fully qualified, which was different from the rules applied by
absolute_path?. Now that we have a dedicated method for this,
it is used here for consistency.
|
|
We now have a StoreConfigs terminus base class, and concrete uses in a number
of indirections, along with testing to ensure they behave as expected.
Signed-off-by: Daniel Pittman <daniel@puppetlabs.com>
|
|
This class was using Util::Cacher for its singleton instance, when that was
unnecessary. The FileServing::Configuration instance already manages whether or
not to reparse its config file, based on whether it has changed. Thus, there is
no need for it to be manually expired via the cacher.
Reviewed-By: Jacob Helwig <jacob@puppetlabs.com>
(cherry picked from commit 4bad729f56c26d8154cd0f20614fa4e478de9d40)
|
|
For a while Luke, and other authors, injected a created tag, copyright
statement, and "All rights reserved" into every new file they added to the
Puppet project.
This isn't really true, and we have a global license covering the code, so
we have now stripped out all those old tags.
Signed-off-by: Daniel Pittman <daniel@puppetlabs.com>
|
|
This implement support for options with default values, allowing faces to set
those values when not invoked. This can eliminate substantial duplicate code
from actions, especially when there are face-level options in use.
Reviewed-By: Pieter van de Bruggen <pieter@puppetlabs.com>
|
|
The problem was caused by the fact that the
options method returns a list of options that
treated the aliases as seperate options.
The fix is to only maintain a list of options
and not add all aliases to the options list.
|
|
Pre-released versions of faces may have used the "desc" option, which
was later changed to "description", and an alias provided for "desc". The
previous fix for 8048 removed this backwards compatibility (since it was
never released to customers). This commit fixes the test case that
assumed the "desc" option was still available.
Reviewed-By: Daniel Pittman <daniel@puppetlabs.com>
|
|
Previously, we were adding ellipsis to any short_description, which was
misleading; they were only necessary when we were truncating in the _middle_ of
a paragraph.
This commit changes the behavior, and updates the tests to show when we expect
ellipsis.
Paired-with: Matt Robinson <matt@puppetlabs.com>
|
|
Add the ability to download a file into the local filebucket using a puppet
URI or from disk. Also, the ability to store into the filebucket.
These provide at least basic UI for moving data around using the filebucket
service, and act as an example of how further work can be done.
Also, update the code to eliminate a couple of redundant checks on arguments,
and add some basic testing around the actions. Mostly only that they exist,
at this point.
Reviewed-By: Daniel Pittman <daniel@puppetlabs.com>
|
|
|
|
We now strip whitespace in face (and related) documentation in two places:
We strip any trailing whitespace on each line, just because.
We strip any leading indent, but not all leading whitespace, from the text.
That is, we strip the *minimum* amount of whitespace that we can take from
every line in the documentation without changing the overall content.
Reviewed-By: Pieter van de Bruggen <pieter@puppetlabs.com>
|
|
|
|
`before_action` decorations should always resolve in resolution order
from most general (inherited from furthest away) to most specific
(declared on the instance), and should always execute Face-level
option decorations before action-level option decorations.
`after_action` decorations should execute in the opposite order.
Reviewed-By: Daniel Pittman
|
|
This extends the last of the documentation support, down into options, so they
can be described as expected. In the process we split out the modular docs
API into a full and short version options only want short docs, but the
behaviours are identical to the full version.
|
|
Given that we have identical documentation behaviour in the face and action
code, it should properly be written once. So, move it into a module, extend
the other classes with it, and have done.
|
|
This adds the remaining documentation mechanisms to the Face instances,
allowing them to build and report correct documentation, licensing and
ownership for the help face to build on.
|
|
Apparently 'expect { ... } .not_to' is considered unnecessary contortion by
the rspec authors, so we only have 'expect { ... } .to_not' in some versions
of rspec.
This updates the test code to reflect that bit of annoyance.
|
|
|
|
This adds the 'description' method to the faces and actions, as well as
structured testing to ensure that the DSL works as expected.
Reviewed-By: Max Martin <max@puppetlabs.com>
|
|
As per the design decision documented in #7131, optional arguments to
options will no longer be supported. This patch causes such optional
arguments to raise an error, and tests for this behavior. Also cleaned
up some confusing use of the term "subject" in specs.
Paired-with: Daniel Pittman
|
|
If you're going to use special characters in a file and use Ruby 1.9 you
need to specify the character encoding at the top of the file.
Reviewed-by: Daniel Pittman <daniel@puppetlabs.com>
|
|
This is legal, and defines an option with an argument for optparse; we want to
make sure that we stay consistent with that in our code handling the same sort
of inputs.
This also adds a framework for later testing any other strange naming bits and
bobs we find around option handling.
Reviewed-By: Pieter van de Bruggen <pieter@puppetlabs.com>
|
|
We now use a shebang of: #!/usr/bin/env rspec
This enables the direct execution of spec tests again, which was lost earlier
during the transition to more directly using the rspec2 runtime environment.
|
|
This joins the two repositories, including full history, into a single run, as
well as landing the interfaces work on the next branch ready for release.
|
|
This ensures that an option declaration that shadows itself is found, and
reported to the user, rather than silently eating one of the two.
This could have actually lost, for example, the distinction between an
argument-requiring and an argument-missing variant of the same thing.
Reviewed-By: Pieter van de Bruggen <pieter@puppetlabs.com>
|
|
The purpose of this is to adapt the generic option support in our strings to
the command line; we adapt the generic option information to optparse, and
establish our environment early in the process to ensure that we can play nice
with Puppet::Application for the moment.
In the process we ensure that we detect, and report, conflicts in option
naming across the board. Additionally, when an option is declared with
multiple aliases, we insist that either all, or none, of them take an
argument.
To support this we support introspecting options having an optional argument,
as well as documentation and all.
Reviewed-By: Pieter van de Bruggen <pieter@puppetlabs.com>
|