-
Notifications
You must be signed in to change notification settings - Fork 29.8k
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
Feature request: test runner reporters #45648
Comments
cc: @manekinekko since you expressed interest in this. In the TAP parser PR, you initially had some colorful output that I asked you to remove. I think reporters would be the time and place to introduce that 😄 |
Thank you @cjihrig for putting this together so quickly. Gonna draft a rough design for the reporter API. Feel free to assign this work to me.
Of course, I will 😂 |
+1 for me. A few thoughts regarding the implementation:
|
cc @nodejs/test_runner |
Yes, we should. Since both ways produce TAP, it should be feasible.
Yes, we should support this too. We can make a new |
but how can we specify the target stream for each flag? |
To be determined 😅. There are different approaches we could try - maybe part of the CLI flag ( |
it should definitely be supported through
|
Here is one possible way to do it: https://github.com/hapijs/lab/blob/master/API.md#multiple-reporters (also note the Custom Reporters section immediately below it) |
We should be flexible and support both
Maintaining a configuration file can be hard sometimes. How about reusing |
PR-URL: #45712 Fixes: #45648 Reviewed-By: Antoine du Hamel <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Benjamin Gruenbaum <[email protected]>
Hi, just discovering this issue. Going forward, please always tag @nodejs/modules and @nodejs/loaders for any discussion around CLI flags that load files, |
@GeoffreyBooth sounds like a good idea, as a side note - consider joining @nodejs/test_runner yourself :) |
PR-URL: #45712 Fixes: #45648 Reviewed-By: Antoine du Hamel <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Benjamin Gruenbaum <[email protected]>
PR-URL: #45712 Fixes: #45648 Reviewed-By: Antoine du Hamel <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Benjamin Gruenbaum <[email protected]>
PR-URL: nodejs#45712 Fixes: nodejs#45648 Reviewed-By: Antoine du Hamel <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Benjamin Gruenbaum <[email protected]>
PR-URL: nodejs#45712 Fixes: nodejs#45648 Reviewed-By: Antoine du Hamel <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Benjamin Gruenbaum <[email protected]>
PR-URL: nodejs#45712 Fixes: nodejs#45648 Reviewed-By: Antoine du Hamel <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Benjamin Gruenbaum <[email protected]>
PR-URL: nodejs#45712 Fixes: nodejs#45648 Reviewed-By: Antoine du Hamel <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Benjamin Gruenbaum <[email protected]>
Backport-PR-URL: #46361 PR-URL: #45712 Fixes: #45648 Reviewed-By: Antoine du Hamel <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Benjamin Gruenbaum <[email protected]>
PR-URL: nodejs/node#45712 Fixes: nodejs/node#45648 Reviewed-By: Antoine du Hamel <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Benjamin Gruenbaum <[email protected]> (cherry picked from commit a1b27b25bb01aadd3fd2714e4b136db11b7eb85a)
PR-URL: nodejs/node#45712 Fixes: nodejs/node#45648 Reviewed-By: Antoine du Hamel <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Benjamin Gruenbaum <[email protected]> (cherry picked from commit a1b27b25bb01aadd3fd2714e4b136db11b7eb85a)
PR-URL: nodejs/node#45712 Fixes: nodejs/node#45648 Reviewed-By: Antoine du Hamel <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Benjamin Gruenbaum <[email protected]> (cherry picked from commit a1b27b25bb01aadd3fd2714e4b136db11b7eb85a)
PR-URL: nodejs/node#45712 Fixes: nodejs/node#45648 Reviewed-By: Antoine du Hamel <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Benjamin Gruenbaum <[email protected]> (cherry picked from commit a1b27b25bb01aadd3fd2714e4b136db11b7eb85a)
PR-URL: nodejs/node#45712 Fixes: nodejs/node#45648 Reviewed-By: Antoine du Hamel <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Benjamin Gruenbaum <[email protected]> (cherry picked from commit a1b27b25bb01aadd3fd2714e4b136db11b7eb85a)
PR-URL: nodejs#45712 Fixes: nodejs#45648 Reviewed-By: Antoine du Hamel <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Benjamin Gruenbaum <[email protected]>
PR-URL: #45712 Backport-PR-URL: #46839 Fixes: #45648 Reviewed-By: Antoine du Hamel <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Benjamin Gruenbaum <[email protected]>
PR-URL: #45712 Backport-PR-URL: #46839 Fixes: #45648 Reviewed-By: Antoine du Hamel <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Benjamin Gruenbaum <[email protected]>
What is the problem this feature will solve?
The test runner currently only generates TAP output. Users would like a way to author and use reporters in a format other than TAP.
What is the feature you are proposing to solve the problem?
Now that the TAP parser has landed, it would be nice to define some type of reporter API built on top of the parser output. Node should probably ship one reporter that is easier on the eyes than TAP, and can serve as an example of how to create a reporter.
I think at a minimum we would want an API that:
'test'
events. This would include the test name, result, and meta information such as the test duration, comments/user logs, and error information if the test fails.test()
anddescribe()
/it()
style tests.test()
s, or may want to count nested tests in different ways.What alternatives have you considered?
There are some existing reporters on npm already. However, I think they have a few drawbacks:
tap-arc
was looking for specific fields in the TAP output. Neither Node nortap-arc
were wrong here andtap-arc
has an open issue to work better with Node's test runner. It would be nice to build something that is guaranteed to work with Node's runner.node --test --test-reporter=my-reporter
and have it just work.The text was updated successfully, but these errors were encountered: