-
Notifications
You must be signed in to change notification settings - Fork 61
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
Fix multiple invocations of the before
function and before
tracing
#23
base: master
Are you sure you want to change the base?
Conversation
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 }
There are many things I now think are not as neccessary to roundup as I once thought. |
We use If you look at my branch now, you will even find an However, coming back to this commit: this patch fixes the before mechanism as it is in your master right now. The only complexity it adds is the |
This is an embarrassing bug. :( I keep using commit a8a175a before this function was broken. |
So...I just found roundup, and it seemed awesome, but then my test setup/teardown didn't seem to be working correctly. I think it's this same issue; if I log execution of my before/after functions, I see this for a testplan with two tests:
...so yeah, it's running the |
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 }
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 }
The
before
function had been called twice, once with proper tracing and erroroutput redirection and once directly. This is fixed now.
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 istriggered and the inner subshell is left. Still, we need a proper result ouput.
A test case with a broken
before
function was added which givesthe following output:
roundup before trace
it_works: [FAIL]
+ false
exit code 1
for the following before function:
before () {
false
}