kaocha icon indicating copy to clipboard operation
kaocha copied to clipboard

Behavior similar to RSpec's --only-failures flag

Open robhanlon22 opened this issue 3 years ago • 3 comments

https://relishapp.com/rspec/rspec-core/docs/command-line/only-failures

RSpec can optionally emit metadata about tests that failed to a text file, which can then be consumed by subsequent runs via --only-failures (run all tests that failed) and --next-failure (run all failed tests but fail fast).

This could be really useful in REPL-driven workflows:

(kaocha.repl/run :only-failures)
(kaocha.repl/run :next-failure)

robhanlon22 avatar Sep 22 '22 21:09 robhanlon22

@robhanlon22 Thanks for the idea! FYI, we do have bits and pieces of this functionality:

  • --watch automatically reruns failures, but I don't think using watch is particularly ergonomic in the REPL.
  • You can use the print-invocations plugin to show you the command to run the failing tests.
  • You can print all results with --print-result

Would having --only-failures in the command line be useful to you as well?

alysbrooks avatar Oct 19 '22 19:10 alysbrooks

I moved this to a new "New features" column on the CT board, while I'm not sure about the exact syntax proposal I do like the idea, but we'll have to think this through a bit more.

plexus avatar Nov 25 '22 12:11 plexus

I think this functionality is useful enough that we want to keep this open. I also think we could build other functionality using a feature that tracks previous runs. For example, we could profile across runs and show, e.g., major increases in the time it takes a test to run.

alysbrooks avatar Jul 07 '23 21:07 alysbrooks