Make run_tests output progressive - #345
Conversation
Factors computation of results and statistics in a single list traversal, but now the output is progressive, which I find convenient for large testsuites
jmid
commented
Jun 19, 2025
Thanks - and apologies for the delay! 🙏 I completely agree that having to wait for, e.g., 10 tests to complete is sub-optimal if the error is already happening in number 1 or 2. Even worse if, e.g., number 8 hangs, that means one will not get any earlier counterexamples printed The question is how we can make the output progressive while still keeping it manageable.
I think we should take a step backward and consider how we would like the output of those cases to be structured?
|
jmid
commented
Jun 19, 2025
I just thought of another thing: 🤔
|
rmonat
commented
Jun 26, 2025
From my understanding of
I'm not sure it's easy to do properly without new dependencies and in a cross-platform fashion, but we could probably keep some space for the header and print the rest/logs afterwards?
Agreed!
Is this displayed by default? It could be an option? Or displayed after the summary, and the logs/messages? |
jmid
commented
Jul 1, 2025
Yes, the statistics are currently printed in both verbose and non-verbose mode. Finally I thought of (yet another) printing option I had forgotten above. With #let t =QCheck.(Test.make ~name:"List.rev test"~max_fail:3 (listint) (funxs -> xs =List.rev xs));;
valt : QCheck.Test.t=QCheck2.Test.Test<abstr>#QCheck_base_runner.run_tests~verbose:true [t];;
random seed: 361065173
generated errorfailpass/totaltimetestname
[✗] 3030/1000.0s List.revtest---Failure--------------------------------------------------------------------TestList.rev test failed (132 shrink steps):
[0; 1]
---Failure--------------------------------------------------------------------TestList.rev test failed (122 shrink steps):
[0; -1]
---Failure--------------------------------------------------------------------TestList.rev test failed (123 shrink steps):
[0; 1]
================================================================================
failure (1 tests failed, 0 tests errored, ran 1 tests)
- : int=1 |
I was tired of having to wait for the whole tests to finish to get any output. This PR factors computation of results and statistics in a single list traversal, but now the output of results is progressive.
I find this more convenient but I would understand if there are good reasons not to do it that way :)