Use Settings.json for coverage from command line

Hi,
Is there a way to have code coverage use the Settings.json config file instead of having to specify all the options every time from command line? Having to list the assemblies/exclusions/inclusions in two different places (Settings.json and command line for CI) is extremely prone to misalignment.
If not, can we have this feature please? It would be even better to be able to specify the Settings.json to use, as well as overrides if needed (e.g., output the report in a different folder, or “do not generate html/badge”).

I Apologize if this has been asked somewhere else but i couldn’t find anything related tagged as code coverage.

Thank you,
Marco

Hi Marco. Thank you for the suggestion. We can introduce a new command line -coverageOption (eg. useProjectSettings) to use the settings in Settings.json instead, and any settings still passed in the command line will override the settings from Settings.json. Let me know what you think.

Thank you,
Nikos

1 Like

Hi Nikos,
Yes, that would be ideal!

On a separate note, I i’ve also found a bug with the normal coverage window. Let’s say that you set up a folder (e.g. "value": "{\"m_Value\":\"{ProjectPath}/Coverage\"}". When you reopen the window, if that folder doesn’t exist (it happens to us because we .gitignore it), the path gets reset to "value": "{\"m_Value\":\"{ProjectPath}\"}". This happens both for Path and HistoryPath.

Repro steps:

  • Create a folder (e.g. Coverage under the project root)

  • Open the coverage window

  • Select folder created at (1) for both Path and History

  • Close coverage window

  • Delete folder created at (1)

  • Open the coverage window again

  • Observe the Results Location and the History Location, as well as the values in the Settings.json being reset to project root

Moreover, from this point, if you:

  • Close the coverage window
  • Create the folder again
  • Revert the changes to Settings.json manually
  • Reopen the coverage window

It somehow goes back to root again, changing yet again the Settings.json file to root too.
This is extremely problematic for us, and it would be nice if the behavior was to create the folder on demand when the report/history have to be saved instead.

Thank you again,
Marco

Hey Marco. Thank you for your report. I’ll open a bug for this and will share a link to issue tracker once it’s ready.

Edit:
Issue can be tracked here https://issuetracker.unity3d.com/product/unity/issues/guid/1334551/

-useProjectSettings is available in version 1.1.0
The fix for case 1334551 is available in version 1.1.0 and 1.0.1

@Unity-Nikos Hi, is there any example of Settings.json. i couldn’t find any information in documents…