Hi. It seems like the path for Settings.json file has changed but docs weren’t updated - I’ll open a bug to fix that.
File is located in <project_root>/ProjectSettings/Packages/com.unity.testtools.codecoverage/Settings.json. It stores settings for code coverage window. My advice would be to not change file directly, but to use code coverage window to make the changes you need.
when i run code coverage via command line, i pass -useProjectSettings, but it seems nothing happened…It didn’t use settings which i set in code coverage window…
Could you give me a sample how to use the useProjectSettings command
useProjectSettings is one of the coverage options, so you need to pass it as a parameter for the coverageOptions argument. Like this: -coverageOptions "useProjectSettings" You can find more examples on how to use coverage options and generate coverage in batchmode here.
HI… i have tried -coverageOptions "useProjectSettings" , but no luck
The whole comand using is
unity.exe -runTests -batchmode -projectPath .\TestProjects\CodeCoverage\ -testResult D:\SDK_YTestFramework\result.xml -testPlatform PlayMode -logFile D:\Unity.log -enableCodeCoverage -coverageResultPath D:\CodeCoverage - coverageHistroyPath D:\CodeCoverage -coverageOptions “useProjectSettings”
After running this command, there are several issues:
Test result didn’t shown in D:\SDK_YTestFramework\result.xml, it was saved in D:\SDK_YTestFramework\TestProjects\CodeCoverage\TestResults-638170665428637916.xml
Code Coverage report wasn’t be generated in D:\CodeCoverage\ folder.
Here’s my Settings.json found in ProjectSettings, and manifest i am using, and the command log file
Hi @Tuncle . Regarding your first point, you have a typo in your command line - instead of testResult it should be testResults (plural).
Second point, however, appears to be a bug. As a workaround, toggle Auto Generate Report off and on again so Settings.json would be updated with a missing entry. Alternatively, you can add it manually: