Cannot see jacoco coverage in sonarcloude

Hi
I have following GitHub action setup and integrated with Sonarcloud, I can see static code analysis information but Jacoco code coverage is not updating.

GitHub action : Add RulesRelatesToMethods · BathiyaL/code-quality-analysis@7640628 · GitHub

name: Build and analyze
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}  # Needed to get PR information, if any
          SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}        
        run: mvn clean test -B -X sonar:sonar -Pcoverage org.sonarsource.scanner.maven:sonar-maven-plugin:sonar -Dsonar.projectKey=BathiyaL_code-quality-analysis

appreciate your help on this

It sure looks like coverage is importing:

2022-08-09T14:50:47.1145333Z [INFO] 14:50:47.114 Importing 1 report(s). Turn your logs in debug mode in order to see the exhaustive list.
2022-08-09T14:50:47.1149134Z [DEBUG] 14:50:47.114 Reading report '/home/runner/work/code-quality-analysis/code-quality-analysis/target/site/jacoco/jacoco.xml'
2022-08-09T14:50:47.1342832Z [INFO] 14:50:47.134 Sensor JaCoCo XML Report Importer [jacoco] (done) | time=23ms
2022-08-09T14:50:47.1348591Z [INFO] 14:50:47.134 Sensor CSS Rules [javascript]

It just appears that no tests have been written that cover the code introduced in your pull request.

Hey Colin, Thank you very much for the information.
you are correct, it works fine with the new code changes. The coverage I was expecting was not in the new code(PR) and I didn’t realize this.

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.