Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

For the code coverage to increase , one would need to run the tests with the coverage enabled and then view the report generated locally to see the areas covered by jacoco during its coverage parse, then from these one would see the methods (per class) that needs to be covered from the view of the jacoco agent. If these methods are then tested, the coverage would then increase.

For instance in the client we are able to view the class coverage per method

fig 1: jacoco code coverage per class within 

the above report is the coverage within the org.ei.opensrp.path.activity package

...

e.g from this example, if we tested the areas marked in red, the coverage by jacoco will increase

fig 2: visual for code coverage showing methods in class

Red means the code block was not covered by the tests, While green means code block is covered

The jacoco code coverage file can be found(after running) in the project file ../../reports/jacoco/html/index.html

Also for issues with code coverage for PowerMocked static entities checkout the gotchas here