summaryrefslogtreecommitdiffstats
path: root/spec/integration/node
Commit message (Collapse)AuthorAgeFilesLines
* Rework Puppet::Util::Cacher to only expire using TTLsNick Lewis2011-08-191-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
* maint: remove inaccurate copyright and license statements.Daniel Pittman2011-08-181-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>
* (#1886) Clean up `node clean` for merge.Pieter van de Bruggen2011-07-281-1/+1
| | | | | This includes various style changes, and assorted fixes to testing. Paired-With: Matt Robinson
* maint: clean up the spec test headers in bulk.Daniel Pittman2011-04-132-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.
* maint: just require 'spec_helper', thanks rspec2Daniel Pittman2011-04-082-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>
* maint: Use expand_path when requiring spec_helper or puppettestMatt Robinson2010-12-062-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
* Maint: Modified tests of indirector.save to call the indirection directly.Paul Berry2010-11-301-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.
* Maint: Refactor tests to use <class>.indirection.<method>Paul Berry2010-11-291-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.
* Code smell: Two space indentationMarkus Roberts2010-07-092-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
* [#3994-part 2] rename integration tests to *_spec.rbMarkus Roberts2010-06-282-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
* Fixing #1544 - plugins in modules now works againLuke Kanies2009-08-181-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>
* Renaming Puppet::Node::Catalog to Puppet::Resource::CatalogLuke Kanies2008-12-181-54/+0
| | | | Signed-off-by: Luke Kanies <luke@madstop.com>
* Changing the Cacher.invalidate method to Cacher.expire.Luke Kanies2008-11-112-2/+2
| | | | Signed-off-by: Luke Kanies <luke@madstop.com>
* Merge branch '0.24.x' into mergingLuke Kanies2008-07-291-0/+10
|\ | | | | | | | | | | Conflicts: test/ral/type/filesources.rb
| * Fixing #1408 - --loadclasses works again.Luke Kanies2008-07-101-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>
* | Merge branch '0.24.x'Luke Kanies2008-07-082-6/+6
|\| | | | | | | | | | | Conflicts: CHANGELOG
| * Fixing #1401 - integration tests now work regardless of the yamldir.Luke Kanies2008-07-072-6/+6
| | | | | | | | Signed-off-by: Luke Kanies <luke@madstop.com>
* | Merge branch '0.24.x'Luke Kanies2008-05-201-0/+6
|\| | | | | | | | | | | | | | | | | | | Conflicts: CHANGELOG spec/integration/defaults.rb spec/integration/node/catalog.rb spec/unit/rails.rb spec/unit/type/mount.rb
| * Mocking Facter in an integration test, so it works with no networkingLuke Kanies2008-05-191-0/+6
| |
* | Using the new Cacher class for handling cached data.Luke Kanies2008-05-132-3/+5
|/ | | | | This provides a single, global bit for determining whether a given piece of cached data is still valid.
* Fixing the expire method (it wasn't using a requestLuke Kanies2008-04-101-1/+8
| | | | | | internally), and fixing the Facts class so it auto-expires any associated cached nodes when facts are saved.
* Moved the request creation into the IndirectionLuke Kanies2008-04-101-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.
* Ported the rest of the indirection terminuses over toLuke Kanies2008-04-082-3/+41
| | | | expecting requests instead of having a random interface.
* Intermediate commit.Luke Kanies2008-04-081-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.