Skip to content

Commit

Permalink
Add additional path
Browse files Browse the repository at this point in the history
  • Loading branch information
kaklakariada committed Oct 23, 2024
1 parent de0a76a commit f8d267e
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ Using the default configuration, the plugin will search for the Jacoco report fi
* `target/jacoco.xml`
* `target/site/jacoco.xml`
* `target/site/jacoco/jacoco.xml`
* `target/site/jacoco-aggregate/jacoco.xml`

You can configure a custom location like this:

Expand Down
3 changes: 2 additions & 1 deletion src/main/java/com/exasol/swqa/maven/SummarizerMojo.java
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,8 @@ private Path findJacocoXMLPath() throws MojoFailureException {
return this.jacocoReport.toPath().toAbsolutePath();
}
final Path targetDir = prepareTargetDirectory();
final List<Path> jacocoXMLPaths = Stream.of("jacoco.xml", "site/jacoco.xml", "site/jacoco/jacoco.xml")
final List<Path> jacocoXMLPaths = Stream
.of("jacoco.xml", "site/jacoco.xml", "site/jacoco/jacoco.xml", "site/jacoco-aggregate/jacoco.xml")
.map(targetDir::resolve).toList();
final Optional<Path> jacocoXMLPath = jacocoXMLPaths.stream().filter(Files::exists).findFirst();
if (jacocoXMLPath.isEmpty()) {
Expand Down
2 changes: 1 addition & 1 deletion src/test/java/com/exasol/swqa/maven/SummarizerMojoIT.java
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ void testExtractPathCoverage(final int missed, final int covered, final String e
}
}

@CsvSource({ "jacoco.xml", "site/jacoco.xml", "site/jacoco/jacoco.xml" })
@CsvSource({ "jacoco.xml", "site/jacoco.xml", "site/jacoco/jacoco.xml", "site/jacoco-aggregate/jacoco.xml" })
@ParameterizedTest
void testExtractPathCoverageFromPath(final Path jacocoReportPath) throws Exception {
final Path baseTestDir = BASE_TEST_DIR.resolve("project-with-coverage");
Expand Down

0 comments on commit f8d267e

Please sign in to comment.