summaryrefslogtreecommitdiff
path: root/spec/integration
diff options
context:
space:
mode:
authorLamont Granquist <lamont@scriptkiddie.org>2015-10-05 17:22:09 -0700
committerLamont Granquist <lamont@scriptkiddie.org>2015-10-05 17:22:09 -0700
commit130a94291555c03ca4775596ac940bac433b9174 (patch)
treef5051bfa89a8c6899ce9fdfa9ba3e56168277476 /spec/integration
parent69cf21c8b35d7fb94775db377e810908e5fad54a (diff)
downloadchef-130a94291555c03ca4775596ac940bac433b9174.tar.gz
add optional ruby-profiling with --profile-ruby
dumps a large call graph into /var/chef/cache/graph_profile.out
Diffstat (limited to 'spec/integration')
-rw-r--r--spec/integration/client/client_spec.rb17
1 files changed, 17 insertions, 0 deletions
diff --git a/spec/integration/client/client_spec.rb b/spec/integration/client/client_spec.rb
index 5b235e2720..314a9310be 100644
--- a/spec/integration/client/client_spec.rb
+++ b/spec/integration/client/client_spec.rb
@@ -301,6 +301,23 @@ EOM
result.error!
end
+ it "should complete with success when using --profile-ruby and output a profile file" do
+ file 'config/client.rb', <<EOM
+local_mode true
+cookbook_path "#{path_to('cookbooks')}"
+EOM
+ result = shell_out!("#{chef_client} -c \"#{path_to('config/client.rb')}\" -o 'x::default' -z --profile-ruby", :cwd => chef_dir)
+ expect(File.exist?(path_to("config/local-mode-cache/cache/graph_profile.out"))).to be true
+ end
+
+ it "doesn't produce a profile when --profile-ruby is not present" do
+ file 'config/client.rb', <<EOM
+local_mode true
+cookbook_path "#{path_to('cookbooks')}"
+EOM
+ result = shell_out!("#{chef_client} -c \"#{path_to('config/client.rb')}\" -o 'x::default' -z", :cwd => chef_dir)
+ expect(File.exist?(path_to("config/local-mode-cache/cache/graph_profile.out"))).to be false
+ end
end
when_the_repository "has a cookbook that generates deprecation warnings" do