Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Jacoco report target filtering. #6736
Adds an argument for the jacoco jvm coverage processor that filters targets included in reports using a list of regular expressions.
The current implementation of jacoco code coverage will produce a report that includes all targets used in the test run. This includes targets not directly under test, but dependencies of the package actually under test. As a result, there's a lot of undesirable noise in the reports.
Introduce a parameter to filter the class files supplied to the jacoco cli when the report is produced. The jacoco cli does not provide a native parameter for exclusions, and instead the best we can do is to exclude class files when generating the reports. Classes that aren't passed to the cli during report generation aren't included in the resulting report.
The parameter I've added is a list of regular expressions. When specified, pants will only pass targets that match one of the regexes to the cli during report generation. Any target that doesn't match the pattern will be excluded, and thus not show up in the report.