Need to run SonarQube Analysis involving two separate Git repos: Dev and QA

Hi,

I am new to the forum so apologies if my question has been asked before.

I need to run a SonarQube code coverage analysis. But instead of the Dev Code and the tests being in one single project, they are present in two separate GitHub Repos:

  1. One for Dev which contains the application web service code (Java / SpringBoot).
  2. One for QA which contains the tests for testing the API end points of that Web service (Java/TestNG)

I need to run SonarQube / Jacoco to test the code coverage on the Dev repo, by running the tests on the QA repo, and i’m not able to figure it out.

I tried to do the same locally by creating local copies of the repos. I ran the sonar analysis locally on the QA repo, but that only tests the coverage for the QA repo and not the code in the Dev Repo.

Can anyone please help out?

I’m using SonarQube local version 9.3.0 and SonarQube Enterprise edition via Jenkins.

Hi,

Welcome to the community!

It sounds like your first question is just running the tests (and generating a coverage report). And for that, this community may not be a lot of help. Probably your best bet is going to be asking the person who thought it was a good idea to put the source files and the tests in separate repos.

Then, once you have your coverage report… I’m not sure (this very rarely comes up), but you may be able to run analysis on just the source files and pass in your coverage report and have it work. (The test files shouldn’t need to be present for the coverage report to be parsed and used.)

 
HTH,
Ann