summaryrefslogtreecommitdiff
path: root/Rakefile
diff options
context:
space:
mode:
authorJordan Running <jr@getchef.com>2016-02-11 13:06:56 -0600
committerJordan Running <jr@getchef.com>2016-02-24 13:35:19 -0600
commit2469894eab12f24893916b571a981e082dfe97df (patch)
treebc657d22f7f41dad46a68f9825189c2dd20053b9 /Rakefile
parent86e99a48cc39a0b5c931c29fbfef9e196252c9c2 (diff)
downloadchef-zero-2469894eab12f24893916b571a981e082dfe97df.tar.gz
Make user and client keys endpoints pass Pedant specs
- Implement ActorKeyEndpoint, ActorKeysEndpoint. - Implement user, client keys in `ActorEndpoint#delete`, `#put`. - RestBase - Fix RestErrorResponse exceptions to report actual `rest_path` instead associated with the failed data store operation instead of `request.rest_path`. - Move `json_response`, `already_json_response` args `request_version` and `response_version` into options hash; add docs. - DataError, RestErrorResponse: Pass useful message text to `super`. - RestRouter: Clean up logging - Print request methods, paths and bodies more readably for log_level >= INFO. - Pretty-print RestRequest objects (only printed when log_level == DEBUG). - Server: Change default log_level to `:warn` (to enable logging cleanup above). - `Rakefile`, `spec/run_oc_pedant.rb` - Consume RSpec, Pedant options from `ENV['RSPEC_OPTS']`, `ENV['PEDANT_OPTS']` (see `rake -D`). - Consume `ENV['LOG_LEVEL'` (see `rake -D`). - Clean up ChefZero::Server default opts and move duplicated logic to `start_chef_server` method.
Diffstat (limited to 'Rakefile')
-rw-r--r--Rakefile36
1 files changed, 23 insertions, 13 deletions
diff --git a/Rakefile b/Rakefile
index d8a0282..bbb984c 100644
--- a/Rakefile
+++ b/Rakefile
@@ -3,33 +3,43 @@ require 'bundler/gem_tasks'
require 'chef_zero/version'
+def run_oc_pedant(env={})
+ ENV.update(env)
+ require File.expand_path('spec/run_oc_pedant')
+end
+
+ENV_DOCS = <<END
+Environment:
+ - RSPEC_OPTS Options to pass to RSpec
+ e.g. RSPEC_OPTS="--fail-fast --profile 5"
+ - PEDANT_OPTS Options to pass to oc-chef-pedant
+ e.g. PEDANT_OPTS="--focus-keys --skip-users"
+ - LOG_LEVEL Set the log level (default: warn)
+ e.g. LOG_LEVEL=debug
+END
+
task :default => :pedant
-desc "run specs"
+desc "Run specs"
task :spec do
system('rspec spec/*_spec.rb')
end
-desc "run oc pedant"
-task :pedant do
- require File.expand_path('spec/run_oc_pedant')
-end
+desc "Run oc-chef-pedant\n\n#{ENV_DOCS}"
+task :pedant => :oc_pedant
-desc "run pedant with CHEF_FS set"
+desc "Run oc-chef-pedant with CHEF_FS set\n\n#{ENV_DOCS}"
task :cheffs do
- ENV['CHEF_FS'] = "yes"
- require File.expand_path('spec/run_oc_pedant')
+ run_oc_pedant('CHEF_FS' => 'yes')
end
-desc "run pedant with FILE_STORE set"
+desc "Run oc-chef-pedant with FILE_STORE set\n\n#{ENV_DOCS}"
task :filestore do
- ENV['FILE_STORE'] = "yes"
- require File.expand_path('spec/run_oc_pedant')
+ run_oc_pedant('FILE_STORE' => 'yes')
end
-desc "run oc pedant"
task :oc_pedant do
- require File.expand_path('spec/run_oc_pedant')
+ run_oc_pedant
end
task :chef_spec do