-
Notifications
You must be signed in to change notification settings - Fork 20
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
Not forwarding upstream failures #15
Comments
Thanks @kgryte. What I will do is exiting with |
Fix released under a new version |
I think my fix only partially covers the issue. In case of upstream failures, |
@kgryte |
@aghassemi Awesome! Thanks! Will take it for a spin now. :) |
@aghassemi So, the patch works for the case in the OP; however, not when TAP output is printed before the error message. To reproduce, $ node -e 'console.log("TAP version 13\n# beep\nok 1 boop");throw new Error("ERROR");' | ./node_modules/.bin/tap-xunit || echo 'FAILED'
In this case, the TAP output is not valid, as it is missing the plan (which, in normal testing, may be absent due to a syntax error interrupting control flow before the plan is printed). But despite the TAP not being valid, |
@kgryte fixed in |
No worries! Thank you so much for your work and quick turnaround! Will test out now. :) |
I can confirm that my tests now fail in the event of an error thrown upstream of |
no problem, happy to help. BTW, you can also pass |
Consider the following failing test file
When run and piped to
tap-xunit
$ node test.js | tap-xunit
the exit code for the pipeline is
0
, as a non-zero error code when the process exits is not handled bytap-xunit
.To reproduce locally,
I would expect, similar to other tap reporters, such as tap-spec, that an upstream failure would propagate through
tap-xunit
. For an example of handling upstream exit statuses, see tap-spec.For context, I am using
tap-xunit
on CircleCI. If upstream tests contain syntax errors, as opposed to test failures, the build succeeds, when, in fact, the build should fail. While I am aware of setting thepipefail
option, I believe a better option would be fortap-xunit
to account for upstream failures ensuring consistent behavior with other TAP reporters.The text was updated successfully, but these errors were encountered: