Code Coverage options are different in UI and on disk

Hi,

We are using Code Coverage package v1.2.4. When running from batch mode on our build server, with USEPROJECTSETTINGS flag, we don’t get the HTML report even when the option is checked in Unity editor. After double-checking, I can see that the option is not present in Settings.json but shows up in UI as checked.

Hi @nick-morhun , I’ve tried to reproduce your issue but useProjectSettings worked correctly for me. Can you check if Auto Generate Report option is enabled in the UI too? If it’s not then that might be the reason why report is not getting generated. If it is enabled, then can you share full command line you use to launch the editor?

The command line is: “-batchmode -silent-crashes -nographics -debugCodeOptimization -runTests -buildTarget Android -logFile - -testResults $ABS_LOG_DIR_PATH\test_results.xml -testPlatform editmode -assemblyNames $TEST_ASM -enableCodeCoverage -coverageOptions "USEPROJECTSETTINGS"”.

Settings attached. I triggered all the flags, now they are present but still no report inside CodeCoverage folder. Also in the XML report all assemblies are listed, filtering is not applied.

9446447–1325543–Settings.json.zip (972 Bytes)

OK looks like there is a syntax error, and the log says “Unknown coverage option provided”. It was easy to miss… The default behavior to not use Settings.json is really surprising though, given the documentation says that -coverageOptions is optional.

Noted. Initially the settings and options were only configured in the command line in batchmode. Later we added the useProjectSettings option to be able to use the configuration in Settings.json. We will review this logic in the next major release.

1 Like