You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@plc4x.apache.org by Christofer Dutz <ch...@c-ware.de> on 2018/01/05 09:57:50 UTC
Coverage reports
Hi all,
This morning I worked on getting the coverage reports working in sonarqube. Had to jump some hoops, but now I think things should be working:
https://builds.apache.org/analysis/component_measures/metric/coverage/list?id=org.apache.plc4x%3Aplc4x-parent
We’re currently at 67%
Chris
Re: Coverage reports
Posted by Justin Mclean <ju...@classsoftware.com>.
Hi,
> clean install sonar:sonar -Dsonar.host.url=http://localhost:9000/
All good working for me as well.
Thanks,
Justin
Re: Coverage reports
Posted by Justin Mclean <ju...@classsoftware.com>.
Hi,
> Also it would be helpful if DEVELOPMENT.md were updated to capture the “how to run sonar locally” info below.
I you use intelliJ you can use the sonar lint plugin, eclipse may have a similar plug in I’m not sure.
To run sonar locally (if you just want occasional use) it just a matter of starting the server:’
/bin/macosx-universal-64/sonar.sh start
And running the scanner:
mvn sonar:sonar -Dsonar.host.url=http://localhost:9000/ -Dsonar.scm.provider=git
And go to http://localhost:9000/ in a browser.
Thanks,
Justin
Re: Coverage reports
Posted by Christofer Dutz <ch...@c-ware.de>.
Hi Dale,
Unfortunately, the configuration of the coverage checks didn’t work anyway so they didn’t inherit a not working config. I just noticed that the rules are parameters of the “check” goal. So, I added an execution of that goal to the build. Also, I moved the configuration to a self-activating java profile so now they are working in the Edgent module too and there the report says:
[INFO] --- jacoco-maven-plugin:0.7.9:check (check-coverage) @ apache-edgent ---
[INFO] Loading execution data file /Users/christofer.dutz/Projects/Apache/PLC4X/integrations/apache-edgent/target/target/coverage-reports/jacoco-ut.exec
[INFO] Analyzed bundle 'apache-edgent' with 5 classes
[INFO] All coverage checks have been met.
Good job :-)
I however had to prevent failing coverage reports to break the build as the camel integration is less well tested:
[INFO] --- jacoco-maven-plugin:0.7.9:check (check-coverage) @ apache-camel ---
[INFO] Loading execution data file /Users/christofer.dutz/Projects/Apache/PLC4X/integrations/apache-camel/target/target/coverage-reports/jacoco-ut.exec
[INFO] Analyzed bundle 'apache-camel' with 4 classes
[WARNING] Rule violated for bundle apache-camel: instructions covered ratio is 0.00, but expected minimum is 0.50
[WARNING] Rule violated for bundle apache-camel: classes missed count is 4, but expected maximum is 0
[WARNING] Coverage checks have not been met. See log for details.
It would be cool if the camel adapter could receive some tests ;-)
Chris
Am 08.01.18, 18:36 schrieb "Dale LaBossiere" <dl...@apache.org>:
On the topic of coverage…
The way the “integrations” are setup, they aren’t inheriting the “Fail the build” config setup in plc4j/pom.xml.
Is that intentional? Should that config be pushed up into the top level pom, or duplicated in integrations/pom.xml (or individual integrations)?
Also it would be helpful if DEVELOPMENT.md were updated to capture the “how to run sonar locally” info below.
Thanks!
— Dale
> On Jan 6, 2018, at 12:32 PM, Christofer Dutz <ch...@c-ware.de> wrote:
>
> Hi Justin,
>
> well I just installed and started a local sonarqube server and executed this:
>
> clean install sonar:sonar -Dsonar.host.url=http://localhost:9000/
>
> And it worked file.
>
> Chris
>
> Am 06.01.18, 01:24 schrieb "Justin Mclean" <ju...@classsoftware.com>:
>
> Hi,
>
> I've see you changed it so that running locally no longer works and it’s publishing to Apache builds.
>
> That’s great but how would I test my changes and run sonar locally before having to commit changes?
>
> Thanks,
> Justin
>
Re: Coverage reports
Posted by Dale LaBossiere <dl...@apache.org>.
On the topic of coverage…
The way the “integrations” are setup, they aren’t inheriting the “Fail the build” config setup in plc4j/pom.xml.
Is that intentional? Should that config be pushed up into the top level pom, or duplicated in integrations/pom.xml (or individual integrations)?
Also it would be helpful if DEVELOPMENT.md were updated to capture the “how to run sonar locally” info below.
Thanks!
— Dale
> On Jan 6, 2018, at 12:32 PM, Christofer Dutz <ch...@c-ware.de> wrote:
>
> Hi Justin,
>
> well I just installed and started a local sonarqube server and executed this:
>
> clean install sonar:sonar -Dsonar.host.url=http://localhost:9000/
>
> And it worked file.
>
> Chris
>
> Am 06.01.18, 01:24 schrieb "Justin Mclean" <ju...@classsoftware.com>:
>
> Hi,
>
> I've see you changed it so that running locally no longer works and it’s publishing to Apache builds.
>
> That’s great but how would I test my changes and run sonar locally before having to commit changes?
>
> Thanks,
> Justin
>
Re: Coverage reports
Posted by Christofer Dutz <ch...@c-ware.de>.
Hi Justin,
well I just installed and started a local sonarqube server and executed this:
clean install sonar:sonar -Dsonar.host.url=http://localhost:9000/
And it worked file.
Chris
Am 06.01.18, 01:24 schrieb "Justin Mclean" <ju...@classsoftware.com>:
Hi,
I've see you changed it so that running locally no longer works and it’s publishing to Apache builds.
That’s great but how would I test my changes and run sonar locally before having to commit changes?
Thanks,
Justin
Re: Coverage reports
Posted by Justin Mclean <ju...@classsoftware.com>.
Hi,
I've see you changed it so that running locally no longer works and it’s publishing to Apache builds.
That’s great but how would I test my changes and run sonar locally before having to commit changes?
Thanks,
Justin