SonarQube with OpenCover and Bamboo

  • SonarQube version 10.3
  • OpenCover 4.7.922
  • Bamboo version 9.6.4 (code coverage worked in earlier versions)
  • SonarQube is running on a Linux agent installed via zip
  • OpenCover does not report coverage data to SonarQube.

There is a newer version of OpenCover that we will try install and see if that works better.

We are trying to get suggestions for how to troubleshoot this further. Since OpenCover is an archived project it is difficult to know what steps to take.
One question is if SonarQube will continue to suggest OpenCover even though the OpenCover project is archived since 2021. OpenCover is still listed on the documentation at .NET test coverage Is there a better test coverage tool that is supported?

Our build server reports this:

|build|17-Oct-2024 18:44:47|No results, this could be for a number of reasons. The most common reasons are:|
|---|---|---|
|build|17-Oct-2024 18:44:47|    1) missing PDBs for the assemblies that match the filter please review the|
|build|17-Oct-2024 18:44:47|    output file and refer to the Usage guide (Usage.rtf) about filters.|
|build|17-Oct-2024 18:44:47|    2) the profiler may not be registered correctly, please refer to the Usage|
|build|17-Oct-2024 18:44:47|    guide and the -register switch.|

The script we run is this:
opencover.4.7.922\OpenCover.Console.exe -target:$dotnetInstallPath -targetargs:“test $SolutionPath --no-build --logger console;verbosity=normal --logger trx” -register:Path32 -output:$TestResultsOutputPath

Any suggestions for what to do to get code coverage back is appreciated.

Hi,

Your question is beautifully timed. I just saw internal discussion today that we’ll probably work soon on cleaning OpenCover out of the docs and sub-in altcover. There’s work to be done first tho to have working examples which we can then use to re-populate the documentation.

In the meantime, I can only advise you to double-check your build configuration to make sure it matches the docs as well as possible.

 
Ann

Thanks much for quick response. We are considering changing to Altcover. However, one of my developers found a couple of differences in how Altcover works vs opencover that will require developers to change things in their dotnet projects. The developer is looking further and if he can come up with a clear description of what we think is missing in Altcover I will post here and on the Altcover support channel if I can find one.

1 Like