gradle_cobertura icon indicating copy to clipboard operation
gradle_cobertura copied to clipboard

Support generating coverage reports for a multiproject build where tests are isolated into a single project

Open davidecavestro opened this issue 11 years ago • 0 comments

I'm searching for a gradle cobertura plugin that supports my scenario: I have a multiproject where several projects contains some logically related contents and a single project that provides tests for all other projects. The tests have been moved to a dedicate project cause I every project is backed by an eclipse project, and eclipse doesn't support separating tests from sources (within a single project). See http://tech.groups.yahoo.com/group/junit/message/22398

I've not found yet a way to configure the plugin for this usage.

So launching gradle clean cobertura on a gradle multiproject structure like the following

.                                         //the multi-project
|-- build.gradle
|-- prj1                                  //the 'real' project
|   |-- build.gradle
|   `-- src
|       `-- main
|           `-- groovy
|               `-- Foo.groovy
|-- settings.gradle
`-- testprj                              //the test project
    |-- build.gradle
    `-- src
        `-- test
            `-- groovy
                `-- FooTest.groovy      //tests for Foo.groovy

I have the following problems:

  1. trying to see source contents on prj1 the report complains Unable to locate Foo.groovy. Have you specified the source directory?
  2. no coverage data available for cross-project tests (coverage is 0%)
  3. on testprj the coverage report is empty

Screenshot-Coverage Report - Google Chrome

I've uploaded an archive with the complete multiproject test case.

UPDATE: I've filed a similar issue to other gradle-cobertura plugins... is there any change to join your forces and provide a unified, comprehensive plugin that supports even my scenario?

  • https://github.com/Mapvine/gradle-cobertura-plugin/issues/10
  • https://github.com/stevesaliman/gradle-cobertura-plugin/issues/7

davidecavestro avatar Feb 14 '13 11:02 davidecavestro