summaryrefslogtreecommitdiffstats
path: root/test/language/resource.rb
Commit message (Collapse)AuthorAgeFilesLines
* Removing Resource::Reference classesLuke Kanies2010-02-171-172/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* Adding parameter validation to Puppet::ResourceLuke Kanies2010-02-171-4/+4
| | | | | | | | | | | | | This will allow us to remove all of the parameter validation from the other Resource classes. This is possible because resource types defined in the language are visible outside of the parser, via the environment. This will enable lots of code removal and simplication. Signed-off-by: Luke Kanies <luke@reductivelabs.com>
* Fixing a small test by stubbing instead of mockingLuke Kanies2009-08-021-2/+1
| | | | Signed-off-by: Luke Kanies <luke@madstop.com>
* Switching to LoadedCode from ASTSetLuke Kanies2009-07-051-1/+1
| | | | | | | | I also took the opportunity to clean up and simplify the interface to the parts of the parser that interact with this. Mostly it was method renames. Signed-off-by: Luke Kanies <luke@madstop.com>
* Changed tabs to spaces without interfering with indentation or alignmentIan Taylor2009-06-061-1/+1
|
* Merge branch '0.24.x'Luke Kanies2009-02-141-40/+0
|\ | | | | | | | | Conflicts: test/ral/manager/type.rb
| * Removing a no-longer-valid test.Luke Kanies2009-02-141-40/+0
| | | | | | | | | | | | | | The fix for #1884 removed this no-longer-needed feature, so this test is now unnecessary. Signed-off-by: Luke Kanies <luke@madstop.com>
* | Adding resource convertion to the parser resourcesLuke Kanies2008-12-181-84/+0
|/ | | | | | | Also uses Puppet::Resource's method for creating transportable resources. Signed-off-by: Luke Kanies <luke@madstop.com>
* Always duplicating resource defaults in the parser, so thatLuke Kanies2008-03-061-159/+0
| | | | | | stacked metaparameter values do not result in all resources that receive a given default also getting those stacked values.
* Changing the name of the Compile class to Compiler,Luke Kanies2008-02-111-2/+2
| | | | | since it's stupid to have a class named after a verb.
* Converting the Compile class to use a Node::Catalog instanceLuke Kanies2008-02-111-3/+0
| | | | | as its resource container, instead of having its own behaviour around resource uniqueness.
* Moving all of the tests for Puppet::Parser::Compile toLuke Kanies2008-02-111-33/+0
| | | | | | rspec, so I can refactor the class to more heavily rely on a Node::Catalog instead of doing its own resource container management.
* More AST refactoring -- each of the code wrapping classesLuke Kanies2008-02-081-1/+1
| | | | | | | | | | | just returns a resource from its evaluate() method, and all of the work is done in the evaluate_code method. This makes the code cleaner, because it means 1) evaluate() has the same prototype as all of the other AST classes, 2) evaluate() is no longer called indirectly through the Parser Resource class, and 3) the classes themselves are responsible for creating the resources, rather than it being done in the Compile class.
* Refactoring the AST classes just a bit. I realized thatLuke Kanies2008-02-081-2/+1
| | | | | | all of the evaluate() methods only ever accepted a scope, and sometimes one other option, so I switched them all to use named arguments instead of a hash.
* Fixing a couple of tests, one related to recent tagging changesLuke Kanies2008-01-281-2/+2
| | | | | and one that somehow slipped through when I removed the GRATR code.
* Fixing #967 -- relationships now work when running 0.23.x clientsLuke Kanies2007-12-181-5/+5
| | | | against 0.24.0 servers.
* Fixing another failing test I somehow missed in my last big commitLuke Kanies2007-11-281-1/+1
|
* Theoretically, this patch is to fix #917 (which it does), butLuke Kanies2007-11-281-9/+9
| | | | | | | | | | | | | | | | | | | 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 a failing test from my fix for #446 -- I had changedLuke Kanies2007-11-191-14/+0
| | | | | | the behaviour of Resource#override_parameter unintentionally. I've corrected the comments so it's clear why the original behaviour was there.
* Changing the test/ classes so that they work from the mainLuke Kanies2007-10-261-1/+1
| | | | | | test/ dir or from their own working dir, like the specs do. This was just a question of changing how their libraries are loaded.
* *Finally* fixing the tests that were failing around users and groups. The ↵Luke Kanies2007-09-071-2/+2
| | | | problem was that the autoload tests were somehow clearing all loaded classes, including the providers. This is fixed now.
* Successfully modified all tests and code so that all language tests pass ↵Luke Kanies2007-09-041-16/+48
| | | | again. This is the majority of the work necessary to make the separate "configuration" object work.
* We now have a real configuration object, as a subclass of GRATR::Digraph, ↵Luke Kanies2007-09-041-1/+16
| | | | that has a resource graph including resources for the container objects like classes and nodes. It is apparently functional, but I have not gone through all of the other tests to fix them yet. That is next.
* Doing a small amount of refactoring, toward being able to use Parser ↵Luke Kanies2007-09-031-6/+2
| | | | resources to evaluate classes and nodes, not just definitions. This will hopefully simplify some of the parsing work, and it will enable the use of a Configuration object that more completely models a configuration.
* Deleting old documentation that somehow made it back into the tree in the ↵Luke Kanies2007-09-011-1/+1
| | | | switch to git, and refactoring the evaluate_classes method on the compile object so I can use resources as intermediaries, thus making classes do late-binding evaluation.
* And we have multiple environment support in the parser. The only remaining ↵Luke Kanies2007-08-251-4/+4
| | | | piece to make this complete is to add multiple environment support to the fileserver. I also renamed Configuration.rb to Compile.rb (that is, I fixed all the classes that used to know it as a configuration).
* All language tests now pass. I expect there are other failures elsewhere, ↵Luke Kanies2007-08-201-81/+42
| | | | but I want to commit this before delving into them. My method for fixing the tests was to do as little as possible, keeping the tests as bad or as good as they were before I started. Mostly this was about changing references to the interpreter into references to the parser (since that is where the new* methods are now for ast containers) and then dealing with the new config object and its relationship to scopes.
* The first pass where at least all of the snippet tests pass. I have ↵Luke Kanies2007-08-201-224/+201
| | | | unfortunately had to stop being so assiduous in my rewriting of tests, but I am in too much of a time crunch to do this "right". The basic structure is definitely in place, though, and from here it is a question of making the rest of the tests work and hopefully writing some sufficient new tests, rather than making the code itself work.
* Adding patch by Valentin Vidic to add the "+>" syntax for adding values to ↵luke2007-07-101-0/+25
| | | | | | parameters git-svn-id: https://reductivelabs.com/svn/puppet/trunk@2670 980ebf18-57e1-0310-9a29-db15c13687c0
* All rails and language tests now pass again. All of the rails tests should ↵luke2007-06-171-6/+13
| | | | | | now be in the rails/ directory, and I have modified resource translation so that it always converts single-member arrays to singe values, which means the rails collection does not need to worry about it. git-svn-id: https://reductivelabs.com/svn/puppet/trunk@2597 980ebf18-57e1-0310-9a29-db15c13687c0
* Fixing #673, but I have not written a test case for it. I moved all ↵luke2007-06-171-96/+1
| | | | | | rails-related unit tests into the rails/ dir, because they keep getting missed. git-svn-id: https://reductivelabs.com/svn/puppet/trunk@2596 980ebf18-57e1-0310-9a29-db15c13687c0
* Fixing #637 -- defined resources can now correctly be virtual or exportedluke2007-06-111-94/+134
| | | | git-svn-id: https://reductivelabs.com/svn/puppet/trunk@2562 980ebf18-57e1-0310-9a29-db15c13687c0
* Adding #629 -- an undef keyword now existsluke2007-05-171-0/+14
| | | | git-svn-id: https://reductivelabs.com/svn/puppet/trunk@2522 980ebf18-57e1-0310-9a29-db15c13687c0
* Working a little bit on rails failures, with no real progressluke2007-04-301-16/+20
| | | | git-svn-id: https://reductivelabs.com/svn/puppet/trunk@2439 980ebf18-57e1-0310-9a29-db15c13687c0
* Adding #539. Definitions can now have titles, and both $title and $name are ↵luke2007-03-191-0/+39
| | | | | | guaranteed to be set within any definition. git-svn-id: https://reductivelabs.com/svn/puppet/trunk@2301 980ebf18-57e1-0310-9a29-db15c13687c0
* Fixing #472. Apparently this has been broken since I did the parser ↵luke2007-02-221-0/+38
| | | | | | redesign. I had to fix the scope trees so that subclass scopes are subscopes of the parent scopes, which used to be the case but was far more complicated. git-svn-id: https://reductivelabs.com/svn/puppet/trunk@2220 980ebf18-57e1-0310-9a29-db15c13687c0
* Undo the param_names param_values changesshadoi2007-02-171-4/+6
| | | | git-svn-id: https://reductivelabs.com/svn/puppet/trunk@2207 980ebf18-57e1-0310-9a29-db15c13687c0
* Merge fact_names & fact_values, and param_names & param_values.shadoi2007-02-151-5/+4
| | | | git-svn-id: https://reductivelabs.com/svn/puppet/trunk@2191 980ebf18-57e1-0310-9a29-db15c13687c0
* Fixing #391. Keeping track of times of compile and freshness checks.luke2007-01-041-11/+14
| | | | git-svn-id: https://reductivelabs.com/svn/puppet/trunk@2034 980ebf18-57e1-0310-9a29-db15c13687c0
* Fixing #343. Collections and definition evaluation both now happen on every ↵luke2006-12-231-2/+2
| | | | | | iterative evaluation, with collections being evaluated first. This way collections can find resources that either are inside defined types or are the types themselves. git-svn-id: https://reductivelabs.com/svn/puppet/trunk@1967 980ebf18-57e1-0310-9a29-db15c13687c0
* Fixing most of the rails stuff. I think everything basically works now, and ↵luke2006-12-191-15/+62
| | | | | | now I am just going through and making sure things get deleted when they are supposed (i.e., you remove a resource and it gets deleted from the host's config). git-svn-id: https://reductivelabs.com/svn/puppet/trunk@1950 980ebf18-57e1-0310-9a29-db15c13687c0
* New rails stuff redux.shadoi2006-12-141-5/+5
| | | | git-svn-id: https://reductivelabs.com/svn/puppet/trunk@1925 980ebf18-57e1-0310-9a29-db15c13687c0
* Fixing #339, and the bigger problem it concealed. Metaparams are now only ↵luke2006-11-131-1/+6
| | | | | | added to resources that do not explicitly set them. git-svn-id: https://reductivelabs.com/svn/puppet/trunk@1869 980ebf18-57e1-0310-9a29-db15c13687c0
* Fixing the test scripts so that the library pathluke2006-10-161-1/+3
| | | | | | is modified in ruby instead of in the env line git-svn-id: https://reductivelabs.com/svn/puppet/trunk@1793 980ebf18-57e1-0310-9a29-db15c13687c0
* Adding a ruby header to all of the tests so that they can now be executed as ↵luke2006-10-161-1/+1
| | | | | | normal ruby scripts. Using multiple commits because I am having some svn problems. git-svn-id: https://reductivelabs.com/svn/puppet/trunk@1791 980ebf18-57e1-0310-9a29-db15c13687c0
* Many, many, many performance improvements in the compiler (I hope). I did ↵luke2006-10-061-1/+6
| | | | | | not change functionality anywhere, but I did some profiling and significantly reduced the runtime of many methods, and especially focused on some key methods that run many times. git-svn-id: https://reductivelabs.com/svn/puppet/trunk@1739 980ebf18-57e1-0310-9a29-db15c13687c0
* Merging the changes from the override-refactor branch. This is a ↵luke2006-10-041-0/+391
significant rewrite of the parser, but it has little affect on the rest of the code tree. git-svn-id: https://reductivelabs.com/svn/puppet/trunk@1726 980ebf18-57e1-0310-9a29-db15c13687c0