Cross-module code coverage with jacoco and gradle

55 views
Skip to first unread message

dave0...@gmail.com

unread,
Jan 5, 2018, 5:30:24 AM1/5/18
to SonarQube
Hi all,

I would like to request some support with my problem, as described below.

My situation is very similar to this stackoverflow thread:
https://stackoverflow.com/questions/41429841/cross-module-code-coverage-with-jacoco-and-gradle-multi-module-project

We have a gradle project, where one submodule is only made up of tests (which we categorize as acceptance tests, but you would find similar examples, where they are called integration tests).

The state of the referenced thread suggests, that one can resolve the issue by correctly aggregating the execution data and the reports. However, there is a rather fundamental issue I have, based on the error I am dealing with:

No JaCoCo analysis of project coverage can be done since there is no class files.

I have found the JaCoCoSensorTest.java on GitHub, which gives me the impression, that I can only make this work, by referencing the class files from the other modules.

I did some tests with that as well, leading to:

YourClass.java' is ignored. It is not located in module basedir '/home/username/Projects/Temp/test/test-acceptance'
As much as it looks like this is a technical problem, first I would like to ask, if this is a setup that is supported at all? Where one module (here Gradle, but I guess that is not relevant) contains tests (and only tests) which exercise code in other modules, to which it has no compile time dependency (think of Selenium, or some rest tests).

If that turns out to be a valid setup, I would be super interested to checkout some example projects if there are any.

Thanks very much for your help in advance!

Regards,
Dave
Reply all
Reply to author
Forward
0 new messages