stryker-mutator / stryker-net

Mutation testing for .NET core and .NET framework!
https://stryker-mutator.io
Apache License 2.0
1.78k stars 185 forks source link

Let HTML reporter write to a single file #1571

Closed ghost closed 2 years ago

ghost commented 3 years ago

Using the html-reporter, it's frustrating to have to open a new file after each mutation test.

It would be nice, if the html-reporter was able to write its report to a single file instead of creating a new folder and file after each mutation test. This way, you could simply keep the same page open i your browser and refresh after each run.

From the top of my head, I'd suggest that the file location would be configured using a relative path from the target project.

psfinaki commented 3 years ago

Just wanted to share an opinion - I actually think it's good that the path is unique every time, I can then compare the reports after some changes.

I mean this probably can be implemented, just it shouldn't be the default and the only behavior :)

ghost commented 3 years ago

I agree, this shouldn't be the default behavior. But it would be nice to be able to configure another path.

richardwerkman commented 3 years ago

@mwo-danskecommodities If your project is open source you could look into using the stryker dashboard. This uploads your report to a online store and you'll have the latest report available at a url. This kinda does what you suggest but online. And you'll get a cool badge for your readme 😄

And as a response to your suggestion: yeah this should be an option, not default behaviour.

Since this is definitely not a blocking issue the stryker team will probably not pick this up anytime soon. You could open a PR yourself if you really want this 😉

rouke-broersma commented 2 years ago

Would be fixed by #1078 possibly on combination with https://stryker-mutator.io/docs/stryker-net/configuration/#report-file-name-string

ysbakker commented 2 years ago

You can now use -O to specify the output directory (as per #2267), and it does support relative paths as well. dotnet stryker -O StrykerOutput will always output the HTML report to ./StrykerOutput/reports/mutation-report.html.