beckje01 / grails-code-coverage

Git Repo of the Grails Code Coverage plugin.
http://grails.org/plugin/code-coverage
16 stars 26 forks source link

Emtpy report in Jeakins - Cobertura: Loaded information on 0 classes. #34

Open satan1999 opened 10 years ago

satan1999 commented 10 years ago

I am using grails 2.4.3 and ':code-coverage:2.0.3-2'

When i run test-app -coverage -xml in local machine, it looks fine.

When i run test-coverage in jeakins(cobertura 1.9.5, the grails.project.fork was commented out ) , i got the following logs

[java] [cobertura-instrument] Cobertura 2.0.3 - GNU GPL License (NO WARRANTY) - See COPYRIGHT file [java] [cobertura-instrument] 21/10/2014 12:08:39 AM net.sourceforge.cobertura.coveragedata.CoverageDataFileHandler loadCoverageData [java] [cobertura-instrument] SEVERE: Cobertura: Error reading from object stream. [java] [cobertura-instrument] java.lang.NullPointerException [java] [cobertura-instrument] at net.sourceforge.cobertura.coveragedata.CoverageDataFileHandler.loadCoverageData(CoverageDataFileHandler.java:85) [java] [cobertura-instrument] at net.sourceforge.cobertura.coveragedata.CoverageDataFileHandler.loadCoverageData(CoverageDataFileHandler.java:61) [java] [cobertura-instrument] at net.sourceforge.cobertura.instrument.Main.parseArguments(Main.java:381) [java] [cobertura-instrument] at net.sourceforge.cobertura.instrument.Main.main(Main.java:421) [java] [cobertura-instrument] WARN instrumentClass, Unable to instrument file /var/lib/jenkins/jobs/API-CI-TestSuite/workspace/target/classes/SecurityConfig$_run_closure1.class [java] [cobertura-instrument] java.lang.NullPointerException [java] [cobertura-instrument] at net.sourceforge.cobertura.instrument.tp.ClassMap.applyOnProjectData(ClassMap.java:364) [java] [cobertura-instrument] at net.sourceforge.cobertura.instrument.CoberturaInstrumenter.instrumentClass(CoberturaInstrumenter.java:187) [java] [cobertura-instrument] at net.sourceforge.cobertura.instrument.CoberturaInstrumenter.instrumentClass(CoberturaInstrumenter.java:121) [java] [cobertura-instrument] at net.sourceforge.cobertura.instrument.CoberturaInstrumenter.addInstrumentationToSingleClass(CoberturaInstrumenter.java:234) [java] [cobertura-instrument] at net.sourceforge.cobertura.instrument.Main.addInstrumentationToSingleClass(Main.java:298) [java] [cobertura-instrument] at net.sourceforge.cobertura.instrument.Main.addInstrumentation(Main.java:307) [java] [cobertura-instrument] at net.sourceforge.cobertura.instrument.Main.parseArguments(Main.java:399) [java] [cobertura-instrument] at net.sourceforge.cobertura.instrument.Main.main(Main.java:421) . . . [cobertura-report] INFO: Cobertura: Loaded information on 0 classes.

beckje01 commented 10 years ago

What version of Java are you using?

satan1999 commented 10 years ago

Thanks for your remind I just found out the server is using jdk 1.6

Cheers Wallace

danielpsf commented 10 years ago

I'm having the same problem with my project.

My environment is:

java version "1.7.0_11" Java(TM) SE Runtime Environment (build 1.7.0_11-b21) Java HotSpot(TM) 64-Bit Server VM (build 23.6-b04, mixed mode)

Grails version: 2.4.3 Plugin version: code-coverage:2.0.3-2

Here is my BuildConfig.groovy:

grails.servlet.version = "2.5" // Change depending on target container compliance (2.5 or 3.0)
grails.project.class.dir = "target/classes"
grails.project.test.class.dir = "target/test-classes"
grails.project.test.reports.dir = "target/test-reports"
grails.project.target.level = 1.6
grails.project.source.level = 1.6
grails.project.dependency.resolver="maven"
//grails.project.war.file = "target/${appName}-${appVersion}.war"

grails.project.fork = [
    test: false,
    run: false,
    war: false,
    console: false
]

grails.project.dependency.resolution = {
    def gebVersion = "0.9.3"
    def seleniumVersion = "2.42.2"

    // inherit Grails' default dependencies
    inherits("global") {
        // specify dependency exclusions here; for example, uncomment this to disable ehcache:
        // excludes 'ehcache'
    }

    log "error" // log level of Ivy resolver, either 'error', 'warn', 'info', 'debug' or 'verbose'
    checksums true // Whether to verify checksums on resolve
    legacyResolve false // whether to do a secondary resolve on plugin installation, not advised but here for backwards compatibility

    repositories {
        inherits false // Whether to inherit repository definitions from plugins

        mavenCentral()

        grailsPlugins()
        grailsHome()
        grailsCentral()

        // For Geb snapshot
        mavenRepo "http://oss.sonatype.org/content/repositories/snapshots"
    }

    dependencies {
        // specify dependencies here under either 'build', 'compile', 'runtime', 'test' or 'provided' scopes eg.
        compile("org.codehaus.groovy.modules.http-builder:http-builder:0.5.2"){ exclude 'groovy' }        
        compile 'org.apache.httpcomponents:httpcore:4.3'
        compile 'org.apache.httpcomponents:httpclient:4.3'

        runtime 'postgresql:postgresql:9.1-901.jdbc4'

        test("org.seleniumhq.selenium:selenium-firefox-driver:$seleniumVersion")
        test "org.gebish:geb-spock:$gebVersion"
        test "org.objenesis:objenesis:1.2"
    }

    plugins {
        build ':tomcat:7.0.52.1'

        compile ':cache:1.1.7'
        compile ':spring-security-core:2.0-RC4'
        compile ":joda-time:1.5"
        compile ":mail:1.0.7"

        runtime ':hibernate4:4.3.5.2'
        runtime ':database-migration:1.4.0'
        runtime ":resources:1.2.8"

        test ":geb:$gebVersion"
        test ":code-coverage:2.0.3-2"
    }
}

When I execute this: grails test-app unit: integration: -coverage -xml --verbose --stacktrace I got this:

     [copy] Copying 1 file to /home/jenkins/workspace/My_Project/target/classes
    [mkdir] Created dir: /home/jenkins/workspace/My_Project/target/test-reports/html
    [mkdir] Created dir: /home/jenkins/workspace/My_Project/target/test-reports/plain
| Instrumenting classes for coverage
   [delete] Deleting: /home/jenkins/workspace/My_Project/cobertura.ser
| Instrumenting classes for coverage.
| Instrumenting classes for coverage..
| Instrumenting classes for coverage...
     [java] Buildfile: /tmp/instrument-build-3944361984109929536.xml
     [java] instrument:
     [java] [cobertura-instrument] Cobertura 2.0.3 - GNU GPL License (NO WARRANTY) - See COPYRIGHT file
     [java] [cobertura-instrument] Oct 31, 2014 4:59:24 AM net.sourceforge.cobertura.coveragedata.CoverageDataFileHandler loadCoverageData
     [java] [cobertura-instrument] SEVERE: Cobertura: Error reading from object stream.
     [java] [cobertura-instrument] java.lang.NullPointerException
     [java] [cobertura-instrument]      at net.sourceforge.cobertura.coveragedata.CoverageDataFileHandler.loadCoverageData(CoverageDataFileHandler.java:85)
     [java] [cobertura-instrument]      at net.sourceforge.cobertura.coveragedata.CoverageDataFileHandler.loadCoverageData(CoverageDataFileHandler.java:61)
     [java] [cobertura-instrument]      at net.sourceforge.cobertura.instrument.Main.parseArguments(Main.java:381)
     [java] [cobertura-instrument]      at net.sourceforge.cobertura.instrument.Main.main(Main.java:421)
     [java] [cobertura-instrument] 
     [java] [cobertura-instrument] 2014-10-31 04:59:24,483 WARN   CoberturaInstrumenter - Unable to instrument file /home/jenkins/workspace/My_Project/target/classes/Permiss
ionFilters$_closure1.class
     [java] [cobertura-instrument] java.lang.NullPointerException
     [java] [cobertura-instrument]      at net.sourceforge.cobertura.instrument.tp.ClassMap.applyOnProjectData(ClassMap.java:364)
     [java] [cobertura-instrument]      at net.sourceforge.cobertura.instrument.CoberturaInstrumenter.instrumentClass(CoberturaInstrumenter.java:187)
     [java] [cobertura-instrument]      at net.sourceforge.cobertura.instrument.CoberturaInstrumenter.instrumentClass(CoberturaInstrumenter.java:121)
     [java] [cobertura-instrument]      at net.sourceforge.cobertura.instrument.CoberturaInstrumenter.addInstrumentationToSingleClass(CoberturaInstrumenter.java:234)
     [java] [cobertura-instrument]      at net.sourceforge.cobertura.instrument.Main.addInstrumentationToSingleClass(Main.java:298)
     [java] [cobertura-instrument]      at net.sourceforge.cobertura.instrument.Main.addInstrumentation(Main.java:307)
     [java] [cobertura-instrument]      at net.sourceforge.cobertura.instrument.Main.parseArguments(Main.java:399)
     [java] [cobertura-instrument]      at net.sourceforge.cobertura.instrument.Main.main(Main.java:421)
     [java] [cobertura-instrument] 2014-10-31 04:59:24,490 WARN   CoberturaInstrumenter - Unable to instrument file /home/jenkins/workspace/My_Project/target/classes/Permiss
ionFilters$_closure1_closure2.class
     [java] [cobertura-instrument] java.lang.NullPointerException
     [java] [cobertura-instrument]      at net.sourceforge.cobertura.instrument.tp.ClassMap.applyOnProjectData(ClassMap.java:364)
     [java] [cobertura-instrument]      at net.sourceforge.cobertura.instrument.CoberturaInstrumenter.instrumentClass(CoberturaInstrumenter.java:187)
     [java] [cobertura-instrument]      at net.sourceforge.cobertura.instrument.CoberturaInstrumenter.instrumentClass(CoberturaInstrumenter.java:121)
     [java] [cobertura-instrument]      at net.sourceforge.cobertura.instrument.CoberturaInstrumenter.addInstrumentationToSingleClass(CoberturaInstrumenter.java:234)
     [java] [cobertura-instrument]      at net.sourceforge.cobertura.instrument.Main.addInstrumentationToSingleClass(Main.java:298)
     [java] [cobertura-instrument]      at net.sourceforge.cobertura.instrument.Main.addInstrumentation(Main.java:307)
     [java] [cobertura-instrument]      at net.sourceforge.cobertura.instrument.Main.parseArguments(Main.java:399)
     [java] [cobertura-instrument]      at net.sourceforge.cobertura.instrument.Main.main(Main.java:421)
     [java] [cobertura-instrument] 2014-10-31 04:59:24,496 WARN   CoberturaInstrumenter - Unable to instrument file /home/jenkins/workspace/My_Project/target/classes/Permiss
ionFilters$_closure1_closure2_closure4.class
     [java] [cobertura-instrument] java.lang.NullPointerException
     [java] [cobertura-instrument]      at net.sourceforge.cobertura.instrument.tp.ClassMap.applyOnProjectData(ClassMap.java:364)
     [java] [cobertura-instrument]      at net.sourceforge.cobertura.instrument.CoberturaInstrumenter.instrumentClass(CoberturaInstrumenter.java:187)
     [java] [cobertura-instrument]      at net.sourceforge.cobertura.instrument.CoberturaInstrumenter.instrumentClass(CoberturaInstrumenter.java:121)
     [java] [cobertura-instrument]      at net.sourceforge.cobertura.instrument.CoberturaInstrumenter.addInstrumentationToSingleClass(CoberturaInstrumenter.java:234)
     [java] [cobertura-instrument]      at net.sourceforge.cobertura.instrument.Main.addInstrumentationToSingleClass(Main.java:298)
     [java] [cobertura-instrument]      at net.sourceforge.cobertura.instrument.Main.addInstrumentation(Main.java:307)
     [java] [cobertura-instrument]      at net.sourceforge.cobertura.instrument.Main.parseArguments(Main.java:399)
     [java] [cobertura-instrument]      at net.sourceforge.cobertura.instrument.Main.main(Main.java:421)
     [java] [cobertura-instrument] 2014-10-31 04:59:24,501 WARN   CoberturaInstrumenter - Unable to instrument file /home/jenkins/workspace/My_Project/target/classes/Permiss
ionFilters$_closure1_closure2_closure4_closure5.class
     [java] [cobertura-instrument] java.lang.NullPointerException
     [java] [cobertura-instrument]      at net.sourceforge.cobertura.instrument.tp.ClassMap.applyOnProjectData(ClassMap.java:364)
     [java] [cobertura-instrument]      at net.sourceforge.cobertura.instrument.CoberturaInstrumenter.instrumentClass(CoberturaInstrumenter.java:187)
     [java] [cobertura-instrument]      at net.sourceforge.cobertura.instrument.CoberturaInstrumenter.instrumentClass(CoberturaInstrumenter.java:121)
     [java] [cobertura-instrument]      at net.sourceforge.cobertura.instrument.CoberturaInstrumenter.addInstrumentationToSingleClass(CoberturaInstrumenter.java:234)
     [java] [cobertura-instrument]      at net.sourceforge.cobertura.instrument.Main.addInstrumentationToSingleClass(Main.java:298)
     [java] [cobertura-instrument]      at net.sourceforge.cobertura.instrument.Main.addInstrumentation(Main.java:307)
     [java] [cobertura-instrument]      at net.sourceforge.cobertura.instrument.Main.parseArguments(Main.java:399)
     [java] [cobertura-instrument]      at net.sourceforge.cobertura.instrument.Main.main(Main.java:421)
     [java] [cobertura-instrument] 2014-10-31 04:59:24,506 WARN   CoberturaInstrumenter - Unable to instrument file /home/jenkins/workspace/My_Project/target/classes/Permiss
ionFilters$_closure1_closure3.class
     [java] [cobertura-instrument] java.lang.NullPointerException
     [java] [cobertura-instrument]      at net.sourceforge.cobertura.instrument.tp.ClassMap.applyOnProjectData(ClassMap.java:364)
     [java] [cobertura-instrument]      at net.sourceforge.cobertura.instrument.CoberturaInstrumenter.instrumentClass(CoberturaInstrumenter.java:187)
     [java] [cobertura-instrument]      at net.sourceforge.cobertura.instrument.CoberturaInstrumenter.instrumentClass(CoberturaInstrumenter.java:121)
     [java] [cobertura-instrument]      at net.sourceforge.cobertura.instrument.CoberturaInstrumenter.addInstrumentationToSingleClass(CoberturaInstrumenter.java:234)
     [java] [cobertura-instrument]      at net.sourceforge.cobertura.instrument.Main.addInstrumentationToSingleClass(Main.java:298)
     [java] [cobertura-instrument]      at net.sourceforge.cobertura.instrument.Main.addInstrumentation(Main.java:307)
     [java] [cobertura-instrument]      at net.sourceforge.cobertura.instrument.Main.parseArguments(Main.java:399)
     [java] [cobertura-instrument]      at net.sourceforge.cobertura.instrument.Main.main(Main.java:421)
     [java] [cobertura-instrument] 2014-10-31 04:59:24,512 WARN   CoberturaInstrumenter - Unable to instrument file /home/jenkins/workspace/My_Project/target/classes/Permiss
ionFilters$_closure1_closure3_closure6.class
     [java] [cobertura-instrument] java.lang.NullPointerException
     [java] [cobertura-instrument]      at net.sourceforge.cobertura.instrument.tp.ClassMap.applyOnProjectData(ClassMap.java:364)
     [java] [cobertura-instrument]      at net.sourceforge.cobertura.instrument.CoberturaInstrumenter.instrumentClass(CoberturaInstrumenter.java:187)
     [java] [cobertura-instrument]      at net.sourceforge.cobertura.instrument.CoberturaInstrumenter.instrumentClass(CoberturaInstrumenter.java:121)
     [java] [cobertura-instrument]      at net.sourceforge.cobertura.instrument.CoberturaInstrumenter.addInstrumentationToSingleClass(CoberturaInstrumenter.java:234)
     [java] [cobertura-instrument]      at net.sourceforge.cobertura.instrument.Main.addInstrumentationToSingleClass(Main.java:298)
     [java] [cobertura-instrument]      at net.sourceforge.cobertura.instrument.Main.addInstrumentation(Main.java:307)
     [java] [cobertura-instrument]      at net.sourceforge.cobertura.instrument.Main.parseArguments(Main.java:399)
     [java] [cobertura-instrument]      at net.sourceforge.cobertura.instrument.Main.main(Main.java:421)
     [java] [cobertura-instrument] 2014-10-31 04:59:24,517 WARN   CoberturaInstrumenter - Unable to instrument file /home/jenkins/workspace/My_Project/target/classes/Permiss
ionFilters$_closure1_closure3_closure6_closure7.class
     [java] [cobertura-instrument] java.lang.NullPointerException
     [java] [cobertura-instrument]      at net.sourceforge.cobertura.instrument.tp.ClassMap.applyOnProjectData(ClassMap.java:364)
     [java] [cobertura-instrument]      at net.sourceforge.cobertura.instrument.CoberturaInstrumenter.instrumentClass(CoberturaInstrumenter.java:187)
     [java] [cobertura-instrument]      at net.sourceforge.cobertura.instrument.CoberturaInstrumenter.instrumentClass(CoberturaInstrumenter.java:121)
     [java] [cobertura-instrument]      at net.sourceforge.cobertura.instrument.CoberturaInstrumenter.addInstrumentationToSingleClass(CoberturaInstrumenter.java:234)
     [java] [cobertura-instrument]      at net.sourceforge.cobertura.instrument.Main.addInstrumentationToSingleClass(Main.java:298)
     [java] [cobertura-instrument]      at net.sourceforge.cobertura.instrument.Main.addInstrumentation(Main.java:307)
     [java] [cobertura-instrument]      at net.sourceforge.cobertura.instrument.Main.parseArguments(Main.java:399)
     [java] [cobertura-instrument]      at net.sourceforge.cobertura.instrument.Main.main(Main.java:421)
     [java] [cobertura-instrument] 2014-10-31 04:59:24,524 WARN   CoberturaInstrumenter - Unable to instrument file /home/jenkins/workspace/My_Project/target/classes/Permiss
ionFilters.class

@beckje01 have you ever seen this before?