34
votes

I am currently using Java with Play framework. I have JUnit tests and I am trying to measure coverage with IntelliJ coverage runner.

Play unfortunately generates some rubbish classes and IntelliJ includes them in the report. Is there a way of excluding certain patterns from coverage report?

1
I'm in the same boat with framework classes sharing a package with my code - having a explicit exclude would be useful (all classes in a packed except x,y, and z). - Quad64Bit

1 Answers

15
votes

You can specify which classes will be added to coverage data by editing run configuration of the test (tests) being executed.

Click on "Edit Configurations" when you have selected your test, open Code coverage settings tab and inside "Packages and classes to record coverage data" you can narrow down the packages from production code included in recording of coverage.