Giter VIP home page Giter VIP logo

gradle-cobertura-plugin's Introduction

eriwen

About Eric Wendelin

gradle-cobertura-plugin's People

Contributors

dstine avatar eriwen avatar ldaley avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

gradle-cobertura-plugin's Issues

excludes and ignores don't work

Hi guys,

Thanks for this plugin, it's really clean and readable.

But, I have an issue here, I don't know the reason, the thing is like this:

I followed the quickstart guideline and the cobertura configuration is like:

cobertura {
format = 'html'
includes = ['/*.java']
excludes = ['
/domain//.java']
ignores = ['com.domain.
']
}

After doing this, seems excludes and ignores are all not working, the report still includes the source files under package domain.

Is there something wrong with configuration?

Looking forward to your answer.

Cheers.

David

Generate Both XML and HTML Output

How about a 'both' option? We need HTML for human-readable and XML to interface with our build server.

Thanks for the work by the way - I've tried another cobertura plugin and yours is way nicer!

Thanks,

Jeff

Incorporate cobertura-check target

Hello,

Is there any chance you could incorporate the cobertura-check target so the build fails if coverage falls below a certain level? I'm using Groovy so Cobertura is my only option.

Thanks!

Enable/disable cobertura

Cobertura coverage report is really helpful especially when I build project through Jenkins. Then I can see the coverage reports. However, I do not want the build to execute cobertura when I am building my project locally. Currently, cobertura kicks in automatically when used along with java plugin. Is there a way to disable it so that it does not run?

Executing task testCoberturaReport with Gradle 1.7

Executing the task testCoberturaReport seems to cause an issue if the project doesn't contain any tests. This behavior only occurs with Gradle 1.7 but could not be observed with 1.6.

A problem was found with the configuration of task ':myProject:testCoberturaReport'.
> File '/Users/benjamin/dev/myProject/build/cobertura/main/cobertura-test.ser' specified for property 'serFile' does not exist.

ignores not being respected by cobertura-check task

I'm setting the ignores property properly and I see it getting set in the gradle-cobertura-plugin code but cobertura-check task still reports that the classes I've included don't have enough coverage. Does anybody have any insight to the relationship to the ignores property and cobertura-check? The cobertura-instrument task documentation confuses me: "You can tell Cobertura to ignore certain classes by passing in "ignore" regular expressions. The ignore pattern can be any valid perl 5 regular expression. This will ignore any calls to any method that matches the ignore regular expression. It will NOT skip over these classes during instrumention. . To exclude classes from being instrumented, either exclude them from your fileset or use the alternative method below and specify an excludeClasses pattern." I've only been able to get past cobertura-check by excluding the classes from instrumentation (I hacked a copy of the code because there does not appear to be a way to exclude classes from instrumentation in the plugin).

Could not resolve all dependencies

Adding the mapvine gradle-cobertura dependency to my buildscript { } block changed the way Gradle looked up my dependencies - ie. instead of using my virtual repo (local, then caches, then mavenCentral) it straightaway looked up jms-1.1.jar in repo1 and failed to resolve (since repo1 doesn't have the jms jar). I have the jar in my Artifactory repo in gradle-plugins-release-cache that is in my virtual repo's list. Note: If I remove the mapvine dependency, my builds work fine. Any ideas where to look?

Adding an integration test source set

I was trying to add another test source set to be included in code coverage. After having a brief look at the plugin code, it looked as if you can added through the extension method addCoverage:

task integrationTest(type: Test) {
    ...
}

cobertura {
    addCoverage(integrationTest, sourceSets.main)
}

However, when executing the task, I run into an error:

:integrationTestCoberturaReport FAILED

FAILURE: Build failed with an exception.

* What went wrong:
A problem was found with the configuration of task ':integrationTestCoberturaReport'.
> File '/Users/ben/testproject/build/cobertura/main/cobertura-test.ser' specified for property 'serFile' does not exist.

Is there a way of doing this? Maybe it's just not documented. Sorry, I didn't have a deep look at the task code yet.

Is the reportsDir configurable?

In my build script: project.buildDir = 'target' is ignored and cobertura reports go to .\build\reports\cobertura\index.html.

Is the cobertura reports directory configurable? Could it use the overridden buildDir set in my rootProject's build.gradle?

Allow offline use

Hello,

I've been trying to use this plugin without a maven repository connection. I'm able to load the cobertura library using the following:

...
repositories {
flatDir(dir: "$rootDir/lib/test", name:'test libs directory')
}
...
dependencies {
testCompile ":cobertura:1.9.4.1@jar"
}
...

However it fails on :coberturaInstrumentMain. It seems that the cobertura library can't find it's dependencies...

12:54:57.486 [INFO] [org.gradle.api.internal.project.ant.AntLoggingAdapter] [ant:cobertura-instrument] java.lang.NoClassDefFoundError: org/objectweb/asm/ClassVisitor

I've tried several different ways to add the dependencies to the classpath (asm-3.0.jar, asm-tree-3.0.jar, log4j-1.2.9.jar, ant-1.7.0.jar, and oro-2.0.8.jar) but I'm not having any luck.

After looking at the plugin source, I think it's trying to load them transitively based on information from an ivy file, but I'm not sure as I've never used ivy before.

Is it possible to add dependencies to the plugin classpath based on some configuration attribute? Unfortunately I'm developing in a disconnected environment and need to configuration control all dependencies.

Thanks,
John

Support BOTH HTML and XML reports simultaneously

We want both the HTML report (for immediate dev) and XML report (for jenkins). Please can this plugin offer xml.enabled and html.enabled, rather than format=xml/html.

We can work around this by invoking the ant task for now, but that's ugly.

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

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

So launching gradle clean testCoberturaReport 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 problem:

  • on prj1 the report shows a 0% coverage
  • 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?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.