question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Add absolute path to json report

See original GitHub issue

Is 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:closed
  • Created 3 years ago
  • Reactions:1
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
rouke-broersmacommented, Jan 25, 2021

@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.

1reaction
rouke-broersmacommented, Jul 27, 2020

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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Get absolute path of JSON object
In your question you are asking how to get the path to "my JSON object", but your sample JSON actually contains four objects,...
Read more >
Set the File Path of JSON or CSV DataSource Through Report ...
This article explains how to set the file path of the CSV or JSON file of JSON or CSV DataSource through a report...
Read more >
How to set an absolute path in TypeScript
Here are the steps on how to configure TypeScript to make use of absolute paths including an explanation of what an absolute path...
Read more >
How to set an absolute path in JavaScript
Here are the steps on how to configure JavaScript to make use of absolute paths including an explanation of what an absolute path...
Read more >
Format Query Results as JSON with FOR JSON - SQL Server
In this article ... Format query results as JSON, or export data from SQL Server as JSON, by adding the FOR JSON clause...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found