Skip to content

Commit

Permalink
chore: introduce coverage report/check (#18)
Browse files Browse the repository at this point in the history
This change uses jacoco to add coverage report/check. Our current line coverage sits at ~70%. I set the minimum line coverage to 70% to ensure future changes align with such requirement.

When we have CI enabled, new code that doesn't meet 70% coverage will fail build.

Signed-off-by: Keran Yang <[email protected]>
Co-authored-by: Vigith Maurice <[email protected]>
  • Loading branch information
KeranYang and vigith authored Feb 13, 2023
1 parent e4e9ef2 commit cd508ad
Show file tree
Hide file tree
Showing 2 changed files with 54 additions and 0 deletions.
7 changes: 7 additions & 0 deletions lombok.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# This tells lombok this directory is the root,
# no need to look somewhere else for java code.
config.stopBubbling = true
# This will add the @lombok.Generated annotation
# to all the code generated by Lombok,
# so it can be excluded from coverage by jacoco.
lombok.addLombokGeneratedAnnotation = true
47 changes: 47 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,53 @@
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>0.8.7</version>
<configuration>
<excludes>
<exclude>io/numaproj/numaflow/sink/v1/*</exclude>
<exclude>io/numaproj/numaflow/function/v1/*</exclude>
<exclude>io/numaproj/numaflow/function/metadata/*</exclude>
<exclude>io/numaproj/numaflow/utils/*</exclude>
</excludes>
</configuration>
<executions>
<execution>
<goals>
<goal>prepare-agent</goal>
</goals>
</execution>
<execution>
<id>report</id>
<phase>prepare-package</phase>
<goals>
<goal>report</goal>
</goals>
</execution>
<execution>
<id>jacoco-check</id>
<goals>
<goal>check</goal>
</goals>
<configuration>
<rules>
<rule>
<element>BUNDLE</element>
<limits>
<limit>
<counter>LINE</counter>
<value>COVEREDRATIO</value>
<minimum>0.70</minimum>
</limit>
</limits>
</rule>
</rules>
</configuration>
</execution>
</executions>
</plugin>
</plugins>

<extensions>
Expand Down

0 comments on commit cd508ad

Please sign in to comment.