mbj / mutant

Automated code reviews via mutation testing - semantic code coverage.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Print partial results on SIGINT

backus opened this issue · comments

Problem / motivation

Often I'll find myself with a pretty large branch. When the progress reporter is at something like progress: 1546/2394 alive: 75 and finishing execution would take another few minutes, I really just want mutant to show me what it's found so I can focus on those specs then I'll run mutant again after that.

On a similar note, every once and a while I'll wind up with a mutant run that chews through 98% of my mutations pretty quickly, but then takes a really long time to finish the last 2%. If there are a few alive mutations already discovered, that is probably enough signal for me to get to work and I don't really need to wait around to figure out if there are any others (or, in a rare case, if I forgot to turn off some debugging tool and now mutant is stuck in a loop).

Proposal

Ideal behavior would be something like RSpec: the first time I type ctrl-c, SIGINT should gracefully stop existing execution and then transition to printing a report and exiting. A second SIGINT means just exit right away, I'm killing the program for some other reason.

This would probably be one of the bigger wins for me / my team in terms of getting faster development feedback loops.

Additional follow-up note: I'm aware I can use --fail-fast. That's not quite the same benefit IMO. Usually I just want to kill mutant and get a report like halfway through when I see something like above. A single mutation produced by --fail-fast isn't the same (definitely not going to clue me in on multiple alive methods / namespaces, for example).

This was released in v0.11.10. Cheers.