beckje01 / grails-code-coverage

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

Coverage results showing empty in latest version #28

Closed halfbaked closed 10 years ago

halfbaked commented 10 years ago

Using the latest version of the plugin, the coverage.xml file has and an empty packages node, where in the old version it was full of data.

<coverage line-rate="1.0" branch-rate="1.0" lines-covered="0" lines-valid="0" branches-covered="0" branches-valid="0" complexity="0.0" version="2.0.3" timestamp="1403687203914">
  <sources>
    <source>
      /Users/myuser/Dev/proj/myproj/grails-app/domain
    </source>    
   </sources>
  <packages/>
</coverage>

I see the following in the logs:

net.sourceforge.cobertura.coveragedata.ProjectData loadCoverageDataFromDatafile
INFO: Cobertura: Coverage data file /Users/34m0/Dev/proj/st-s5-core/cobertura.ser either does not exist or is not readable.  Creating a new data file.
Jun 25, 2014 11:06:42 AM net.sourceforge.cobertura.coveragedata.CoverageDataFileHandler saveCoverageData
INFO: Cobertura: Saved information on 0 classes.
Done with post processing reports in 57ms
beckje01 commented 10 years ago

What version of grails are you using?

halfbaked commented 10 years ago

Hey Jeff, it is Grails version 2.3.7

beckje01 commented 10 years ago

And forked mode is off? I have it working with 2.3.7 If you can either let me see the project or create a simple test project that has the same error that would be very helpful.

halfbaked commented 10 years ago

I tried both forked and unforked. Makes sense that you need an example. I'll see what I can do.

On 25 June 2014 15:45, Jeff Beck notifications@github.com wrote:

And forked mode is off? I have it working with 2.3.7 If you can either let me see the project or create a simple test project that has the same error that would be very helpful.

— Reply to this email directly or view it on GitHub https://github.com/beckje01/grails-code-coverage/issues/28#issuecomment-47102320 .

beckje01 commented 10 years ago

I will also try to reproduce with some projects at work that need updated anyway.

Jeff

beckje01 commented 10 years ago

I tried with 2.3.4 and 2.3.7 and I'm not reproducing the issue yet. You should see a message like:

Instrumenting classes for coverage... INFO: Found ASM 3: /Users/jeff.beck/.m2/repository/asm/asm/3.3.1/asm-3.3.1.jar.

Do you see anything like that after the instrumenting classes for coverage?

halfbaked commented 10 years ago

Yes, I see the following:

I wonder if there is some plugin or other doing something funky that disturbs the coverage plugin.

For example, I use the i18nEnum plugin, uses AST transformation

https://github.com/sbglasius/I18nEnumsGrailsPlugin/blob/master/src/groovy/grails/plugin/i18nEnums/annotations/I18nEnum.groovy#L13

On 26 June 2014 07:46, Jeff Beck notifications@github.com wrote:

I tried with 2.3.4 and 2.3.7 and I'm not reproducing the issue yet. You should see a message like:

Instrumenting classes for coverage... INFO: Found ASM 3: /Users/jeff.beck/.m2/repository/asm/asm/3.3.1/asm-3.3.1.jar.

Do you see anything like that after the instrumenting classes for coverage?

— Reply to this email directly or view it on GitHub https://github.com/beckje01/grails-code-coverage/issues/28#issuecomment-47189830 .

beckje01 commented 10 years ago

I haven't used that plugin before do you mind setting up a skeleton project with that plugin being used how you would expect?

halfbaked commented 10 years ago

I falsely accused that plugin ;) I went through the various plugins of my real app on a sample app, and by process of elimination found the culprit to be: markdown ( https://bitbucket.org/tednaleid/grails-markdown).

On 26 June 2014 15:26, Jeff Beck notifications@github.com wrote:

I haven't used that plugin before do you mind setting up a skeleton project with that plugin being used how you would expect?

— Reply to this email directly or view it on GitHub https://github.com/beckje01/grails-code-coverage/issues/28#issuecomment-47224815 .

halfbaked commented 10 years ago

Jeff, an update for you: either plugin on its own does not appear to cause the issue, but the combination of both plugins I mention does. I've put a sample project together which I hope also doesn't work for you: https://github.com/halfbaked/sample-grails-cobertura

Run:

 grails clean && grails test-app unit: -coverage

And you should see:

Cobertura: Saved information on 0 classes.
beckje01 commented 10 years ago

Thanks for all the help, I think I have a fix now I did a pull request check out https://github.com/halfbaked/sample-grails-cobertura/pull/1

marcoscarceles commented 10 years ago

Do you know when did fix will be released?

beckje01 commented 10 years ago

@marcos-carceles I'll review your PR today and look at releasing a version today/tomorrow