From 1aa8b797ca9d2c2ccc79bb100e4cc3c67b11b798 Mon Sep 17 00:00:00 2001 From: John Keiser Date: Mon, 30 Jun 2014 10:42:22 -0700 Subject: Allow Pedant to run if port 8889 is blocked --- spec/support/pedant/pedant_config.rb | 3 ++- spec/support/pedant/run_pedant.rb | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/spec/support/pedant/pedant_config.rb b/spec/support/pedant/pedant_config.rb index 7c9ddd73f1..6818d29d74 100644 --- a/spec/support/pedant/pedant_config.rb +++ b/spec/support/pedant/pedant_config.rb @@ -21,7 +21,8 @@ ################################################################################ # You MUST specify the address of the server the API requests will be # sent to. Only specify protocol, hostname, and port. -chef_server 'http://127.0.0.1:8889' +# NOTE this is assigned in run_pedant.rb, because it's possible 8889 will not be the port chosen. +#chef_server 'http://127.0.0.1:8889' # If you are doing development testing, you can specify the address of # the Solr server. The presence of this parameter will enable tests diff --git a/spec/support/pedant/run_pedant.rb b/spec/support/pedant/run_pedant.rb index 7764266afe..026ae176a6 100644 --- a/spec/support/pedant/run_pedant.rb +++ b/spec/support/pedant/run_pedant.rb @@ -26,7 +26,7 @@ def start_server(chef_repo_path) chef_fs = Chef::ChefFS::Config.new.local_fs data_store = Chef::ChefFS::ChefFSDataStore.new(chef_fs) data_store = ChefZero::DataStore::V1ToV2Adapter.new(data_store, 'chef', :org_defaults => ChefZero::DataStore::V1ToV2Adapter::ORG_DEFAULTS) - server = ChefZero::Server.new(:port => 8889, :data_store => data_store)#, :log_level => :debug) + server = ChefZero::Server.new(:port => 8889.upto(9999), :data_store => data_store)#, :log_level => :debug) server.start_background server end @@ -46,6 +46,7 @@ begin Pedant.config.suite = 'api' Pedant.config[:config_file] = 'spec/support/pedant/pedant_config.rb' + Pedant.config.chef_server = server.url Pedant.setup([ '--skip-knife', '--skip-validation', -- cgit v1.2.1