gctoolkit icon indicating copy to clipboard operation
gctoolkit copied to clipboard

Adding Test Coverage Report, Static Code Analysis & Code Style Check

Open pliakas opened this issue 4 years ago • 10 comments
trafficstars

I would recommend to add the following tools

Test Coverage

I would be useful to add JaCoCo in order to have a test coverage report and in the future set the limits for test coverage. It can be also enabled in the build pipelines.

Static code Analysis

Maybe also some static code analysis tool, such as Spotbugs

Code style

Adding also support to Checkstyle based on predefined code style

pliakas avatar Aug 06 '21 07:08 pliakas

Agreed, I think we'd prefer this to be Maven based reporting, see #8

karianna avatar Aug 06 '21 11:08 karianna

I would recommend using sonar cloud for static code analysis. On Spotbugs website suggest "SpotBugs can scan bytecode (class files) generated by JDK8 and newer versions. However, support for Java 11 and newer is still experimental. Visit issue tracker to find known problems." Above project has started working on JDK 11. Any comments?

anantk24 avatar Aug 09 '21 14:08 anantk24

We typically use checkstyle, PMD, and Spotbugs on projects. Sonar cloud is often OTT, but I'd be curious to explore it if we can use a free tier.

karianna avatar Aug 09 '21 15:08 karianna

As sonarcloud is free for public projects, can be explored for this project. Only thing is maintainer has to setup GitHub workflow for sonar cloud. Checkstyle, PMD spotbugs can be configured in maven .

I would be happy to take up this task, once everything is finalized.

anantk24 avatar Aug 10 '21 09:08 anantk24

As sonarcloud is free for public projects, can be explored for this project. Only thing is maintainer has to setup GitHub workflow for sonar cloud. Checkstyle, PMD spotbugs can be configured in maven .

I would be happy to take up this task, once everything is finalized.

OK so Microsoft is an org in Sonarcloud but we need to get the core committers added before we can set that up. In the meantime, if you'd like to add Checkstyle, PMD, and Spotbugs to our Maven reporting that would be most welcome!

karianna avatar Aug 10 '21 09:08 karianna

Sure. I will take it up. Please assign it to me.

anantk24 avatar Aug 10 '21 17:08 anantk24

@karianna @anantk24 i already started with the jacoco maven plug-in , but you can do the other :) or you can also add jacoco maven plug-in also not big change :)

pliakas avatar Aug 10 '21 18:08 pliakas

@pliakas you go ahead with jacoco changes. I will take up spotbugs and checkstyle. One question everyone, should we add mvn spotbugs:check goal after clean install stage? If we add, this will fail the build in github workflow because existing modules needs changes according to spotbugs. Added pull request #33 with workflow checks

anantk24 avatar Aug 11 '21 15:08 anantk24

I think this issue has been fixed. Spotbugs and checkstyle related changes are merged . @pliakas has merged changes related jacoco. @pliakas Can we close this issue?

anantk24 avatar Aug 25 '21 14:08 anantk24

I do want to test the SonarCloud integration before closing (on my todo list!)

karianna avatar Aug 25 '21 15:08 karianna

done

ghost avatar Jan 25 '23 20:01 ghost