-
Bug
-
Resolution: Fixed
-
Minor
-
None
-
Powered by SuggestiMate
When report pattern is not well configured, cobertura plugin will archive invalid files, and later fails to parse them to generate coverage report. It should do some content validation, for example check for <!DOCTYPE coverage
[JENKINS-15035] cobertura plugin don't validate report files and later fail to parse them
Code changed in jenkins
User: Seiji Sogabe
Path:
src/main/java/hudson/plugins/cobertura/CoberturaPublisher.java
http://jenkins-ci.org/commit/cobertura-plugin/875d27d82d2ffbfd802b03784a3c67c17eb2cf75
Log:
Merge pull request #9 from ndeloof/JENKINS-15035
JENKINS-15035 quick check report files identified by pattern to be xml...
Compare: https://github.com/jenkinsci/cobertura-plugin/compare/dd80f6c2c310...875d27d82d2f
I now get a stacktrace on remote slave running a grails build that produces a coverage.xml file. It worked till I upgraded, then when I rolled back, it works again.
Here is the stacktrace:
Cobertura: Loaded information on 170 classes. 08:10:16 Cobertura: Saved information on 170 classes. 08:10:16 Publishing Cobertura coverage report... 08:10:16 FATAL: Unable to find coverage results 08:10:16 hudson.util.IOException2: remote file operation failed: /home/jenkins/workspace/grailsApplication at hudson.remoting.Channel@2fcf1d75:remoteslave 08:10:16 at hudson.FilePath.act(FilePath.java:847) 08:10:16 at hudson.FilePath.act(FilePath.java:824) 08:10:16 at hudson.plugins.cobertura.CoberturaPublisher.perform(CoberturaPublisher.java:335) 08:10:16 at hudson.tasks.BuildStepMonitor$3.perform(BuildStepMonitor.java:36) 08:10:16 at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:807) 08:10:16 at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:782) 08:10:16 at hudson.model.Build$BuildExecution.post2(Build.java:183) 08:10:16 at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:729) 08:10:16 at hudson.model.Run.execute(Run.java:1541) 08:10:16 at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:46) 08:10:16 at hudson.model.ResourceController.execute(ResourceController.java:88) 08:10:16 at hudson.model.Executor.run(Executor.java:236) 08:10:16 Caused by: java.io.IOException: Unable to serialize hudson.FilePath$FileCallableWrapper@64916e12 08:10:16 at hudson.remoting.UserRequest.serialize(UserRequest.java:166) 08:10:16 at hudson.remoting.UserRequest.<init>(UserRequest.java:62) 08:10:16 at hudson.remoting.Channel.call(Channel.java:663) 08:10:16 at hudson.FilePath.act(FilePath.java:840) 08:10:16 ... 11 more 08:10:16 Caused by: java.io.NotSerializableException: hudson.plugins.cobertura.CoberturaPublisher 08:10:16 at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1156) 08:10:16 at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1509) 08:10:16 at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1474) 08:10:16 at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1392) 08:10:16 at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1150) 08:10:16 at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1509) 08:10:16 at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1474) 08:10:16 at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1392) 08:10:16 at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1150) 08:10:16 at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:326) 08:10:16 at hudson.remoting.UserRequest._serialize(UserRequest.java:155) 08:10:16 at hudson.remoting.UserRequest.serialize(UserRequest.java:164) 08:10:16 ... 14 more 08:10:16 No coverage results were found using the pattern 'target/test-reports/cobertura/coverage.xml' relative to '/home/jenkins/workspace/grailsApplication'. Did you enter a pattern relative to the correct directory? Did you generate the XML report(s) for Cobertura?
Same here, upgrade from 1.6 to 1.7 broke all my builds publishing Cobertura reports, downgrade fixed it again. There is something wrong with your check, please fix it! My reports start like this:
<?xml version="1.0" ?> <!DOCTYPE coverage SYSTEM 'http://cobertura.sourceforge.net/xml/coverage-03.dtd'> <coverage branch-rate="0" line-rate="0.6683" timestamp="1350243774936" version="3.5"> <!-- Generated by coverage.py: http://nedbatchelder.com/code/coverage --> <packages>
Same here. Plugin version 1.7 now fails to parse my cobertura reports. The files are named cobertura.xml and they all start with '<?xml'. Downgrading to 1.6 fixes the problem.
reported serialization issue has been fixed by JENKINS-15518 (released in 1.7.1)
I wonder other reported issue are the same as no stacktrace was attached to comment
Hi Nicolas,
Thanks for getting back to us! My stack strace looks as follows, so, indeed, I think this must have been the serialization problem.
hudson.util.IOException2: remote file operation failed: /mnt/ram/workspace/sumatra/sources at hudson.remoting.Channel@1970b890:fc-16-i386-2 at hudson.FilePath.act(FilePath.java:835) at hudson.FilePath.act(FilePath.java:821) at hudson.plugins.cobertura.CoberturaPublisher.perform(CoberturaPublisher.java:335) at hudson.tasks.BuildStepMonitor$3.perform(BuildStepMonitor.java:36) at hudson.model.AbstractBuild$AbstractRunner.perform(AbstractBuild.java:710) at hudson.model.AbstractBuild$AbstractRunner.performAllBuildSteps(AbstractBuild.java:685) at hudson.model.Build$RunnerImpl.post2(Build.java:162) at hudson.model.AbstractBuild$AbstractRunner.post(AbstractBuild.java:632) at hudson.model.Run.run(Run.java:1463) at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:46) at hudson.model.ResourceController.execute(ResourceController.java:88) at hudson.model.Executor.run(Executor.java:239) Caused by: java.io.IOException: Unable to serialize hudson.FilePath$FileCallableWrapper@7e18e91b at hudson.remoting.UserRequest.serialize(UserRequest.java:166) at hudson.remoting.UserRequest.<init>(UserRequest.java:62) at hudson.remoting.Channel.call(Channel.java:662) at hudson.FilePath.act(FilePath.java:828) ... 11 more Caused by: java.io.NotSerializableException: hudson.plugins.cobertura.CoberturaPublisher at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1164) at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1518) at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1483) at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1400) at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1158) at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1518) at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1483) at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1400) at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1158) at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:330) at hudson.remoting.UserRequest._serialize(UserRequest.java:155) at hudson.remoting.UserRequest.serialize(UserRequest.java:164) ... 14 more
Z.
Fixed in the latest plugin versions, reported issues in comments had to do with serialization (JENKINS-15518).
Code changed in jenkins
User: Nicolas De Loof
Path:
src/main/java/hudson/plugins/cobertura/CoberturaPublisher.java
http://jenkins-ci.org/commit/cobertura-plugin/2ad1ea3fd5dc09eb04b6fe73d531bc27008590f8
Log:
JENKINS-15035quick check report files identified by pattern to be xml ones