summaryrefslogtreecommitdiff
path: root/spec/integration
Commit message (Collapse)AuthorAgeFilesLines
* Link to the knife.rb docs when the knife.rb file is missingknife_rbTim Smith2018-01-221-2/+2
| | | | | | This is a pretty common first error message to experience with Chef. Let's point the users to a helpful location so they can quickly get up and running. Add some YARD comments while I was in the config class Signed-off-by: Tim Smith <tsmith@chef.io>
* Improve property warnings in resourcesbetter_resource_errorsTim Smith2017-12-291-1/+1
| | | | | | Give more details on why people are seeing these problems so they can fix them. Signed-off-by: Tim Smith <tsmith@chef.io>
* travis caught another speclcg/lwrp-test-speedupLamont Granquist2017-12-061-1/+1
| | | | Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
* speedup lwrp testsLamont Granquist2017-12-062-31/+31
| | | | | | | | | | | | | | | | | | reset the global resource and provider handler maps before each and every test. note that mutation through the top-level keys will get preserved so this is not perfect, but deep-duping through every single test we run becomes expensive. this is sufficient to flush out the global state of all the test lwrp fixtures that we setup. it discovered several usage bugs where we either relied on this feature or where we were testing different fixtures from the ones we thought we were. Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
* Merge pull request #6576 from cma-arnold/masterLamont Granquist2017-11-291-15/+71
|\ | | | | Hide sensitive properties in converge_if_changed.
| * Hide sensitive properties in converge_if_changed.Chris Arnold2017-11-271-15/+71
| | | | | | | | Signed-off-by: Chris Arnold <cma.arnold@gmail.com>
* | Forgot to check for a unit test. Sigh.Noah Kantrowitz2017-11-271-7/+0
| | | | | | | | Signed-off-by: Noah Kantrowitz <noah@coderanger.net>
* | Remove empty line.Noah Kantrowitz2017-11-271-1/+0
| | | | | | | | Signed-off-by: Noah Kantrowitz <noah@coderanger.net>
* | Tests++.Noah Kantrowitz2017-11-271-1/+9
|/ | | | Signed-off-by: Noah Kantrowitz <noah@coderanger.net>
* fixes for rubocop 0.49.1 engineLamont Granquist2017-06-205-10/+10
| | | | Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
* Deprecate property namespace magicLamont Granquist2017-06-083-34/+29
| | | | | | | This forces everyone to starting using new_resource.property_name instead of just property_name. Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
* Fix up tests for the no-listen swapover.Noah Kantrowitz2017-05-261-11/+29
| | | | Signed-off-by: Noah Kantrowitz <noah@coderanger.net>
* lazily load cookbook_files and templatestm/even_lazierThom May2017-04-251-1/+0
| | | | | | Fixes: #6051 Signed-off-by: Thom May <thom@chef.io>
* Add tests for lazy load of cookbook filesThom May2017-04-251-0/+33
| | | | Signed-off-by: Thom May <thom@may.lt>
* couple of integration tests for Chef-13 formatterLamont Granquist2017-04-051-0/+38
| | | | | | | | make sure that we fail if we can see info logs at least (halfway decent check that we're not getting the logger when we're going through a pipe / not through a tty) Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
* CHEF-13: remove magic from the logger/formatter settingsLamont Granquist2017-04-051-3/+2
| | | | | | closes #2514 Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
* Merge pull request #6013 from coderanger/always-inlineNoah Kantrowitz2017-04-051-11/+7
|\ | | | | Remove use_inline_resources
| * Update some more tests for removing use_inline_resources.Noah Kantrowitz2017-04-041-11/+7
| | | | | | | | Signed-off-by: Noah Kantrowitz <noah@coderanger.net>
* | RFC 59: Load Ohai pluginstm/ohai_plugins_2Thom May2017-04-051-0/+33
|/ | | | | | This adds a new phase in the compilation of the run context. Signed-off-by: Thom May <thom@chef.io>
* Merge pull request #6001 from chef/smurawski/exit_status_defaultSteven Murawski2017-04-041-105/+1
|\ | | | | Make Standardized Exit Codes The Default Behavior
| * use rfc exit codesSteven Murawski2017-04-041-105/+1
| | | | | | | | Signed-off-by: Steven Murawski <steven.murawski@gmail.com>
* | Merge pull request #5850 from criteo-forks/rb_supportThom May2017-04-041-22/+58
|\ \ | |/ |/| Add real support for rb files (at least roles) in knife-serve
| * Ensure ruby nodes are supported in knife serveGrégoire Seux2017-03-061-6/+16
| | | | | | | | | | Change-Id: I4788cac16864c7eb5a876890e9fe41485af80d46 Signed-off-by: Grégoire Seux <g.seux@criteo.com>
| * Support ruby role in knife serveGrégoire Seux2017-03-061-4/+15
| | | | | | | | | | Change-Id: I1076b918e9153f21b4c49d77054899111106eb74 Signed-off-by: Grégoire Seux <g.seux@criteo.com>
| * Add test for role listing in knife serveGrégoire Seux2017-03-061-1/+9
| | | | | | | | | | Change-Id: Ic28361e506643f55f588c7ddb22a27800b634f96 Signed-off-by: Grégoire Seux <g.seux@criteo.com>
| * Extract with_knife_serve helper in knife serve testsGrégoire Seux2017-03-061-22/+29
| | | | | | | | | | Change-Id: I0ddb921a30daf33007b37483b163fc76117441c7 Signed-off-by: Grégoire Seux <g.seux@criteo.com>
* | RFC 67: Remove cookbook segmentsThom May2017-04-043-144/+12
| | | | | | | | | | | | | | | | | | This implements RFC 67, which removes cookbook segments, and moves to a single list of all the files contained in a cookbook. This allows us to move forward with better audit modes and also proper shipping of ohai plugins. Signed-off-by: Thom May <thom@chef.io>
* | Chef-13 knife search exit 1 when no resultslcg/knife-search-no-resultsLamont Granquist2017-04-021-0/+39
| | | | | | | | Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
* | Chef-13: fix notifying array resourcesLamont Granquist2017-03-311-0/+29
| | | | | | | | | | | | | | | | this also deprecates the multi-resource notification syntax where `foo[a,b]` would attempt to notify both `foo[a]` and `foo[b]` because that is hella ambiguous. Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
* | make nameless properties opt-inLamont Granquist2017-03-301-5/+22
| | | | | | | | Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
* | Chef-13: Support nameless resources and remove deprecated multi-arg resourcesLamont Granquist2017-03-302-12/+35
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This makes nameless resources work in the DSL: ```ruby apt_update ``` It does it by giving it an empty-string name of "" It also drops support for multi-arg resources, that has been deprecated for some time: ```ruby some_resource "foo", "bar", "baz" ``` Note that multipackage package resources do not use multiple args, but a single argument which is an arry: ```ruby package [ "lsof", "strace", "tcpdump" ] ``` So this change does not affect that usage. Multi-arg has been deprecated for some time now and its not clear that it was ever used by anyone. Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
* | Chef-13: remove more deprecated provider_resolver codeLamont Granquist2017-03-291-75/+0
| | | | | | | | | | | | | | I think this nukes descendants tracker, although might need to clean it up in a few more spots. Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
* | Fix Chef-13 action_class bug and cleanupLamont Granquist2017-03-271-27/+34
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The old action_class code was doing some magical stuff with the provider accessor in order to determine if the class was supposed to be a custom resource or not and have the action_class autovivifying accessor return nil in cases when the resource wasn't a custom resource and implementing inheritance by walking back up the tree in ways that were difficult to grok. This removes the magic from the provider so that there's no longer any accessor that magically short-circuits to nil if the resource is not supposed to be a custom resource. There is now a simple inherited API for `Chef::Resource.custom_resource?` which just defines if the class is a custom resource or not. Since both `action` and `action_class` call `define_action_class` they both wind up setting this boolean on the class, which is then inherited to subclasses automatically, which eliminates the need to walk up the hierarchy. The superclass.respond_to?(:action_class) checks have also been rendered unnecessary by removing the code that walked up the inheritance hierarchy and also because Chef::Resource is never going to be a custom resource itself, so will never call `define_action_class` so from inside of `define_action_class` you can always rely on the superclass being a resource and implementing `custom_resource?` and `action_class`. The wiring for picking the provider is now moved explicitly to the ProviderResolver -- even though custom resources hardcode a 1:1 resource-to-provider mapping. This reads much clearer to me than the magical wiring to the provider accessor off of the instance. The bug that this fixes was that the way the magical accessor nil-or-action_class was implemented the old way of defining action helpers with class_eval broke: ```ruby action_class.class_eval << EOM def a "foo" end EOM ``` If that came before any action_class-with-a-block or action declaration and the resource did not inherit from another custom resource then the action_class would not be created and it would return nil, which was an API which the magical wiring in the provider accessor required. Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
* | Chef-13: Simplify DSL creationLamont Granquist2017-03-212-3/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | we did actually have tests around creating actions with spaces and hyphens in their names. we had fallback code for properties, but it was broken and threw a "private method define_resource called" and then it created a closure and didn't have the `name` in the binding so it called itself and blew up the stack. this change walks that back. it does prove that we still support UTF-8 in property names, actions and DSL names, which i'd argue is more than enough. Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
* | Chef-13: remove method_missing from the DSLLamont Granquist2017-03-211-29/+0
| | | | | | | | Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
* | Revert "Chef-13: remove more deprecated provider_resolver code"Lamont Granquist2017-03-201-0/+86
| | | | | | | | | | | | forgot to branch and need more coffee This reverts commit 02ec917f9356d999c44aceb7f1ff43957b0fe832.
* | Chef-13: remove more deprecated provider_resolver codeLamont Granquist2017-03-201-86/+0
| | | | | | | | | | | | | | I think this nukes descendants tracker, although might need to clean it up in a few more spots. Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
* | Chef-13: remove Chef::Platform.set and related methodsLamont Granquist2017-03-171-73/+0
| | | | | | | | | | | | Switch over the Chef-12.0 ProviderResolver is now completed. Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
* | fix spec that tested deprecations themselves using this warninglcg/nil-propertiesLamont Granquist2017-03-161-13/+3
|/ | | | Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
* self-deps are now just illegalLamont Granquist2017-02-281-9/+5
| | | | | | circular deps are poor form, but allowed, so we still need to check. Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
* raise on cookbook self-dependencyLamont Granquist2017-02-281-11/+3
| | | | Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
* re-fix redundant selflcg/fix-more-chefstylesLamont Granquist2017-02-131-31/+31
| | | | Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
* greenify rspecLamont Granquist2017-02-131-58/+58
| | | | Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
* fix specs: RedundantReturn, RedundantSelf, RedundantBeginLamont Granquist2017-02-131-31/+31
| | | | | | department of redundancy department Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
* favor metadata.json over metadata.rbLamont Granquist2017-01-241-0/+33
| | | | | | | make sure that if we have a metadata.rb that is not valid to read that we never parse that and use compiled metadata.json instead. Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
* Merge pull request #5631 from chef/lcg/deprecate-chef-platform-methodsLamont Granquist2016-12-091-0/+3
|\ | | | | Properly deprecate old Chef::Platform methods
| * Properly deprecate old Chef::Platform methodsLamont Granquist2016-12-071-0/+3
| | | | | | | | | | | | | | | | These should have been deprecated formally in 12.5.1 after the Dynamic Provider-Resolver'ing of the internal chef resources was completed. Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
* | Merge pull request #5548 from chef/lcg/chefstyle-updatesThom May2016-12-072-5/+5
|\ \ | | | | | | Chefstyle updates
| * | fix Style/SpaceInsideStringInterpolationLamont Granquist2016-12-061-3/+3
| | | | | | | | | | | | Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
| * | fix Style/SpaceInsideArrayPercentLiteralLamont Granquist2016-12-061-2/+2
| |/ | | | | | | Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>