Publishing Karma result in sonar - sonarqube

I'm trying to publish karma report in sonar.Ours is a angularJS application Maven project.Already sonarqube is displaying junit code coverage.I have generated lcov.info file but sonarqube is not picking up the file.I have included following properties in sonar but its not working
sonar.javascript.jstestdriver.reportsPath=reports/
sonar.javascript.lcov.reportPath=src/main/webapp/coverage/lcov.info
Any help is appreciated.

Related

Code coverage published to Sonar is not correct

We're using Sonar Server 9.1 and using maven command to publish reports to Sonar along with code coverage generated through Jacoco
In index.html file generated for code coverage, we can see code coverage as - 68% but used jacoco.xml file to publish to Sonar it's showing only 48.6% code coverages.
What analysis I should do to find the cause of discrepancy?

Code coverage won't display in Sonarqbue when posting trhough sonar scanner

Sonarqube server 6.7.7
Sonar scanner 4.6.2
sonar-project.properties
sonar.java.binaries=target/classes
#sonar.junit.reportsPath=target/surefire-reports
#sonar.surefire.reportsPath=target/surefire-reports
#sonar.jacoco.reportPaths=target/jacoco.exec
sonar.coverage.jacoco.xmlReportPaths=/target/site/jacoco/jacoco.xml
sonar.java.coveragePlugin=jacoco
sonar.verbose=true
Note: I used the jacoco.xml or the jacoco.exec still not able to display
sonarqube dashboard showing no code coverage

Unit Test Coverage is not coming in Sonarqube

I have configured Jenkins 2.31.1 with Maven 3.3.9 , and I am using Sonarqube 5.6.4, when I am building my Java project from Jenkins then test cases are getting executed also I am getting report in Sonarqube but Unit Tests Coverage is coming as "-".
Can anyone explain the steps to resolve this issue? How can I get Unit Tests Coverage? What are the changes I need to do ? What are the steps to be followed? Am I missing something here?
Here is link to my git repository -
https://github.com/swapnil0504/HelloFromMaven.git

Can we integrate the Allure report to Maven based TestNG project

I have successfully integrated the allure-report to my Maven based testNG project, and report is successfully generated which I can see by running a jetty server and looking at my localhost. So the xml reports which are generated are inside the main project folder.
Now I am integrating the jenkins with my Test project, Now I am able to build the project from jenkins but not able to see the allure report in the Jenkins. I tried adding the allure-report plugin to my jenkins but I guess I am missing some basic config for allure-report and jenkins.
Kindly suggest if someone has got success in it.
You would have to configure the Allure-Plugin as a Post-Build action in your Jenkins job. There you can set the folder where your xml-results are generated to in your project. Normally this would be "target/allure-results".
The rest should be done by the plugin...

After upgrade to SonarQube 5.3 Cobertura test coverage is missing

I recently upgraded to SonarQube 5.3 and now test coverage using Cobertura is no longer published/analyzed.
It looks like JaCoCo is default code coverage no matter what we install or configure. Log shows that SonarQube is looking and not finding JaCoCo reports.
Is there still support for Cobertura with 5.3?
I tried to configure cobertura but sonar.java.coveragePlugin does not seem to do much anymore. You can specify what you like using this property but the JaCoCo will be used.
[INFO] JaCoCoSensor: JaCoCo report not found : E:\myproject\jacoco.exec
[INFO] JaCoCoItSensor: JaCoCo IT report not found: E:\myproject\jacoco-it.exec
Since SonarQube 4.2 the test report isn’t generated by SonarQube anymore (see SonarQube blog post for more information). So you have to do it by your own before you run the sonar analyze. For Maven builds, I wrote a sample how to integrate JaCoCo test reporting generation into a Maven build.
For Cobertura, you have to install the Cobertura Plugin for SonarQube. On that site it is explained how to generate the reports.

Resources