chef-boneyard / minitest-chef-handler

Run minitest suites after your Chef recipes to check the status of your system.
Other
163 stars 44 forks source link

chef run is not failed when a minitest has a syntax error #91

Open fnoeding opened 7 years ago

fnoeding commented 7 years ago

minitest-chef-handler version: 1.1.0

When a minitest contains a syntax error, the minitest handler is simply aborted. It will not fail the chef run as expected.

Steps to reproduce:

Expected behaviour:

Chef output when this happens:

[...]
Report handler MiniTest::Chef::Handler raised #<NameError: undefined local variable or method `foo' for main:Object>
ERROR: /[...]/install_test.rb:3:in `<top (required)>'
ERROR: /opt/chef/embedded/lib/ruby/site_ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
ERROR: /opt/chef/embedded/lib/ruby/site_ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
ERROR: /opt/chef/embedded/lib/ruby/gems/2.3.0/gems/minitest-chef-handler-1.1.0/lib/minitest-chef-handler/lookup.rb:14:in `block (2 levels) in require_test_suites'
ERROR: /opt/chef/embedded/lib/ruby/gems/2.3.0/gems/minitest-chef-handler-1.1.0/lib/minitest-chef-handler/lookup.rb:14:in `each'
ERROR: /opt/chef/embedded/lib/ruby/gems/2.3.0/gems/minitest-chef-handler-1.1.0/lib/minitest-chef-handler/lookup.rb:14:in `block in require_test_suites'
ERROR: /opt/chef/embedded/lib/ruby/gems/2.3.0/gems/minitest-chef-handler-1.1.0/lib/minitest-chef-handler/lookup.rb:13:in `each'
ERROR: /opt/chef/embedded/lib/ruby/gems/2.3.0/gems/minitest-chef-handler-1.1.0/lib/minitest-chef-handler/lookup.rb:13:in `require_test_suites'
ERROR: /opt/chef/embedded/lib/ruby/gems/2.3.0/gems/minitest-chef-handler-1.1.0/lib/minitest-chef-handler.rb:27:in `report'

It seems like errors during require_test_suites are not caught leading to this behaviour.