mutmut icon indicating copy to clipboard operation
mutmut copied to clipboard

[QUESTION] Option to Only Show Files with Surviving Mutants In HTML Report

Open FloatingSunfish opened this issue 3 years ago • 7 comments

I can generate an HTML report that contains mutmut's results with mutmut html.

However, it also shows files where surviving mutants are 0. Is there a flag I can use so the report will only contain files where surviving mutants are > 0?

FloatingSunfish avatar Jul 01 '21 05:07 FloatingSunfish

What do you want the html report for?

Personally I have always thought the report is totally useless so with or without your suggestion it'd still be useless to me so I guess I need more information :)

boxed avatar Jul 03 '21 12:07 boxed

@boxed I use the report to check each file with surviving mutants one by one (I click on the files to open them in their own tab) and look at what mutants survived.

I do the same thing for Python's coverage HTML report. Check what files don't have 100% coverage, open each file on their own tab, and see what I need to cover. coverage has a helpful flag to exclude files already covered at 100% from the HTML report so I only see files that I need to work on.

FloatingSunfish avatar Jul 03 '21 14:07 FloatingSunfish

I strongly recommend you use the mutmut commands instead. Much faster.

boxed avatar Jul 03 '21 19:07 boxed

@boxed Could you provide the commands for my specific usecase? I'll try them out and let you know my thoughts as well. 🙂

FloatingSunfish avatar Jul 04 '21 05:07 FloatingSunfish

mutmut status to get the list of mutants. You can also do mutmut status <file> to get mutant ids for a specific file. Then mutmut show <id> to show a mutants diff.

boxed avatar Jul 04 '21 07:07 boxed

@boxed I can't find any docs for mutmut status. Does this only show surviving mutants?

FloatingSunfish avatar Jul 04 '21 07:07 FloatingSunfish

As mutation testing can take a lot of time, those tests might be run on a CI server. Having an HTML report as an artefact that can be viewed as result (e.g. in Jenkins you can easily grab any HTML produced during the run and link it on the job's page) can be beneficial, even more so if the report is as slim as possible.

DudeNr33 avatar Sep 16 '21 19:09 DudeNr33