kaocha icon indicating copy to clipboard operation
kaocha copied to clipboard

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

Open NoahTheDuke opened this issue 1 year ago • 5 comments

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.

NoahTheDuke avatar May 02 '24 20:05 NoahTheDuke

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

plexus avatar May 07 '24 06:05 plexus

Would it hurt to output both?

imrekoszo avatar May 07 '24 11:05 imrekoszo

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

plexus avatar May 07 '24 11:05 plexus

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.

NoahTheDuke avatar May 07 '24 13:05 NoahTheDuke

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

imrekoszo avatar May 07 '24 14:05 imrekoszo