Do the coverage files have to be created during the scanning process?

We are currently considering whether we want to use SonarQube Enterprise in our company. I have a question regarding the integration of code coverage in dotnet projects, since this is not clear to me from the documentation:

Do unit tests and the resulting coverage file need to be created in the scan process or can we drop a coverage file that already exists from previous pipeline steps at the specified path?

Is SonarQube only interested in having a coverage file available at the end of the scan execution or do the tests need to have effectively run in the scan process?

I would appreciate a short feedback.

Hi there, @akanwischer, and welcome to the community!

Generally speaking, we recommend generating the tests during the analysis run because we rely on file paths to link coverage information and source.

As long as the file paths are coherent (meaning the file paths in the coverage file map to a valid path and point to the correct file during analysis), then it’s perfectly OK to feed them to the scanner.

If the paths are different because they were created on a different host, then you can also investigate replacing the root of the paths to match the current repository path.

In any case, your requirement has been added to our list of requests for when we look at this problem in the future.

Denis