diff options
author | Daniel DeLeo <dan@opscode.com> | 2010-06-26 12:00:53 -0700 |
---|---|---|
committer | Daniel DeLeo <dan@opscode.com> | 2010-06-26 12:00:53 -0700 |
commit | 6816ff0af993b554a3f0b9f44c3ec32ec751159d (patch) | |
tree | 86f0b2febd5884e2286476e8f00ac80b5003ba5d | |
parent | 76ba632e14ab47330e0fbb85f6bfab4bcadd3476 (diff) | |
download | chef-6816ff0af993b554a3f0b9f44c3ec32ec751159d.tar.gz |
speed up features by not running ohai so much
-rw-r--r-- | features/data/config/client.rb | 3 | ||||
-rw-r--r-- | features/search/search_data.feature | 2 | ||||
-rw-r--r-- | features/steps/node_steps.rb | 4 | ||||
-rw-r--r-- | features/support/env.rb | 24 |
4 files changed, 28 insertions, 5 deletions
diff --git a/features/data/config/client.rb b/features/data/config/client.rb index 51f7e10290..c194351c54 100644 --- a/features/data/config/client.rb +++ b/features/data/config/client.rb @@ -19,3 +19,6 @@ validation_key File.join(systmpdir, "validation.pem") client_key File.join(systmpdir, "client.pem") cache_type "Memory" cache_options({}) + +Ohai::Config[:disabled_plugins] << 'darwin::system_profiler' << 'darwin::kernel' << 'darwin::ssh_host_key' << 'network_listeners' +Ohai::Config[:disabled_plugins ]<< 'darwin::uptime' << 'darwin::filesystem' << 'dmi' << 'lanuages' << 'perl' << 'python' << 'java' diff --git a/features/search/search_data.feature b/features/search/search_data.feature index 3d49e18810..1378c96b6c 100644 --- a/features/search/search_data.feature +++ b/features/search/search_data.feature @@ -10,7 +10,7 @@ Feature: Search Data And a 'data_bag' named 'users' exists And a 'data_bag_item' named 'francis' exists And a 'data_bag_item' named 'axl_rose' exists - When I run the chef-client + When I run the chef-client with '-l debug' Then the run should exit '0' And a file named 'francis' should exist And a file named 'axl_rose' should exist diff --git a/features/steps/node_steps.rb b/features/steps/node_steps.rb index 0c10475736..1bf1055a13 100644 --- a/features/steps/node_steps.rb +++ b/features/steps/node_steps.rb @@ -20,7 +20,7 @@ # Given ### Given /^a validated node$/ do - client.run_ohai + # client should have cached ohai assigned to it client.determine_node_name client.register client.build_node @@ -28,7 +28,7 @@ Given /^a validated node$/ do end Given /^a validated node with an empty runlist$/ do - client.run_ohai + # client should have cached ohai assigned to it client.determine_node_name client.register client.build_node diff --git a/features/support/env.rb b/features/support/env.rb index 8a985066aa..e8c54d4002 100644 --- a/features/support/env.rb +++ b/features/support/env.rb @@ -48,6 +48,9 @@ require 'restclient' include Chef::Mixin::ShellOut +Ohai::Config[:disabled_plugins] << 'darwin::system_profiler' << 'darwin::kernel' << 'darwin::ssh_host_key' << 'network_listeners' +Ohai::Config[:disabled_plugins ]<< 'darwin::uptime' << 'darwin::filesystem' << 'dmi' << 'lanuages' << 'perl' << 'python' << 'java' + ENV['LOG_LEVEL'] ||= 'error' def setup_logging @@ -94,7 +97,7 @@ def create_databases cmd = [KNIFE_CMD, "cookbook", "upload", "-a", "-o", INTEGRATION_COOKBOOKS, "-u", "validator", "-k", File.join(Dir.tmpdir, "validation.pem"), "-c", KNIFE_CONFIG] Chef::Log.info("Uploading fixture cookbooks with #{cmd.join(' ')}") - shell_out!(*cmd) + shell_out!(*cmd, :timeout => 120) end def prepare_replicas @@ -133,8 +136,25 @@ module ChefWorld :chef_args, :config_file, :stdout, :stderr, :status, :exception, :gemserver_thread, :sandbox_url + def self.ohai + # ohai takes a while, so only ever run it once. + @ohai ||= begin + o = Ohai::System.new + o.all_plugins + o + end + end + + def ohai + ChefWorld.ohai + end + def client - @client ||= Chef::Client.new + @client ||= begin + c = Chef::Client.new + c.ohai = ohai + c + end end def rest |