Need to get only Unit Test Coverage results using SONAR - code-coverage

Is there any way I could JUST get the unit test code coverage results on SONAR. My project is to just focus on the code coverage and not on code issues/violations/rules etc.
It would be a big time saver for me. As the project that I am dealing with has million lines of code. I have all my jacoco.exec files generated and appended. Sonar analyses in and out of our code and which takes hours. code standards,rules,violations,issues for which my project is not concerned off.
Any help on this would be highly appreciative.
Regards
Eajaz

This is really an edge case for the use of SonarQube.
If you use an empty quality profile for analysis, you should not get any issue on your code, only metrics - including coverage, which seems your main concern.

Related

Overall (integration + unit tests) coverage on single file code view

I'm getting integration and unit tests coverage with sonarqube (v4.4). But the most important information is which parts of the code aren't covered by any of tests at all. I can easily get this information for whole projects on widgets, but on file view there is no option for overall coverage. Is this possible at all?
I'm attaching a screen that possibly will explain my intentions better.
This has been added in 4.5, see https://jira.codehaus.org/browse/SONAR-5474

Aggregate jmockit-coverage output with emma coverage output

Is there a way to aggregate code coverage data from jmockit-coverage and emma coverage? I can run the two different coverage steps in two separate junit ant tasks and generate the coverage data in two directories. Just not sure if the coverage outputs from these two are compatible and can be merged to display together.
No, they can't be aggregated into a single HTML report, since these are two different code coverage tools, which know nothing about each other. Of course, someone could create yet another tool which would do that; personally, I don't see much value in it, though.

How to quickly find out which tests have been fixed in jenkins

I have inherited a quite rotten test suite with over 1000 tests, where several hundreds are failing. There are several people fixing the tests, and I would like to quickly see which tests have been fixed between test job runs.
Currently, I copy the lists of failed tests from two runs, sort and diff them. I hope there is a better way.
The only thing I could find that mentions a better possibility is this old thread.
Thank you.
Have you considered using Sonar (now SonarQube)? You can pipe test results over to Sonar and keep test history in a searchable format. We use PMD/Findbugs/etc and test results to red/yellow/green a job for further CI deployment, but use Sonar for trends and analysis.

No valid coverage data available in Rails stats report

`No valid coverage data available
Tracking and trending code coverage works best when like is compared with like. In this regard it is best to only track builds when all unit tests are passing.
This plugin will not report code coverage until there is at least one stable build.`
what should i do to have a rails stats report
#krs - From what you've said in your comments, you are correct.
rails stats only provides code coverage metrics for tests at that point in time. rails stats does not intend to keep data between builds and report test results vs. code converage.
You can connect your CI to an external service to see test coverage vs. test results. (EG, https://coveralls.io).
Please add coverage.xml file outside the project.It works fine for me.

Free alternatives to Atlassian Clover?

Reasking my older question:
Java test coverage: who covers what?
Background: I look at sonar's coverage report for a class and want to know, which test contributes to the coverage of a specific line / branch, so that it easy to got to that test and add the test for the newly introduced if-branch.
Are there other (preferably free) alternatives to clover in the IDE? Perhaps even such that they can be included into sonar ?
Or maybe tricks to enhance, accumulate information with some scripting in emma-reports ?
Or even further, patch emma or cobertura to log the required info (instead of logging a "1" for counting, one could well log the names of class under test and the test, I assume)
Thanks!
You should definitely give a try to JaCoCo. Its integration with Sonar allows to benefit from new features, for example :
merge coverage by unit and integration tests. See http://www.sonarsource.org/sonar-3-3-in-screenshots/
track the relations between tests and tested code (since sonar 3.5). You can find a screenshot on the documentation page: http://docs.codehaus.org/display/SONAR/Resource+Viewer#ResourceViewer-CoverageTab

Resources