stryker-net icon indicating copy to clipboard operation
stryker-net copied to clipboard

Ability to run single mutation from html report

Open CzBuCHi opened this issue 1 year ago • 3 comments

Is your feature request related to a problem? Please describe. Imagine project with lots of mutations that stryker will spend couple of minutes slauthering just to find out, that some mutants survived ...

Describe the solution you'd like ... now i would like to:

  1. open html report
  2. find surviving mutant
  3. modify my code
  4. run stryker again, but only as if there was just single selected mutant from 2)
    • this could be done by generating code in mte-drawer-mutant element that i just copy to terminal and run
  5. after all surviving mutans are checked run stryker for whole project again to verify my changes

Describe alternatives you've considered CLI, that will load previous report, filter surviving mutants and run tests only against those ...

Additional context In report all other mutants should get 'ignored' status and source code should be updated.

CzBuCHi avatar Sep 09 '23 11:09 CzBuCHi

You could take a look at https://stryker-mutator.io/docs/stryker-net/configuration/#mutate-glob

It supports mutating just a single line in a single file like this dotnet stryker -m "MyFolder/MyService.cs{10..11}"

richardwerkman avatar Sep 15 '23 13:09 richardwerkman

CLI, that will load previous report, filter surviving mutants and run tests only against those

This sounds interesting. @rouke-broersma would this be a nice feature for hacktoberfest?

richardwerkman avatar Sep 15 '23 13:09 richardwerkman

@richardwerkman after reading thru mutate-grob page i think that this could be used to run only survivintg mutants:

  • simple solution: generate dotnet stryker -m "MyFolder/MyService.cs{10..11}" [+params form original run] in mte-drawer-mutant element so i can copy it to terminal and run - result would be new report
  • complex solution: stryker is cappable to modify html report during execution - so in theory it could react to events from browser and trigger new run & update original report ...

sure i could parse json report externally and generate all globs but i dont like it ... (poking around in generated json - specially when its structure may change in next version)

CzBuCHi avatar Sep 15 '23 15:09 CzBuCHi