Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-9221

Cobertura coverage files trashed

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Major Major
    • cobertura-plugin
    • None
    • Red Hat EL 6, VMWare VM, Jenkins 1.387, Maven 2.2.1, Cobertura Plugin 1.2

      There is no Cobertura report in Jenkins and the build shows as failed.

      The content of the file named coverage11492.xml is messed up after the build. (I picked that file because its name appeared in error stack trace in the console output of the site build.) Notice that it is JavaDoc HTML for one of my classes in the Cobertura coverage results xml file. (All the other coverage999.xml files I looked at had similar content.)

      <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
      <!-NewPage->
      <HTML>
      <HEAD>
      <!-- Generated by javadoc (build 1.6.0_23) on Mon Mar 28 00:27:40 CDT 2011 -->
      <META http-equiv="Content-Type" content="text/html; charset=UTF-8">
      <TITLE>
      Uses of Interface com.mycompany.service.customerservice.email.GMTGroupManager (mycompany.com 0.0.1-SNAPSHOT API)
      </TITLE>

      <META NAME="date" CONTENT="2011-03-28">

      <LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../../../../../stylesheet.css" TITLE="Style">

      ... and more

      The XML for the plugin in the maven pom reporting section is just plain. No config section. The versions are in the pluginManagement section.

      <plugin>
      <groupId>org.codehaus.mojo</groupId>
      <artifactId>cobertura-maven-plugin</artifactId>
      </plugin>

      In the console output I see this when Cobertura is instrumenting the class files. This means Cobertura is running.

      [INFO] [cobertura:instrument

      {execution: default-instrument}

      ]

      [INFO] Cobertura 1.9.4.1 - GNU GPL License (NO WARRANTY) - See COPYRIGHT file
      Instrumenting 2710 files to /opt/hudson/home/jobs/mycompany-site/workspace/target/generated-classes/cobertura
      [cobertura] WARN [main] net.sourceforge.cobertura.instrument.ClassInstrumenter - No line number information found for class com.mycompany.service.search.DetailUtil$1. Perhaps you need to compile with debug=true?

      [cobertura] WARN [main] net.sourceforge.cobertura.instrument.ClassInstrumenter - No line number information found for class com.mycompany.domain.savers.SaverMarket$1. Perhaps you need to compile with debug=true?
      [cobertura] WARN [main] net.sourceforge.cobertura.instrument.ClassInstrumenter - No line number information found for class com.mycompany.domain.check.SpecialAttributes$1. Perhaps you need to compile with debug=true?

      [cobertura] WARN [main] net.sourceforge.cobertura.instrument.ClassInstrumenter - No line number information found for class com.mycompany.ui.saver.SaverUKSaleDetailsAccessAction$1. Perhaps you need to compile with debug=true?

      [cobertura] WARN [main] net.sourceforge.cobertura.instrument.ClassInstrumenter - No line number information found for class com.mycompany.ui.saver.SaverUSSaleDetailsAccessAction$1. Perhaps you need to compile with debug=true?

      Cobertura: Saved information on 2710 classes.
      Instrument time: 12915ms

      [INFO] Instrumentation was successful.

      And after the tests run the first time there are these lines (but lots more "flushing" lines and lots more "save" and "load" lines):

      Flushing results done
      Flushing results done
      Flushing results done
      Cobertura: Loaded information on 2710 classes.
      Cobertura: Saved information on 2710 classes.
      Cobertura: Loaded information on 2710 classes.

      Cobertura: Saved information on 2710 classes.

      Then the tests run again and the "flushing", "save" and "load" part shows up in the console log a second time.

      The JavaDoc and all the other reports run. The Jenkins build is reported to succeed. The m2 "after" build kicks in and does the site:deploy and then we find this in the console output. Note the error kicks in when the Jenkins code tries to collect the Cobertura report for itself. There are many, many of the errors shown. Below is only one of them and I chopped off the full stack trace which did appear.)

      [INFO] ------------------------------------------------------------------------
      [INFO] BUILD SUCCESSFUL
      [INFO] ------------------------------------------------------------------------

      [INFO] Total time: 33 seconds
      [INFO] Finished at: Mon Mar 28 00:48:42 CDT 2011
      [INFO] Final Memory: 17M/188M
      [INFO] ------------------------------------------------------------------------
      Publishing Cobertura coverage report...

      Publishing Cobertura coverage results...
      FATAL: Unable to parse /opt/hudson/home/jobs/mycompany-site/builds/2011-03-28_00-10-48/coverage25732.xml
      hudson.util.IOException2: Cannot parse coverage results

      at hudson.plugins.cobertura.CoberturaCoverageParser.parse(CoberturaCoverageParser.java:89)

      Since the build and deploy seemed to work, I looked at the deployed site and found the Cobertura report seems to be there. It has this line at the bottom and that matches the date and time the site build was run.

      Report generated by Cobertura 1.9.4.1 on 3/28/11 12:35 AM.

      [Note: I turned Cobertura reporting off in Jenkins and no errors appeared. Maven's Cobertura report still showed just fine. After a few days, I turned Cobertura reporting back on in Jenkins. There were no Jenkins errors shown but, instead, the build hung completely. It stuck for about 12 hours and I had to "kill -9" the process. By "hung" I mean that Jenkins worked fine. You could click around and look at stuff in Jenkins. But if you looked at that build's console output, it showed the little flower that indicates more output is expected but the build was not making any progress. At the console, I noticed that the "hung" build task was not using any CPU time to speak of. It didn't even show up in "top" but "ps" saw it. I forgot to look at memory usage before killing it.]

      [Another note: After the "hung" build, I changed the pom to include the config for Cobertura telling it to do both XML and HTML reports. This build went through and did not fail but because I had the box clicked to only do Cobertura for stable builds, and because there are a few tests failing today, no report was generated. The console output and the task both completed and did not hang though.]

            Unassigned Unassigned
            leemeador leemeador
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: