summaryrefslogtreecommitdiff
path: root/spec/integration/node
AgeCommit message (Collapse)AuthorFilesLines
2014-07-08Merge branch 'pr/2819'Andrew Parker1-17/+0
* pr/2819: (maint) Remove biff setting and related code (PUP-2858) Remove evaluator setting (PUP-2858) Remove duplicated testing (evaluator = 'current') (PUP-2858) Refactor binder to use ne evaluator (PUP-2858) Remove the 3_1 checker and its factory (PUP-2858) Refactor EvaluatingParser::Transitional to EvaluatingParser (PUP-2858) Remove use of Puppet[:evaluator] from the code base (PUP-2858) Deprecate the use of Puppet[:environment] == current (PUP-2858) Remove e_parser adapter support Conflicts: spec/integration/node/environment_spec.rb Closes #2819
2014-07-05(PUP-2711) Make recursive manifest parsing conditional to future parserHenrik Lindberg1-0/+33
This makes the ability to load all .pp files under a manifest dir recursively conditional to parser == future. (It will become the standard in Puppet 4.0). This is done to avoid slurping in lots of files in case users kept other files around in a subdirectory in the belief that they would not be loaded. Thus making it harder to upgrade. This also adds a test that runs for future parser.
2014-07-03(PUP-2858) Remove duplicated testing (evaluator = 'current')Henrik Lindberg1-7/+0
There was a test (environment_spec) that ran an extra time with the hybrid parser = future, evaluator = current which results in the same tests running twice. (This because the future evaluator is enforced when runing with future parser).
2014-04-27(maint) Convert to using have_resource matcherAndrew Parker1-2/+2
Using the have_resource matcher makes the tests a little shorter and more expressive. It also uses the common way of matching so that we can get better error reporting. It turns out that one of the tests was matching against the incorrect class name, so that is now fixed. This also extracts a be_resource matcher so that you can match against an individual resource independent of a catalog.
2014-04-07(PUP-2158) Default a missing manifest to no_manifestAndrew Parker1-2/+2
The tests were often creating environments that didn't need to have manifests. Since we didn't have a way of specifying that when they were written, we used '' to fill in the blank. This actually caused a large number of tests to try to find code to load in the PWD, which caused tests to break if a developer had parse errors in manifests being used for testing in the root directory of their puppet project. This changes the manifest to be optional and removes '' from those tests. The tests no longer fail if a bad manifest is in the PWD :D
2014-02-03(Maint) Clean up testsAndrew Parker1-26/+26
2014-02-03(PUP-865) Only use the pops merge for the future evaluatorAndrew Parker1-0/+8
The future evaluator is only really in play when both the parser is future and the evaluator is future. The old check left out the evaluator portion of that check and so ended up using the wrong CodeMerger when using the current evaluator with the future parser.
2014-02-03(PUP-865) Allow BlockExpression to evaluate everythingAndrew Parker1-18/+13
Previously BlockExpression would skip evaluating any AST nodes that implement an instantiate method. The assumption was that instiate only existed on Hostclass, Node, and Definition AST nodes and those same classes also did not implement an evaluate method. With the introduction of the PopsBridge::Program class, this entire house of assumption cards came falling down, since it impelements both instantiate and evaluate. The only thing that truly prevented BlockExpression from calling evaluate was that the default evaluate implementation on Parser::AST raised a Puppet::DevError to try to catch the case of evaluate not being implemented for an AST class. Since Parser::AST is entirely internal and missing an evaluate should show up very quickly in tests, we can just as easily make evaluate a noop by default, which then simplifies BlockExpression. This change fixes the problem where the body of pp files were loaded, but not evaluated when using the future evaluator and a directory of manifest files. The problem was triggered by the BlockExpression logic interacting with the PopsBridge::Program object and the structure created by the Puppet::Pops::Parser::CodeMerger.
2014-01-29(PUP-1118) Stop using Environment.newAndrew Parker1-15/+13
Instead of creating environments directly, we need to go through the configured environment loaders, otherwise environments can't come from other places.
2014-01-06(PUP-716) Change Puppet::FileSystem::File to module methodsHenrik Lindberg1-1/+1
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.
2013-12-14(PUP-865) Change name of shared test group to one not already claimedHenrik Lindberg1-3/+3
2013-12-14(PUP-865) Add ability to parse a directory of manifestsHenrik Lindberg1-0/+51
This adds the ability to run a directory of manifests instead of just a single file. Simply assign a directory to Puppet[:manifest] via settings or from the command line. The files are parsed and combined in alphabetical order as if the files were to be concatenated into a single file. The support is in environment, and it is only support for the initial import. This also means that both current and future parser can be used (i.e. the support for this is not in the parser). Testing is done in integration/node/environment_spec.
2013-11-08(#19447) Puppet::FileSystem::File.exist?Ethan J. Brown1-1/+1
- 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
2012-09-26(Maint) Remove rspec from shebang lineJeff McCune2-2/+2
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,'
2012-07-02(maint) Standardize on /usr/bin/env ruby -S rspecJeff McCune2-2/+2
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.
2012-04-23Make positional arguments distinct in Request#initializePatrick Carlisle1-1/+1
Puppet::Indirector::Request#initialize had a weird implementation giving variable semantics to positional arguments. This makes it normal again.
2011-08-19Rework Puppet::Util::Cacher to only expire using TTLsNick Lewis1-2/+0
We have removed every usage of cached_attr in which the attribute needs to be manually expired. Thus, the only meaningful behavior provided by Puppet::Util::Cacher is expiration based on TTLs. This commit reworks the cacher to only support that behavior. Rather than accepting an options hash, of which :ttl is the only available option, cached_attr now requires a second argument, which is the TTL. TTLs are now used to compute expirations, which are stored and used for expiring values. Previously, we stored a timestamp and used it and the TTL to determine whether the attribute was expired. This had the potentially undesirable side effect that the lifetime of a cached attribute could be extended after its insertion by modifying the TTL setting for the cache. Now, the lifetime of an attribute is determined when it is set, and is thereafter immutable, aside from deliberately re-setting the expiration for that particular attribute. Reviewed-By: Jacob Helwig <jacob@puppetlabs.com> (cherry picked from commit d198fedf65e472b384666fc9ae3bef487852068a) Conflicts: spec/integration/node/facts_spec.rb spec/unit/node_spec.rb
2011-08-18maint: remove inaccurate copyright and license statements.Daniel Pittman1-4/+0
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>
2011-07-28(#1886) Clean up `node clean` for merge.Pieter van de Bruggen1-1/+1
This includes various style changes, and assorted fixes to testing. Paired-With: Matt Robinson
2011-04-13maint: clean up the spec test headers in bulk.Daniel Pittman2-3/+2
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.
2011-04-08maint: just require 'spec_helper', thanks rspec2Daniel Pittman2-2/+2
rspec2 automatically sets a bunch of load-path stuff we were by hand, so we can just stop. As a side-effect we can now avoid a whole pile of stupid things to try and include the spec_helper.rb file... ...and then we can stop protecting spec_helper from evaluating twice, since we now require it with a consistent name. Yay. Reviewed-By: Pieter van de Bruggen <pieter@puppetlabs.com>
2010-12-06maint: Use expand_path when requiring spec_helper or puppettestMatt Robinson2-2/+2
Doing a require to a relative path can cause files to be required more than once when they're required from different relative paths. If you expand the path fully, this won't happen. Ruby 1.9 also requires that you use expand_path when doing these requires. Paired-with: Jesse Wolfe
2010-11-30Maint: Modified tests of indirector.save to call the indirection directly.Paul Berry1-1/+1
This change replaces calls to <model object>.save with calls to <model class>.indirection.save(<model object>). This makes the use of the indirector explicit rather than implicit so that it will be easier to search for all indirector call sites using grep. This is an intermediate refactor on the way towards allowing indirector calls to be explicitly routed to multiple termini. This patch affects tests only; the next patch will make the corresponding change to the code.
2010-11-29Maint: Refactor tests to use <class>.indirection.<method>Paul Berry1-3/+3
Replaced uses of the find, search, destroy, and expire methods on model classes with direct calls to the indirection objects. This change affects tests only.
2010-07-09Code smell: Two space indentationMarkus Roberts2-73/+73
Replaced 106806 occurances of ^( +)(.*$) with The ruby community almost universally (i.e. everyone but Luke, Markus, and the other eleven people who learned ruby in the 1900s) uses two-space indentation. 3 Examples: The code: end # Tell getopt which arguments are valid def test_get_getopt_args element = Setting.new :name => "foo", :desc => "anything", :settings => Puppet::Util::Settings.new assert_equal([["--foo", GetoptLong::REQUIRED_ARGUMENT]], element.getopt_args, "Did not produce appropriate getopt args") becomes: end # Tell getopt which arguments are valid def test_get_getopt_args element = Setting.new :name => "foo", :desc => "anything", :settings => Puppet::Util::Settings.new assert_equal([["--foo", GetoptLong::REQUIRED_ARGUMENT]], element.getopt_args, "Did not produce appropriate getopt args") The code: assert_equal(str, val) assert_instance_of(Float, result) end # Now test it with a passed object becomes: assert_equal(str, val) assert_instance_of(Float, result) end # Now test it with a passed object The code: end assert_nothing_raised do klass[:Yay] = "boo" klass["Cool"] = :yayness end becomes: end assert_nothing_raised do klass[:Yay] = "boo" klass["Cool"] = :yayness end
2010-06-28[#3994-part 2] rename integration tests to *_spec.rbMarkus Roberts2-0/+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
2009-08-18Fixing #1544 - plugins in modules now works againLuke Kanies1-0/+58
We had to fix the fileserving plumbing to use the request environment instead of trying to use the node environment. This was apparently never fixed after we added the environment to the URI in REST calls. There's still a bit of refactoring left to clean up the APIs used in some of this code. Signed-off-by: Luke Kanies <luke@madstop.com>
2008-12-18Renaming Puppet::Node::Catalog to Puppet::Resource::CatalogLuke Kanies1-54/+0
Signed-off-by: Luke Kanies <luke@madstop.com>
2008-11-11Changing the Cacher.invalidate method to Cacher.expire.Luke Kanies2-2/+2
Signed-off-by: Luke Kanies <luke@madstop.com>
2008-07-29Merge branch '0.24.x' into mergingLuke Kanies1-0/+10
Conflicts: test/ral/type/filesources.rb
2008-07-10Fixing #1408 - --loadclasses works again.Luke Kanies1-0/+10
The problem was that the mechanism I was using for passing the node to the compiler was conflicting with the Indirector::Request's method of handling node authentication. Signed-off-by: Luke Kanies <luke@madstop.com>
2008-07-08Merge branch '0.24.x'Luke Kanies2-6/+6
Conflicts: CHANGELOG
2008-07-07Fixing #1401 - integration tests now work regardless of the yamldir.Luke Kanies2-6/+6
Signed-off-by: Luke Kanies <luke@madstop.com>
2008-05-20Merge branch '0.24.x'Luke Kanies1-0/+6
Conflicts: CHANGELOG spec/integration/defaults.rb spec/integration/node/catalog.rb spec/unit/rails.rb spec/unit/type/mount.rb
2008-05-19Mocking Facter in an integration test, so it works with no networkingLuke Kanies1-0/+6
2008-05-13Using the new Cacher class for handling cached data.Luke Kanies2-3/+5
This provides a single, global bit for determining whether a given piece of cached data is still valid.
2008-04-10Fixing the expire method (it wasn't using a requestLuke Kanies1-1/+8
internally), and fixing the Facts class so it auto-expires any associated cached nodes when facts are saved.
2008-04-10Moved the request creation into the IndirectionLuke Kanies1-0/+4
class instead of the Indirector module. Also, added an 'expire' method to the indirector, so there's an easy way to expire cached instances.
2008-04-08Ported the rest of the indirection terminuses over toLuke Kanies2-3/+41
expecting requests instead of having a random interface.
2008-04-08Intermediate commit.Luke Kanies1-0/+34
This commit adds a Request instance into the indirection, pushing it all the way to the terminus instances. It's a big commit because it requires modifying every terminus class. There are still some thorny design issues. In particular, who should be responsible for making the request object? I've tried having both the indirection class and the Indirector module creating it, and both have their issues. Also, the Catalog class previously allowed passing Node instances directly to the find method, which is now no longer possible because the Request class would treat the node as the instance being found. We need the request class to have two modes, one when it's passed an instance and one when it's passed a key.