lambdaisland / kaocha

Full featured next gen Clojure test runner
https://cljdoc.org/d/lambdaisland/kaocha/1.0.861/doc/1-introduction
Eclipse Public License 1.0
792 stars 81 forks source link

FR: change print-invocations plugin to put all invocations on one line #434

Open NoahTheDuke opened 3 months ago

NoahTheDuke commented 3 months ago

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.

plexus commented 2 months ago

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: .

imrekoszo commented 2 months ago

Would it hurt to output both?

plexus commented 2 months ago

It's already quite noisy as it is...

NoahTheDuke commented 2 months ago

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.

imrekoszo commented 2 months ago

I like the config idea. The two print styles are both useful but for different purposes.