From d261385f331f68ee2237cf2c47c19d2d2b68552d Mon Sep 17 00:00:00 2001 From: Weimin Yu Date: Thu, 9 Jan 2020 16:32:33 -0500 Subject: [PATCH] Make Jacoco work with multiple test tasks (#437) * Make Jacoco work with multiple test tasks By default Jacoco only looks at execution data from the 'test' task. This is a problem to 'core' which has multiple test sets. --- java_common.gradle | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/java_common.gradle b/java_common.gradle index d81981937..d77f39b8a 100644 --- a/java_common.gradle +++ b/java_common.gradle @@ -121,6 +121,11 @@ spotless { } } +jacocoTestReport { + // Use coverage data from all tests tasks, not just the one named 'test'. + getExecutionData().setFrom(fileTree(buildDir).include("/jacoco/*.exec")) +} + // Initialize for coverage minimum determination for each sub project. task initCoverageMinimums { // Use current coverage ratio of each subproject as placeholder value.