Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Coverage results showing empty in latest version #28

Closed
halfbaked opened this issue Jun 25, 2014 · 13 comments
Closed

Coverage results showing empty in latest version #28

halfbaked opened this issue Jun 25, 2014 · 13 comments
Labels
Milestone

Comments

@halfbaked
Copy link

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
Copy link
Owner

What version of grails are you using?

@beckje01 beckje01 added the bug label Jun 25, 2014
@halfbaked
Copy link
Author

Hey Jeff, it is Grails version 2.3.7

@beckje01
Copy link
Owner

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
Copy link
Author

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
#28 (comment)
.

@beckje01
Copy link
Owner

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

Jeff

@beckje01
Copy link
Owner

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
Copy link
Author

Yes, I see the following:

  • | *Instrumenting classes for coverage...

INFO: Found ASM 3:
/Users/34m0/.m2/repository/asm/asm/3.3.1/asm-3.3.1.jar.

Possibly because grails-core (grails-plugin-databinding) uses it.

Removing from instrumentation classpath!

[java] Java Result: 1

  • | *Completed 25 unit tests, 0 failed in 1m 10s
  • | *Tests PASSED - view reports in
    /Users/34m0/Dev/proj/myProj/target/test-reports

Jun 26, 2014 8:49:21 AM
net.sourceforge.cobertura.coveragedata.ProjectData
loadCoverageDataFromDatafile

INFO: Cobertura: Coverage data file
/Users/34m0/Dev/proj/myProj/cobertura.ser either does not exist or is not
readable. Creating a new data file.

Jun 26, 2014 8:49:21 AM
net.sourceforge.cobertura.coveragedata.CoverageDataFileHandler
saveCoverageData

INFO: Cobertura: Saved information on 0 classes.

Done with post processing reports in 8ms

  • | *Cobertura Code Coverage Complete (view reports in:
    /Users/34m0/Dev/proj/myProj/target/test-reports/cobertura)

Jun 26, 2014 8:49:25 AM
net.sourceforge.cobertura.coveragedata.CoverageDataFileHandler
loadCoverageData

INFO: Cobertura: Loaded information on 0 classes.

Jun 26, 2014 8:49:25 AM
net.sourceforge.cobertura.coveragedata.CoverageDataFileHandler
saveCoverageData

INFO: Cobertura: Saved information on 0 classes.

Done with post processing reports in 10ms

  • | *Cobertura Code Coverage Complete (view reports in:
    /Users/34m0/Dev/proj/st-s5-core/target/test-reports/cobertura)

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
#28 (comment)
.

@beckje01
Copy link
Owner

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
Copy link
Author

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
#28 (comment)
.

@halfbaked
Copy link
Author

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
Copy link
Owner

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

@beckje01 beckje01 added this to the 2.0.3-2 milestone Jul 1, 2014
@marcoscarceles
Copy link
Contributor

Do you know when did fix will be released?

@beckje01
Copy link
Owner

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants