summaryrefslogtreecommitdiffstats
path: root/spec/unit/parser/collector.rb
Commit message (Collapse)AuthorAgeFilesLines
* [#3994] rename the specs to have _spec.rb at the endMarkus Roberts2010-06-231-559/+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
* Add stub to Puppet::Parser::Collector test to prevent runaway stubJesse Wolfe2010-04-091-1/+5
| | | | failures
* Finishing renaming :params to :parameters internallyLuke Kanies2010-02-171-12/+12
| | | | | | | | | | | | I had only done this partway, because it seemed easier, but not surprisingly, it ended up being more complex. In addition to those renames, this commit includes fixes to whatever tests I needed to fix to confirm that things were again working. I think most of these broken tests have been broken for a while. Signed-off-by: Luke Kanies <luke@reductivelabs.com>
* Fixing most of the broken tests in test/Luke Kanies2010-02-171-4/+4
| | | | | | | | This involves a bit of refactoring in the rest of the code to make it all work, but most of the changes are fixing or removing old tests. Signed-off-by: Luke Kanies <luke@reductivelabs.com>
* Removing Resource::Reference classesLuke Kanies2010-02-171-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit is hopefully less messy than it first appears, but it's certainly cross-cutting. The reason for all of this is that we previously only looked up builtin resource types from outside the parser, but now that the defined resource types are available globally via environments, we can push that lookup code to Resource. Once we do that, however, we have to have environment and namespace information in every resource. Here I remove the Resource::Reference classes (except the AST class), and use Resource instances instead. I did this because the shared code between the two classes got incredibly complicated, such that they should have had a hierarchical relationship disallowed by their constants. This complexity convinced me just to get rid of References entirely. I also make Puppet::Parser::Resource a subclass of Puppet::Resource. There are still broken tests in test/, but this was a big enough commit I wanted to get it in. Signed-off-by: Luke Kanies <luke@reductivelabs.com>
* Fix #2691 - Collection AR request should not include params if querying with ↵Brice Figureau2009-10-251-9/+20
| | | | | | | | | | | | | | | | | | | | | | | | | tags f9516d introduced a change in the way the user tags are persisted to the database: user tags are now treated as regular tags (they are stored to the tags table). Thus this commit changed the AR collector request to also look at the tags tables when collecting. Unfortunately this added a performance regression since tag request were still importing the resources parameters tables and AR was issuing a large request which was returning all the resource parameters joined with the tags. This commit fixes the AR request to join to the needed table, instead of doing an include. Including (ie eager loading) parameter values was not working for resource parameters anyway since at least 0.24 because searching by parameter add a constraint to the joins and only the searched parameter was returned instead of all parameter for a given exported resource. So on a performance standpoint this new code should be as fast 0.24 was. Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
* Fix #2246 - take2: make sure we run the rails tag query only when neededBrice Figureau2009-06-111-1/+11
| | | | | | | | | Adding the tags to the rails collect query can reduce performance because there are 2 more tables to join with. So we make sure to include tags in the query only when it is necessary. Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
* Fix collector specs which were not workingBrice Figureau2009-06-111-9/+12
| | | | | | | | | The various collector specs covering the rails query code were not in fact covering anything. This patch fixes the specs to integration tests that actually verify the rails query building code works fine. Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
* Fix some tests who were missing some actionsBrice Figureau2009-06-061-0/+4
| | | | Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
* Make sure virtual and rails query use tags when tag are searchedBrice Figureau2009-06-061-2/+2
| | | | | | | | | | | | Up to now, when trying to match with tags: File<<| tag == 'value' |>> in fact we were querying parameters. Hopefully all the user tags are stored in parameters so it was working. But it wasn't possible to search on auto-tags (like class name). This patch makes sure searching by tag is done on tags both on the rails side and the resource side. Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
* Removed extra whitespace from end of linesIan Taylor2009-06-061-1/+1
|
* Fix #1088 - part2 - Add rspec testsBrice Figureau2009-03-141-37/+139
| | | | Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
* Merge branch '0.24.x'Luke Kanies2009-02-111-4/+4
|\ | | | | | | | | | | Conflicts: CHANGELOG spec/unit/type/file/selinux.rb
| * Fixed #1884 - exported defines are collected by the exporting hostLuke Kanies2009-02-111-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This was caused by the fix to #1472. That fix unexported any resources collected from the local catalog. The crux of this fix is that it separates 'exported' and 'virtual' a bit more. It also removes no-longer-needed functionality where resources copied their virtual or exported bits from the enclosing define or class. This is now obsolete because we don't evaluate virtual defined resources. The crux of this commit is that defined resources can stay exported even though they're evaluated, and that exported state won't inherit to contained resources such that those then don't get evaluated. Signed-off-by: Luke Kanies <luke@madstop.com>
* | Fix #1834 part2 - Fix tests when no railsBrice Figureau2008-12-201-2/+2
|/ | | | Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
* Fixed #1472 -- defined, exported resources in the current compile now get ↵Luke Kanies2008-09-251-5/+5
| | | | | | | | | expanded correctly. This was working for defined resources in the db, but not in the current compile. I just had to mark the resources as non-exported.
* Fixing #1242 -- lack of storeconfigs only produces warning, not exception.Luke Kanies2008-05-261-0/+9
| | | | | Exporting or collecting resources no longer raises an exception when no storeconfigs is enabled, it just produces a warning.
* Changing the name of the Compile class to Compiler,Luke Kanies2008-02-111-30/+30
| | | | | since it's stupid to have a class named after a verb.
* Changing some methods in the Compile class toLuke Kanies2008-02-111-5/+5
| | | | | be more internally consistent (switched store_resource to add_resource, and store_override to add_override).
* This should be the last fix for exported resources.Luke Kanies2007-12-111-0/+21
| | | | | | Hosts were keeping the export bit on all resources, even when they'd collected another host's resources, which caused a duplicate copy that was still exported.
* Fixing #923. Resources that are collected on the localLuke Kanies2007-12-061-13/+0
| | | | host are no longer marked as not exported.
* Theoretically, this patch is to fix #917 (which it does), butLuke Kanies2007-11-281-27/+32
| | | | | | | | | | | | | | | | | | | there were enough problems fixing it that I decided something more drastic needed to be done. This uses the new Puppet::ResourceReference class to canonize what a resource reference looks like and how to retrieve resources via their references. Specifically, it guarantees that resource types are always capitalized, even when they include '::' in them. While many files are modified in this commit, the majority of changes are quite small, and most of the changes are fixing the tests to use capitalized types. As we look at consolidating some of our resource types, we could consolidate the ResourceReference stuff at the same time, but at least the Puppet::Parser::ResourceReference class subclasses the main Puppet::ResourceReference class.
* Fixing #921, mostly by just deleting the existing test. I hadLuke Kanies2007-11-261-4/+22
| | | | | | already migrated all of the tests into rspec but forgot about these tests -- they were only in the rails/ subdir because people kept not running the parser/ tests after modifying the Rails code.
* Incorporating patch ↵Luke Kanies2007-11-241-0/+386
20071030034736-6856b-6004090b3968cdbf7d366a03ee1c44e2160a3fe0.patch from womble, and rewriting and significantly enhancing the unit tests for the Puppet::Parser::Collector class; it should have full coverage now. There are no integration tests for it, so there's still no guarantee that it works at all, but hey, we're a lot better off than we were.