Fix error formatting in debug mode
Backtrace filtering was only disabled for exception cause, this change ensure no backtrace filtering at all in debug mode. * Prevent main exception filtering when debug mode is enabled; * Test when exception cause must be displayed; * Test how exception cause must be displayed.
This commit is contained in:
@@ -1,11 +1,13 @@
|
||||
Feature: CLI debug option
|
||||
|
||||
Background:
|
||||
Given a recipe with:
|
||||
"""
|
||||
task(:trigger_error) { fail 'some error' }
|
||||
"""
|
||||
|
||||
Scenario: reports recipe errors
|
||||
Scenario: reports recipe errors with their cause
|
||||
Given a recipe with an error
|
||||
When I execute the recipe with option -d
|
||||
Then the output must match /\ARuntimeError:.*\n\ncause:\nRuntimeError:/
|
||||
|
||||
Scenario: does not exclude anything from backtrace
|
||||
Given a recipe using a remote
|
||||
When I execute the recipe on unknown remote target with option -d
|
||||
Then the output must contain "producer-core"
|
||||
And the output must contain "net-ssh"
|
||||
And the output must contain ruby lib directory
|
||||
|
@@ -26,6 +26,10 @@ Then /^the error output must contain exactly "([^"]+)"$/ do |content|
|
||||
assert_exact_output content, all_stderr
|
||||
end
|
||||
|
||||
Then /^the output must contain ruby lib directory$/ do
|
||||
assert_partial_output RbConfig::CONFIG['rubylibdir'], all_output
|
||||
end
|
||||
|
||||
Then /^the output must not contain ruby lib directory$/ do
|
||||
assert_no_partial_output RbConfig::CONFIG['rubylibdir'], all_output
|
||||
end
|
||||
|
@@ -27,6 +27,11 @@ When /^I execute the recipe on unknown remote target$/ do
|
||||
assert_matching_output '\ASocketError', all_output
|
||||
end
|
||||
|
||||
When /^I execute the recipe on unknown remote target with option (-.+)$/ do |option|
|
||||
run_simple "producer recipe.rb #{option} -t #unknown_host.test", false
|
||||
assert_matching_output '\ASocketError', all_output
|
||||
end
|
||||
|
||||
When /^I successfully execute the recipe$/ do
|
||||
step 'I execute the recipe'
|
||||
assert_exit_status 0
|
||||
|
Reference in New Issue
Block a user