Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fail the build if test coverage below minimum threshold #590

Closed
remkop opened this issue Jan 4, 2019 · 0 comments
Closed

Fail the build if test coverage below minimum threshold #590

remkop opened this issue Jan 4, 2019 · 0 comments

Comments

@remkop
Copy link
Owner

remkop commented Jan 4, 2019

Index: build.gradle
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- build.gradle	(date 1546566279179)
+++ build.gradle	(date 1546566279179)
@@ -60,6 +60,7 @@
     javadoc {
         destinationDir   = file("build/docs/apidocs")
     }
+	javadoc.options.addStringOption('Xdoclint:none', '-quiet')
     // work around https://github.com/gradle/gradle/issues/4046
     javadoc.dependsOn('copyJavadocDocFiles')
     task copyJavadocDocFiles(type: Copy) {
@@ -133,6 +134,18 @@
         html.enabled false
     }
 }
+jacocoTestCoverageVerification {
+    violationRules {
+        rule {
+            limit {
+                minimum = 0.98
+            }
+        }
+    }
+}
+// run coverage verification during the build (and fail when appropriate)
+check.dependsOn jacocoTestCoverageVerification
+
 task bumpReadmeVersion {
     doLast {
         // README.md
@remkop remkop added this to the 3.9 milestone Jan 4, 2019
@remkop remkop closed this as completed in e2ab175 Jan 4, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant