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

Add command line option for opening report only when mutant survives / close successful report

Open CzBuCHi opened this issue 1 year ago • 6 comments

Is your feature request related to a problem? Please describe. I would like to open html report only when mutant survive, which is currenly not possible.

Describe the solution you'd like open html report only when mutant survive -or- auto close report when all mutants are killed

Describe alternatives you've considered

  1. Return non-zero exit code so i can do IF NOT ERRORLEVEL 0 OPEN_REPORT in command line
  2. modify --open-report flag to allow something like --open-report=close-successful
    • deserialized as enum (true, false, close) instead of boolean
    • current behavior still apply (for backwards compatibility)
    • when new version used and all mutants are killed report will automatically close

EDIT: 3. --open-report=when-failed that would open report after first mutant survives

CzBuCHi avatar Sep 05 '23 20:09 CzBuCHi

Modifying auto open sounds good, I like it. But I don't think auto close is possible. How would we instruct the browser to do that?

rouke-broersma avatar Sep 06 '23 05:09 rouke-broersma

How would we instruct the browser to do that?

my first tought was taskkill /pid 1234 but now when im thinking about it more is see the issue (browser will not close tab) ...

CzBuCHi avatar Sep 06 '23 08:09 CzBuCHi

How would we instruct the browser to do that?

my first tought was taskkill /pid 1234 but now when im thinking about it more is see the issue (browser will not close tab) ...

Well 1 we wouldn't have permission to do that and 2 we wouldn't know what the pid is because we have no way of knowing which browser is is even hosting the report.

rouke-broersma avatar Sep 06 '23 08:09 rouke-broersma

got another idea: return number of survived mutants to caller (this one is probably the simplest to implement) - so i can do something like:

dotnet stryker ...
if not errorlevel 0 open_report

CzBuCHi avatar Sep 11 '23 21:09 CzBuCHi

I don't see much value in this, to be honest. Why do you actually want this? What about building a notification system in the report? So that you get notified when a surviving mutant is found.

richardwerkman avatar Sep 15 '23 13:09 richardwerkman

Why do you actually want this?

im running multiple stryker call in batch file (to save time i run stryker only whn report file is outdated) and currently to find out if mutants survived i need:

  1. keep watching console
  2. use -o parameter to open html report -or- open report manually afterwards

in both situations i end up with report opened in browser even when no mutants survived ... i would prefer to open report only when mutants are found

What about building a notification system in the report?

notify who? and how?

CzBuCHi avatar Sep 15 '23 14:09 CzBuCHi