Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Gracefully handle errors from before() and after(). #45

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

LukeShu
Copy link

@LukeShu LukeShu commented Apr 11, 2017

This is written to fix issue #44 , though it also fixes issue #29 , and subsumes PR #23.

LukeShu and others added 2 commits April 11, 2017 01:36
See the comments for a fuller explanation of the changes.

This should obsolete bmizerany#23 (though
the test cases from it should still be merged).

This should fix bmizerany#29 .

This should fix bmizerany#44 .
Fix multiple invocation of the `before` function and `before` tracing

1. The `before` function had been called twice, once with proper tracing and error
output redirection and once directly. This is fixed now.

2. The result output was moved out of the inner subshell. This is necessary
because: in case the `before` function has an error, roundup's error trap is
triggered and the inner subshell is left. Still, we need a proper result ouput.

3. A test case with a broken `before` function was added which gives
the following output:

  roundup before trace
    it_works:                                        [FAIL]
      + false
      exit code 1

for the following before function:

  before () {
    false
  }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant