Sonar reuseReports doesn't work for emma and cobertura

Sonar reuseReports doesn't work for emma and cobertura

Hi

I will try to describe my problem briefly.
I'm trying to deliver code coverage report to sonar. I have reports in
emma (ec and em files) and in cobertura xml file.
In both cases everything works well (project is added to sonar,
surefire reports are shown etc) but there is "-" coverage score.
In command prompt I should see 'EmmaSensor' or 'CoberturaSensor' or
sth, should I? There isn't anything indicating that emma or cobertura
plugin is used.
I tested in both with Ant and Maven, for emma and cobertura.
I tested also for jacoco, giving fake report path and it shows
JacocoSensor message that coverage is 0% (in command prompt)

I will try to describe my problem briefly.
I'm trying to deliver code coverage report to sonar. I have reports in
emma (ec and em files) and in cobertura xml file.
In both cases everything works well (project is added to sonar,
surefire reports are shown etc) but there is "-" coverage score.
In command prompt I should see 'EmmaSensor' or 'CoberturaSensor' or
sth, should I? There isn't anything indicating that emma or cobertura
plugin is used.
I tested in both with Ant and Maven, for emma and cobertura.
I tested also for jacoco, giving fake report path and it shows
JacocoSensor message that coverage is 0% (in command prompt)

Re: Sonar reuseReports doesn't work for emma and cobertura

Hi
Probably I found solution of the problem. I think it should be
mentioned in the documentation.
I had empty directory of source code. It worked well with unit tests
reports ("sonar.surefire.reportsPath") but in case of re-using
coverage reports, it's necessary to have source code, I think.
It might seem obvious - if somebody are suing sonar, should have
sources - but I used it only to test coverage plugin, and I didn't
even imagine that it's required.
Please, let me know if I'm right or wrong.

Re: Sonar reuseReports doesn't work for emma and cobertura

Hi Bart,

Yes, obviously, it's necessary to have source code to run a Sonar analysis... otherwise I don't really see any interest in using Sonar.

For your information, in case of an empty source file folder, for Sonar 3.2+, the analysis explicitly fails with the following message: Project "myProject" does not contain any file in its source folders.

Hi
Probably I found solution of the problem. I think it should be
mentioned in the documentation.
I had empty directory of source code. It worked well with unit tests
reports ("sonar.surefire.reportsPath") but in case of re-using
coverage reports, it's necessary to have source code, I think.
It might seem obvious - if somebody are suing sonar, should have
sources - but I used it only to test coverage plugin, and I didn't
even imagine that it's required.
Please, let me know if I'm right or wrong.