kaocha
kaocha copied to clipboard
FR: change print-invocations plugin to put all invocations on one line
Currently, when you have multiple failures, the :kaocha.plugin/print-invocations plugin will print each failed test on its own line:
bin/kaocha --focus 'kaocha.history-test/example-one-test'
bin/kaocha --focus 'kaocha.history-test/example-two-test'
bin/kaocha --focus 'kaocha.history-test/example-three-test'
This is because the plugin is implemented with a doseq:
https://github.com/lambdaisland/kaocha/blob/9d5bb816c6e88cf5a2d10290af019e0b53cf3994/src/kaocha/plugin/print_invocations.clj#L16
Given how long it can take to start up a Clojure program, I'd like it for all of the invocations to be bundled into a single call:
bin/kaocha --focus 'kaocha.history-test/example-one-test' --focus 'kaocha.history-test/example-two-test' --focus 'kaocha.history-test/example-three-test'
If this is acceptable, I can open a PR.
I can see arguments for both behaviors, the idea with the current implementation is that you would tackle these one by one, hence the separate invocations.
Edit: Let's see if we can get some second opinions on this, or folks can vote with :+1: / :-1: .
Would it hurt to output both?
It's already quite noisy as it is...
This could be a configuration. Default to current behavior, add :kaocha.plugin.print/format :one-line or something. It complicates the implementation a smidge, but I can fix that.
I like the config idea. The two print styles are both useful but for different purposes.