Is it possible to upload test execution and coverage data separately from running sonar-scanner analysis?

I’m migrating from Code Climate to SonarCloud, and in my continuous delivery pipeline (CircleCI), I’m currently running my code analysis job in parallel with my tests job (in separate containers).
I’d like to be able to keep that same structure, where I’d trigger code analysis via sonar-scanner in that code analysis job, then upload my coverage and test execution data separately after my test job is completed.
Is this possible, or does everything (scanning, eslint results, coverage, test results) have to be sent together?


No it’s not possible.
The coverage report must be run before sonar-scanner. And the coverage report must be passed as parameter when executing the scanner, it cannot be uploaded afterwards.


This would be a very useful feature. Analysis takes quite a lot of time and it would be great if code analysis could be run in parallel with tests (producing coverage report) and other checks (e.g bandit analysis).
And then when all that is done separately post the results to the server in one last step.

We agree that it would be useful to be able to create an analysis in multiple “steps”.
We plan to implement it at some point but we don’t have a short term plan yet.

Thanks @benoit. Obviously I agree with @stefanfoulis about this being a useful feature. As it stands right now, I’ll need to rearrange my CI pipeline to make it work correctly with outputs from my eslint jobs, etc.
Perhaps a solution would be to enable appending various artifacts (coverage, test execution data, eslint reports, etc.) to an analysis, keyed on a git SHA or something like that (so the parallel build jobs would be able to know the identifier in advance).
Code Climate’s CLI provides an upload command for just that.

Hi @benoit
Is there any news on this topic? Is this feature already available or planned?

We don’t have any update on this topic, we still think it would be a good improvement but no short term plan yet.

Hello Benoit,

Please could you elaborate on what you mean by running the coverage report before Sonar scanner, and then pass it as a parameter when executing the scanner?

Kind regards

Hi @fongangd,

Please have a look into our documentation. If you still have any doubt, just tell us!