Skip to content

Provide a Clover diff between two reports, excluding test classes and showing global TPC contribution diffs for each Maven module with the goal of finding out which modules are negatively contributing to the global TPC

xwiki/xwiki-clover-maven

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

25 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Rationale

Maven plugin that we execute in our Clover CI pipeline to verify that we don't lower the global coverage. It's indeed possible that at the module level the coverage stays flat or increases (as measure by Jacoco), while we reduce the global coverage:

  • If some modules with a high coverage are moved to Contrib for example the global TPC will decrease.
  • If a new module with a coverage lower than the global one is introduce, it'll lower the global TPC.
  • If some refactoring are done in a given module and that module was tested by functional tests, and the refactoring causes different code to be exercised, then the global coverage can be reduced.

Links:

Usage

Make sure the XWiki Maven Repository is added to your Maven settings.xml file so that this plugin can be found.

Configuration inside a pom.xml:

<plugin>
  <groupId>org.xwiki.clover</groupId>
  <artifactId>xwiki-clover-maven</artifactId>
  <version>1.0</version>
  <configuration>
    <oldReportId>20171222-1835</oldReportId>
    <newReportId>20181129-1122</newReportId>
    <oldCloverXMLReport>reports/clover-20171222-1835.xml</oldCloverXMLReport>
    <newCloverXMLReport>reports/clover-20181129-1122.xml</newCloverXMLReport>
  </configuration>
  <executions>
    <execution>
      <id>report</id>
      <goals>
        <goal>report</goal>
      </goals>
    </execution>
  </executions>
</plugin>

And then mvn clean xwiki-clover:report.

Directly from the command line:

mvn clean xwiki-clover:report \
  -DoldCloverXMLReport=reports/clover-20171222-1835.xml -DoldReportId=20171222-1835 \
  -DnewCloverXMLReport=reports/clover-20181129-1122.xml -DnewReportId=20181129-1122

Options

  • It's possible to pass the reports either as file locations or as URLs.
  • The output directory is configurable with the outputDirectory configuration property in the pom.xml or by using the diffReportOutputDirectory command line system property.

Examples

About

Provide a Clover diff between two reports, excluding test classes and showing global TPC contribution diffs for each Maven module with the goal of finding out which modules are negatively contributing to the global TPC

Resources

Stars

Watchers

Forks

Packages

No packages published