use of com.teamscale.report.testwise.jacoco.cache.CoverageGenerationException in project teamscale-jacoco-agent by cqse.
the class CoverageToTeamscaleStrategy method createTestwiseCoverageReport.
/**
* Creates a testwise coverage report from the coverage collected in {@link #testExecFile} and the test execution
* information in {@link #testExecutions}.
*/
private String createTestwiseCoverageReport() throws IOException, CoverageGenerationException {
List<String> executionUniformPaths = testExecutions.stream().map(execution -> {
if (execution == null) {
return null;
} else {
return execution.getUniformPath();
}
}).collect(toList());
logger.debug("Creating testwise coverage form available tests `{}`, test executions `{}` and exec file", availableTests.stream().map(test -> test.uniformPath).collect(toList()), executionUniformPaths);
TestwiseCoverage testwiseCoverage = reportGenerator.convert(testExecFile);
logger.debug("Created testwise coverage report (containing coverage for tests `{}`)", testwiseCoverage.getTests().stream().map(TestCoverageBuilder::getUniformPath).collect(toList()));
TestwiseCoverageReport report = TestwiseCoverageReportBuilder.createFrom(availableTests, testwiseCoverage.getTests(), testExecutions);
testExecFile.delete();
testExecFile = null;
availableTests.clear();
testExecutions.clear();
return testwiseCoverageReportJsonAdapter.toJson(report);
}
Aggregations