-
Notifications
You must be signed in to change notification settings - Fork 412
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
make TAP output possible in ppx_inline_test #1227
Comments
If you'd like to work on this, then we'd be happy to guide you. |
I don't have a lot of experience with OCaml, but with some guidance I'm willing to take a stab on it. How do we get started with this? |
Actually, I'm not fully aware of what @diml had in mind when he mentioned co-operation with the build system. Do we need a flag for the ppx_inline_test runner to output .tap output? Or do we just have the .tap output in a separate file? |
My mental model is that while the test is running, it needs to continuously output a stream of feedback that is interpreted by another tool. Is that correct? Currently, dune captures the output of all commands, in order to avoid mixing up the output of commands in parallel builds. So we need the build system to cooperate in order for the TAP output to be consumable in real time by another tool. |
Seems correct to me. You want to have continuous output while the tests are running.
The user should be able to choose if he wants to output it through a TAP tool or not, so probably a flag in dune? (I don't know the architecture of dune and inline tests, so not sure what the cleanest way would be). |
BTW, do you have examples of TAP consumers? Just to see what we would get from adding TAP support. |
Thanks. In one run of |
It seems that tap has some support for parallel running tests: https://www.node-tap.org/parallel/. The protocol supports the idea of subtests:
So I guess that could be used for the multiple test executables? |
IIUC this page correctly, the tests are run directly by the My previous understanding was that supporting tap would work this way:
But I realise that this might not be the case. I don't know much about TAP, could explain a bit what it provides and how it is supposed to interact with the build system? |
The node-tap page is an implementation of the tap protocol (both runner and output). This page is actual a better source: http://testanything.org/ I'm actually not that familiar with the TAP protocol, but I used it and the output can be a lot nicer/cleaner that what you get at the moment with dune. |
Yes, that seems reasonable, thanks for the pointers. But before looking more into this, have you looked at expectation testing? It seems to me that this is solving the same problem, but in an ever nicer way. This workflow is now completely supported by Dune. |
I have looked and used expectation testing. Some things were missing for me though:
Maybe some of these are already possible and I didn't dive in the documentation deep enough. |
For the first point, you can consider that classic inline tests ( The second point could indeed be improved. Regarding colors, if you install |
I've tried this:
I still don't see the other failed test in the output.
I've just read about |
Ah , indeed. We worked on ppx_expect to improve handling of uncaught exceptions, however this work is only in the development version and hasn't been released in opam yet.
It might be possible to configure patdiff a bit, though I don't know the details. Feel free to open a ticket on https://github.com/janestreet/patdiff. |
Looking forward to this!
Opened this bug: janestreet/patdiff#10 |
Since the thread got a little side-tracked — I'd still like to see actual realtime-output supported, so testing tools like Alcotest and ppx_inline_test could produce TAP. My own usecase is tying together multiple testing-systems at the shell level, merging multiple TAP streams into one coherent test-suite output. For instance, piping Jest thru jest-json-to-tap, and then merging it with the OCaml-side testing-output using multi-tap and piping it into a debouncing filesystem-watcher or pretty-output formatter or aggregate statistics on test suites or all of the above. Anyway, it's pretty standard across a bunch of languages and ecosystems (which has been a real blessing, when you're a polyglot like I!); I'd love to see it make inroads in the OCaml ecosystem. |
I think that the dune team is definitely in favor of this feature but none of us posses the expertise to complete this project. If there's an external contributor that would like to shepherd this project, then we'd be glad to help as much as we can. |
I came across this bug in ppx_inline_test with the mention to create a bug here. Didn't find a bug, so creating this one.
The output of
ppx_inline_test
could really be improved and using TAP would open a lot of options for formatting/reporting.The text was updated successfully, but these errors were encountered: