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

Cobertura writes to source files (erasing contents in most cases)

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Critical Critical
    • cobertura-plugin
    • None
    • CentOS6.2
      Jenkins 1.476
      Cobertura 1.5

      I'm running Cobertura on a C++ project using a coverage.xml file generated by gcovr. After the plugin has run all the source files have been erased (the files are still present in the source tree but they have no contents).

      To check that it was Cobertura plugin that was causing this I write-protected one of the files (atlas_wrapper.cc) before running the Jenkins build. The following is the error from the Jenkins log file...

      Publishing Cobertura coverage report...
      Publishing Cobertura coverage results...
      ERROR: ERROR: Failure to paint ./var/lib/jenkins/jobs/atlas/workspace/atlas/src/Wrapper/atlas_wrapper.cc to /var/lib/jenkins/jobs/atlas/cobertura
      java.io.FileNotFoundException: /var/lib/jenkins/jobs/atlas/workspace/atlas/src/Wrapper/atlas_wrapper.cc (Permission denied)
      at java.io.FileOutputStream.open(Native Method)
      at java.io.FileOutputStream.<init>(FileOutputStream.java:209)
      at java.io.FileOutputStream.<init>(FileOutputStream.java:160)
      at hudson.FilePath.write(FilePath.java:1474)
      at hudson.plugins.cobertura.renderers.SourceCodePainter.paintSourceCode(SourceCodePainter.java:62)
      at hudson.plugins.cobertura.renderers.SourceCodePainter.invoke(SourceCodePainter.java:148)
      at hudson.plugins.cobertura.renderers.SourceCodePainter.invoke(SourceCodePainter.java:34)
      at hudson.FilePath.act(FilePath.java:842)
      at hudson.FilePath.act(FilePath.java:824)
      at hudson.plugins.cobertura.CoberturaPublisher.perform(CoberturaPublisher.java:310)
      at hudson.tasks.BuildStepMonitor$3.perform(BuildStepMonitor.java:36)
      at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:717)
      at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:692)
      at hudson.model.Build$BuildExecution.post2(Build.java:183)
      at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:639)
      at hudson.model.Run.execute(Run.java:1513)
      at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:46)
      at hudson.model.ResourceController.execute(ResourceController.java:88)
      at hudson.model.Executor.run(Executor.java:236)
      Publishing Doxygen HTML results.
      The determined Doxygen directory is '/var/lib/jenkins/jobs/atlas/workspace/bld/doc/html'.
      End publishing Doxygen HTML results.
      Recording test results

      Here "/var/lib/jenkins/jobs/atlas/workspace/atlas" is the source tree from the subversion checkout. The coverage.xml file is a soft-link from

      /var/lib/jenkins/jobs/atlas/workspace/atlas/coverage.xml -> /var/lib/jenkins/jobs/atlas/workspace/bld/results/coverage.xml

      The build tree workspace/bld is separate from the source tree (if that matters).

            Unassigned Unassigned
            t0nyh Tony Hart
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated: