ops4j / org.ops4j.pax.exam2

Pax Exam is a testing framework for OSGi
https://ops4j1.jira.com/wiki/spaces/PAXEXAM4/
Apache License 2.0
84 stars 100 forks source link

Add Code Coverage Measurement [PAXEXAM-139] #257

Open ops4j-issues opened 15 years ago

ops4j-issues commented 15 years ago

Heiko Waldschmidt created PAXEXAM-139

I like to have a feature to:

If a developer will get an e-mail every day (from a server running exam daily) with a description of the actual code coverage of his project, this would really cool. But this can be a second step - manualy executing the feature to get the code coverage is needed first.


Affects: 1.1.0 Votes: 0, Watches: 0

ops4j-issues commented 13 years ago

Harald Wellmann commented

I'm not sure if this is really an issue for Pax Exam, it's more of a thing for the build system.

With traditional JUnit tests, you get your coverage reports from a suitable configuration of e.g. Maven plugins and Jenkins. JUnit itself doesn't have to contribute anything to this.

So the same approach should work for Pax Exam, at least with the Native Container.

The interesting question is, how do you determine the set of classes that should be covered by your tests?

With proper unit tests, there's some tests in src/test/java testing the stuff in src/main/java (and some of the dependencies, implicitly). The coverage gets computed for all classes compiled from src/test/java.

Pax Exam does integration tests. You configure n bundles to be provisioned and testedl, and your Pax Exam tests may also be distributed across multiple test projects.

So there is no clear relation like "all classes from this project need to be fully covered by tests from the same project".