btm / minitest-handler-cookbook

Apache License 2.0
59 stars 36 forks source link

test-kitchen run fails with minitest-handler-cookbook v1.0.1 but not 0.2.1 #54

Closed jtzl closed 10 years ago

jtzl commented 10 years ago

Honestly I haven't dug deep enough to determine if this is a minitest-handler-cookbook bug or a test-kitchen bug, so apologies in advance if this is the wrong place to submit this.

A test-kitchen run that uses minitest-handler-cookbook v0.2.1 works; v1.0.1 ends as such:

================================================================================       
Error executing action `run` on resource 'ruby_block[load tests]'       
================================================================================       

NoMethodError       
-------------       
undefined method `scratch_dir' for Chef::Resource::RubyBlock       

Cookbook Trace:       
---------------       
/tmp/kitchen-chef-zero/cache/cookbooks/minitest-handler/libraries/test_loader.rb:64:in `block (2 levels) in load_tests'       
/tmp/kitchen-chef-zero/cache/cookbooks/minitest-handler/libraries/test_loader.rb:55:in `each'       
/tmp/kitchen-chef-zero/cache/cookbooks/minitest-handler/libraries/test_loader.rb:55:in `block in load_tests'       
/tmp/kitchen-chef-zero/cache/cookbooks/minitest-handler/libraries/test_loader.rb:24:in `each'       
/tmp/kitchen-chef-zero/cache/cookbooks/minitest-handler/libraries/test_loader.rb:24:in `load_tests'       
/tmp/kitchen-chef-zero/cache/cookbooks/minitest-handler/recipes/default.rb:48:in `block (2 levels) in from_file'       

Resource Declaration:       
---------------------       
# In /tmp/kitchen-chef-zero/cache/cookbooks/minitest-handler/recipes/default.rb       

 45: ruby_block "load tests" do       
 46:   block do       
 47:     # Leverage the library code to load the test files       
 48:     load_tests()       
 49:   end       
 50: end       

Compiled Resource:       
------------------       
# Declared in /tmp/kitchen-chef-zero/cache/cookbooks/minitest-handler/recipes/default.rb:45:in `from_file'       

ruby_block("load tests") do       
  action "run"       
  retries 0       
  retry_delay 2       
  block_name "load tests"       
  cookbook_name "minitest-handler"       
  recipe_name "default"       
  block #<Proc:0x00000002531680@/tmp/kitchen-chef-zero/cache/cookbooks/minitest-handler/recipes/default.rb:46>       
end

[2013-10-27T21:50:24+00:00] INFO: Running queued delayed notifications before re-raising exception       
[2013-10-27T21:50:24+00:00] ERROR: Running exception handlers       
[2013-10-27T21:50:24+00:00] ERROR: Exception handlers complete       
[2013-10-27T21:50:24+00:00] FATAL: Stacktrace dumped to /tmp/kitchen-chef-zero/cache/chef-stacktrace.out       
Chef Client failed. 5 resources updated       
[2013-10-27T21:50:24+00:00] INFO: Shutting down Chef Zero server       
[2013-10-27T21:50:24+00:00] FATAL: Chef::Exceptions::ChildConvergeError: Chef run process exited unsuccessfully (exit code 1)       
[2013-10-27T21:50:24+00:00] INFO: Shutting down Chef Zero server       
[2013-10-27T21:50:24+00:00] ERROR: Server did not stop within 5 seconds. Killing...       
>>>>>> Converge failed on instance <default-ubuntu-1204>.
>>>>>> Please see .kitchen/logs/default-ubuntu-1204.log for more details
>>>>>> ------Exception-------
>>>>>> Class: Kitchen::ActionFailed
>>>>>> Message: SSH exited (1) for command: [sudo -E /opt/chef/embedded/bin/ruby /tmp/kitchen-chef-zero/chef-client-zero.rb --config /tmp/kitchen-chef-zero/client.rb --json-attributes /tmp/kitchen-chef-zero/dna.json --log_level info]
>>>>>> ----------------------
dpetzel commented 10 years ago

Almost certainly an issue with minitest-handler-cookbook. I think I see the issue and can probably fix it this evening. In the meantime, if you pin to 1.0.0, I think the error won't present itself.

jtzl commented 10 years ago

@dpetzel thanks, confirmed re: 1.0.0.

dpetzel commented 10 years ago

This should be all set in 1.1.2 via https://github.com/btm/minitest-handler-cookbook/commit/737f44b1ce78774e7511694f58a5ce3f03a52626