Add absolute path to json report
See original GitHub issueIs your feature request related to a problem? Please describe.
The path from where you execute dotnet stryker
is also the location where Stryker will output its reports.
The json report currently only contains the relative path of the file under test: https://github.com/stryker-mutator/stryker-net/blob/fd278b1f783ea5948d90ea15f5af276eb316ca2d/src/Stryker.Core/Stryker.Core/Reporters/JsonReporter/JsonReport.cs#L98
But depending on from where you have executed dotnet stryker
the json report is either persisted to the folder containing the test project or to the folder containing the project under test.
Because only an absolute path to the mutated file is available in the json reports, and the location where the mutation-report.json
might vary, it is currently hard to reliably find the file on disk based on the relative path in the json report.
Describe the solution you’d like
Add metadata to the json report so that it is possible to determine the absolute path of a mutated file that was reported to the JSON report, similar to how other coverage and mutation formats do this (e.g. pitest, opencover, jacoco, cobertura, etc)
One light-weight option might be that the mutation-report.json
contains a field with the absolute path of the project folder (or file) that was tested. And the reported relative paths are then relative to that folder.
Example json mutation report:
{
"schemaVersion": "1.3",
"projectRoot": "/some/location"
"files": {
"SomeClass.cs": {
...
}
}
}
By using such a structure, automated tools can more easily and reliably determine the absolute location of SomeClass.cs
.
Additional context My context is that I’m building tools that automatically collect and correlate code & test metrics.
Issue Analytics
- State:
- Created 3 years ago
- Reactions:1
- Comments:5 (3 by maintainers)
@p3pijn Sorry it took so long. This has finally been implemented both in the json schema and in stryker. It will be included in the next release.
I think it is a good idea to make this information available in the json as Metadata and not as absolute paths 👍.
Could you also create an issue for this in stryker-mutator/mutation-testing-elements? Our shared json schema definition lives in that repo.