summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortyler-ball <tyleraball@gmail.com>2014-11-03 10:12:25 -0800
committertyler-ball <tyleraball@gmail.com>2014-11-03 10:12:25 -0800
commitb781ae455d73536c833cb1bb49eaaaaf9129464a (patch)
treec47ff7069f3045e9c30f5b9c022cf0704b43bc13
parent407be089ab54341b8e0d12beb267f931d8189536 (diff)
downloadchef-b781ae455d73536c833cb1bb49eaaaaf9129464a.tar.gz
Updating pedant to run correctly and send output to STDOUT
-rw-r--r--spec/support/pedant/pedant_config.rb1
-rw-r--r--spec/support/pedant/run_pedant.rb31
2 files changed, 24 insertions, 8 deletions
diff --git a/spec/support/pedant/pedant_config.rb b/spec/support/pedant/pedant_config.rb
index 6818d29d74..27e09d6a74 100644
--- a/spec/support/pedant/pedant_config.rb
+++ b/spec/support/pedant/pedant_config.rb
@@ -120,3 +120,4 @@ requestors({
self[:tags] = [:validation, :authentication, :authorization]
verify_error_messages false
+chef_server 'http://127.0.0.1:8889'
diff --git a/spec/support/pedant/run_pedant.rb b/spec/support/pedant/run_pedant.rb
index f3fa68f44c..d52be36ba7 100644
--- a/spec/support/pedant/run_pedant.rb
+++ b/spec/support/pedant/run_pedant.rb
@@ -39,18 +39,33 @@ begin
# Capture setup data into master_chef_repo_path
server = start_server(chef_repo_path)
+ # We can no longer specify the server on the command line, must put it into the config
+ open('spec/support/pedant/pedant_config.rb', 'a+') { |f|
+ f.puts "chef_server '#{server.url}'" unless f.grep(/^chef_server/)
+ }
+
include Chef::Mixin::ShellOut
- shell_out("bundle install --gemfile spec/support/pedant/Gemfile")
+ so = nil
+
+ Bundler.with_clean_env do
+
+ cmd = Mixlib::ShellOut.new("bundle install --gemfile spec/support/pedant/Gemfile")
+ cmd.live_stream = STDOUT
+ cmd.run_command
- pedant_cmd = "chef-pedant " +
- " --config spec/support/pedant/pedant_config.rb" +
- " --server #{server.url}" +
- " --skip-knife --skip-validation --skip-authentication" +
- " --skip-authorization --skip-omnibus"
- so = shell_out("bundle exec #{pedant_cmd}")
+ pedant_cmd = "chef-pedant " +
+ " --config spec/support/pedant/pedant_config.rb" +
+ #" --server #{server.url}" +
+ " --skip-knife --skip-validation --skip-authentication" +
+ " --skip-authorization --skip-omnibus"
+ cmd = Mixlib::ShellOut.new("bundle exec #{pedant_cmd}", :env => {'BUNDLE_GEMFILE' => 'spec/support/pedant/Gemfile'})
+ cmd.live_stream = STDOUT
+ cmd.run_command
+
+ server.stop if server.running?
+ end
- server.stop if server.running?
ensure
FileUtils.remove_entry_secure(tmpdir) if tmpdir
end