summaryrefslogtreecommitdiff
path: root/spec/integration
Commit message (Collapse)AuthorAgeFilesLines
* fix chef-solo spec timeouts (#5367)Lamont Granquist2016-09-211-2/+2
| | | | | | | | | | | | | | | | | | | | | | | * fix chef-solo spec timeouts caused by a race condition (not actually fixed) where the pid can be read by the process which lost the race to lock it before the pid has been written by the process which got the lock. the result is a message like: "WARN: Chef client is running, will wait for it to finish and then run." without any numerical pid. i'm not super concerned with fixing the race, this will unbreak a lot of red travis failures though. Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org> * revert some debugging Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
* Make 12.5+ custom resources whyrun safe by default.John Keiser2016-09-161-1/+17
| | | | | | (This was always intended to be the case, and it's difficult to do it yourself. We have been teaching people whyrun-safe methods to make resources right alongside Custom Resources, as well.)
* Fix whitespace on EOMsJohn Keiser2016-09-161-43/+43
|
* use threads to workaround Process.spawn buginesslcg/fix-solo-spec-testLamont Granquist2016-09-021-6/+11
| | | | | | | | | | | | | | | | | | | there's a WONTFIX closed bug in ruby-lang.org on this bug: https://bugs.ruby-lang.org/issues/10583 they seem to be favoring speed over accuracy with the result that if you're doing I/O synchronization (like our run_lock?) inside of a Process.spawn chain like this that you have to wrap the spawn calls inside of threads. probably a best practice to wrap every spawn call with a Thread. this probably also explains why we had the silly-long 20 second timeout? Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
* tweak chef-solo run_lock timing testlcg/solo-test-loop-tweakingLamont Granquist2016-09-021-4/+4
| | | | | | | | | | | | | | | | | - fix the 'last' statements (my perl brain occassionally crops up in ruby code) and replace with a raise. of course this just swaps one exception for another, but this time its really intended to work this way. - swap the order of the expecations so that if we fails to see the waiting on the other process statement, but we blow up in both threads in the exception that was just added, we know we actually have a legit run_lock race condition that this code just found. does not fix this bug, just gets us a bit more information if it reoccurs. Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
* Fix TinyServer races.jk/tinyserver-raceJohn Keiser2016-08-221-2/+2
| | | | | | | | | | | | | | | 1. Wait for the start callback rather than the do block, as it happens later. This prevents us from getting into many conditions where the start returns before the server is fully initialized, where if stop() is called too soon after start returns, it would cause exceptions. 2. Wait for the thread to finish completely 3. Use Thread.current.abort_on_exception` to show the actual listen errors, so that problems like this can be diagnosed. 4. Use :each to start and stop TinyServer so that race conditions like this are exposed earlier and more often (this will let us rid ourselves of them more quickly). 5. Use WEBrick::HTTPServer directly, which gets rid of the need for the complicated trap workaround (rack is the one that traps).
* Merge pull request #5222 from chef/lcg/solo-test-speedupLamont Granquist2016-08-181-20/+6
|\ | | | | speed up solo test
| * use the chef log file for IPClcg/solo-test-speedupLamont Granquist2016-08-181-7/+8
| | | | | | | | | | | | when running on my mac this entirely removes all the sleeps Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
| * speed up solo testLamont Granquist2016-08-181-16/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | removes the requirement that the second wait for the first, just that one of them waits for the other, so if we ever somehow lose that race and the second wins the run_lock as long as the first sleeps then its all good... drops all the sleeps down a lot, thinking about how to make this more cleverer so that it doesn't sleep but handshakes properly so that we don't need 25 seconds of sleep on slowaris tests.. Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
* | fix Style/BlockDelimiters, Style/MultilineBlockLayout and 0.42.0 engine upgradeLamont Granquist2016-08-1710-427/+428
|/ | | | Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
* Merge pull request #5215 from chef/jk/windows-ruby-2.3John Keiser2016-08-171-1/+70
|\ | | | | Don't use relative_path_from on glob results
| * Don't use relative_path_from on glob resultsjk/windows-ruby-2.3John Keiser2016-08-161-1/+70
| | | | | | | | Windows Ruby 2.3 translates pathnames like ADMINI~1 to Administrator, making the comparison fail.
* | fix Lint/UselessAccessModifier copLamont Granquist2016-08-161-20/+16
|/
* omit this chef-provisioning testLamont Granquist2016-08-161-0/+2
| | | | | | its always red on my mac Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
* Cache ChefFS childrentm/cache_fs_childrenThom May2016-07-264-9/+11
| | | | Signed-off-by: Thom May <thom@chef.io>
* Add most common knife commands to integration teststm/knife_integration_testsThom May2016-06-2241-0/+2486
| | | | Signed-off-by: Thom May <thom@chef.io>
* * define exit codesSteven Murawski2016-05-231-0/+245
| | | | | | | | | | | | * exit code functional specs * audit exit codes * reboot now/reboot failed/reboot pending exit codes * Deal with forked and unforked process and get the right exit code * Reboot Now should really be reboot scheduled * pass exception rather than exit code * updated with sigint and sigterm * support legacy fatal!("", 2) behavior * fixup all fatal! and exit! calls
* Ensure that solo specific code is run at the proper timeThom May2016-05-161-1/+1
| | | | | | ie, only when we're in OG mode and not in local mode. Signed-off-by: Thom May <thom@chef.io>
* fix some tests that were just wrongThom May2016-05-052-13/+5
|
* Introduce display_name and use itThom May2016-05-051-2/+2
| | | | | | | | This allows us to use the path we produce for other display purposes and consume it internally to have a canonical path for comparisons and printing Signed-off-by: Thom May <thom@may.lt>
* properly deal with loading ruby filesThom May2016-05-052-2/+40
|
* Too much log output and unnecessary warnings! Suppress that shit.Kartik Null Cating-Subramanian2016-04-251-2/+2
|
* add notifying_block and subcontext_block to chefLamont Granquist2016-04-111-0/+111
|
* Add a NoOp providertm/provider_no_opThom May2016-04-041-0/+24
| | | | | | This allows one to have a resource which is really only appropriate for one platform, but available everywhere. Then you simply allow noop to provide the resource everywhere besides where it's supposed to be.
* Make notifications recursive.lcg/notify-scopesLamont Granquist2016-04-041-0/+334
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is similar to poise's approach but has a few differences. Similarly to poise, the base behavior of notifications and find() and lookup() on the resource collection is changed to be 'recursive' and to search in outer contexts for resources and will return them by default. There are find_local() and lookup_local() methods added to allow for bypassing the recursion and making sure to throw exceptions if the current run_context does not have any matching resources. The CHEF-3694 resource cloning code has been modified to call the lookup_local() API and not to be recursive because we believe that nobody in their right mind would want that behavior (and resource cloning should eventually be removed). So the behavior of resource cloning should remain unchanged. The behavior of delayed notifications to resources outside of the current run_context is slightly different than what Poise has been implementing. The delayed notification will run in the run_context of the resource that is being notified. I think Poise tends to bubble up to the nextmost wrapping resource context (as opposed to Poise's subcontext_block or notifying_block contexts). This code I think is conceptually simpler to reason about, and I think it gets the use case right where if you're notifying a service resource in the outermost run_context from within multiple wrapping resources that it correctly bubbles out to the outermost run context and will notify with all the other delayed notifications at the end of the chef client run. Another useful feature of the delayed notification behavior is that if we do implement notifying_block or subcontext_block that each block can get its own delayed notification run and any resources that are inside of that block can run in the delayed notification phase of that block (while still being able to notify resources outside of the block and having those delayed notifications run in the receiving resources run_context). This will let us implement an often-requested feature for having "notifications delayed to the end of a block/recipe" instead of having to do all notifications absolutely immediately or delayed to the end of the chef run. This code also cleans up the object model a little bit. All of the state about notification collection is now hanging off of the run_context -- the delayed_actions have been moved from the Chef::Runner to the Chef::RunContext. Hanging it off of the Chef::Runner would have been very difficult to 'target' from other run_context's without adding a pointer back from the RunContext to the Runner and that feels like the wrong object model. The RunContext is now responsible for all of its notification state, while the Runner is responsible for wiring up the notifications across different run_contexts. Note that it will not be possible to send a notification to a run_context which has already been converged. That seems to make sense to me and the search API on the resource collection does not support returning resources from run_contexts that are children, only parents (and we don't actually hold onto pointers to child run_contexts and they may be garbage collected).
* Merge pull request #4670 from tas50/knife_wording-3Tim Smith2016-03-233-10/+10
|\ | | | | Improve wording in Knife
| * Fix failing specsTim Smith2016-03-063-10/+10
| |
* | Make example classes #to_s method return a stringdebug-travis-provider-resolver-faildanielsdeleo2016-03-212-2/+2
| |
* | Merge pull request #4640 from chef/tm/zero_deep_librariesThom May2016-03-151-0/+4
|\ \ | | | | | | Support libraries with sub directories
| * | Ensure that chef-zero loads libraries recursivelytm/zero_deep_librariesThom May2016-03-031-0/+4
| | |
* | | Issue 4334: Because set(property, nil) gets turned into get(property), add a ↵cd/fix-spurious-warningsChris Doherty2016-03-111-0/+27
| |/ |/| | | | | 'nil_set' parameter to get() to skip a spurious warning when that happens.
* | Merge pull request #4663 from chef/lcg/better-chef-rspec-constraintsLamont Granquist2016-03-041-2/+2
|\ \ | | | | | | better chef+ruby rspec constraints
| * | better chef+ruby rspec constraintsLamont Granquist2016-03-031-2/+2
| |/ | | | | | | | | | | | | | | lets us use Gem::Dependency constraints directly as rspec constraints for matching Chef::Version and RUBY_VERSION. copies some magic sauce from bundler that does something similar
* | Merge pull request #4478 from chef/lcg/rfc-060-gem-metadataLamont Granquist2016-03-031-1/+1
|\ \ | |/ |/| RFC-060 gem metadata MVP
| * can't strip the PATH out of the env.Lamont Granquist2016-02-091-1/+1
| | | | | | | | | | also add back a bunch of other ruby env vars so that our ruby environment remains sane.
* | flip multiline function arguments aroundlcg/rubocop-0.37.2Lamont Granquist2016-02-192-24/+24
| | | | | | | | no enforced trailing comma on arguments...
* | deal with 0.37.2 renamed copsLamont Granquist2016-02-183-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 252 Style/TrailingCommaInLiteral 84 Style/TrailingCommaInArguments 15 Style/SpaceAroundKeyword -- 351 Total We already dealt with SpaceAroundKeyword under its old name SpaceBeforeModifierKeyword, it looks like it got stricter about spaces after keywords. TrailingComma also got split, and it looks like the TrailingCommaInArguments behavior is new?
* | autofixing auto-inserted delimiterslcg/chefstyle-batchLamont Granquist2016-02-091-10/+10
| |
* | auto fixing some rubocopsLamont Granquist2016-02-091-10/+10
|/ | | | | | | | | Style/NegatedWhile Style/ParenthesesAroundCondition Style/WhileUntilDo Style/WordArray Performance/ReverseEach Style/ColonMethodCall
* autofixing whitespace copsLamont Granquist2016-02-0518-446/+481
| | | | | | | | | | | | | | | | | | | | | | 4174 Style/SpaceInsideHashLiteralBraces 1860 Style/SpaceAroundOperators 1336 Style/SpaceInsideBlockBraces 1292 Style/AlignHash 997 Style/SpaceAfterComma 860 Style/SpaceAroundEqualsInParameterDefault 310 Style/EmptyLines 294 Style/IndentationConsistency 267 Style/TrailingWhitespace 238 Style/ExtraSpacing 212 Style/SpaceBeforeBlockBraces 166 Style/MultilineOperationIndentation 144 Style/TrailingBlankLines 120 Style/EmptyLineBetweenDefs 101 Style/IndentationWidth 82 Style/SpaceAroundBlockParameters 40 Style/EmptyLinesAroundMethodBody 29 Style/EmptyLinesAroundAccessModifier 1 Style/RescueEnsureAlignment
* Update all auth email address from opscode.com and getchef.com to chef.io.Noah Kantrowitz2016-02-0217-17/+17
| | | Generated via git ls-files | xargs perl -pi -e "s/(Author.*?<[^@]+@)(?:opscode\\.com|getchef\\.com)(>)/\\1chef.io\\2/gi"
* Replace all Opscode copyrights with Chef Software.Noah Kantrowitz2016-02-0216-16/+16
| | | Created via git ls-files | xargs perl -pi -e "s/(Copyright.*?), Opscode(,)? Inc(\.)?/\\1, Chef Software Inc./gi"
* Copyright year update for 2016 and massive cleanup.Noah Kantrowitz2016-02-0217-17/+17
| | | Generated via git ls-files | xargs perl -pi -e "s/[Cc]opyright (?:\([Cc]\) )?((?\!$(date +%Y))\\d{4})(-\\d{4})?([, ][ \d]+)*(,|(?= ))/Copyright \\1-$(date +%Y),/g"
* Fix /acls/data_bags local mode pathJohn Keiser2016-02-011-1/+1
|
* Adjust tests for ACLsJohn Keiser2016-02-013-2/+57
|
* Fix nil with properties:John Keiser2016-01-271-1/+1
| | | | | | 1. Warn when default values are invalid. 2. Never validate nil (on set or get) if there is no default. 3. Emit "will be invalid in Chef 13" warning when setting an invalid nil value.
* Enable Chef 12 mode for local mode by defaultdanielsdeleo2016-01-261-233/+406
|
* Fix ambiguous argument warningsdanielsdeleo2016-01-261-2/+2
|
* Fix single-quoted stringsjk/4334John Keiser2016-01-251-22/+22
|
* Fix #4334: don't warn about ambiguous property usageJohn Keiser2016-01-221-0/+28
| | | | unless using properties on the resource