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

cobertura parsing misses multiple files

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Incomplete
    • Icon: Minor Minor
    • coverage-plugin
    • None

      When my my Pipeline job calls the following:

              post {
                      always {
                              junit "scripts/*.xml"
                              discoverReferenceBuild referenceJob: 'release-scripts/master'
                              recordCoverage(sourceDirectories: [[path: 'scripts']], tools: [[parser: 'COBERTURA', pattern: 'scripts/cover_db/cobertura.xml']])
      {{                } }}
      {{        } }}

      with the attached file in scripts/cover_db/cobertura.xml, the coverage plugin produces the following output in the jenkins build log:
      [Cobertura] Recording coverage results
      [Cobertura] Searching for all files in '/var/lib/jenkins/workspace/release-scripts_master' that match the pattern 'scripts/cover_db/cobertura.xml'
      [Cobertura] Traversing of symbolic links: disabled
      [Cobertura] -> found 1 file
      [Cobertura] Successfully parsed file '/var/lib/jenkins/workspace/release-scripts_master/scripts/cover_db/cobertura.xml'
      [Cobertura] MODULE: 100.00% (1/1)
      [Cobertura] PACKAGE: 100.00% (2/2)
      [Cobertura] FILE: 100.00% (2/2)
      [Cobertura] CLASS: 100.00% (2/2)
      [Cobertura] LINE: 73.83% (79/107)
      [Cobertura] LOC: 107
      [Cobertura] Successfully processed file 'scripts/cover_db/cobertura.xml'
      [Coverage] [-ERROR-] Errors while recording code coverage:
      [Coverage] [-ERROR-] Errors during source path resolving:
      [Coverage] [-ERROR-] Errors while resolving source files on agent:
      [Coverage] [-ERROR-] Removing non-workspace source directory '/' - it has not been approved in Jenkins' global configuration.
      [Coverage] [-ERROR-] - Skipping resolving of file: /usr/bin/prove (not part of workspace or permitted source code folders)
      [Coverage] Recording coverage results
      [Coverage] Searching for all files in '/var/lib/jenkins/workspace/release-scripts_master' that match the pattern 'scripts/cover_db/cobertura.xml'
      [Coverage] Traversing of symbolic links: disabled
      [Coverage] -> found 1 file
      [Coverage] Successfully parsed file '/var/lib/jenkins/workspace/release-scripts_master/scripts/cover_db/cobertura.xml'
      [Coverage] MODULE: 100.00% (1/1)
      [Coverage] PACKAGE: 100.00% (2/2)
      [Coverage] FILE: 100.00% (2/2)
      [Coverage] CLASS: 100.00% (2/2)
      [Coverage] LINE: 73.83% (79/107)
      [Coverage] LOC: 107
      [Coverage] Successfully processed file 'scripts/cover_db/cobertura.xml'
      [Coverage] Resolving source code files...
      [Coverage] Searching for source code files in:
      [Coverage] -> /var/lib/jenkins/workspace/release-scripts_master/src/main/java
      [Coverage] -> /var/lib/jenkins/workspace/release-scripts_master/scripts
      [Coverage] -> finished resolving of absolute paths (found: 1, not found: 1)
      [Coverage] Making paths of 1 source code files relative to workspace root...
      [Coverage] Obtaining action of reference build
      [Coverage] Obtaining reference build from reference recorder
      [Coverage] -> Found 'release-scripts » master #44'
      [Coverage] -> Using reference build 'release-scripts/master #44'
      [Coverage] -> Found reference result in build '#44'
      [Coverage] Calculating the code delta...
      [Coverage] -> No delta calculator installed yet. You need to install the 'git-forensics' plugin to enable it for Git.
      [Coverage] Calculating coverage deltas...
      [Coverage] No quality gates have been set - skipping
      [Coverage] Executing source code painting...
      [Coverage] Painting 2 source files on agent
      [Coverage] -> finished painting successfully
      [Coverage] -> zipping sources from folder '/var/lib/jenkins/workspace/release-scripts_master/coverage' as '/var/lib/jenkins/workspace/release-scripts_master/coverage-sources.zip'
      [Coverage] Copying painted sources from agent to build folder
      [Coverage] -> extracting...
      [Coverage] -> done
      [Coverage] Deleting source code files of build #44
      [Coverage] Finished coverage processing - adding the action to the build...
      After this, it only reports coverage for "/usr/bin/prove" and "Zetes/DockerHandlers.pm", ignoring all other files.

            drulli Ulli Hafner
            wouter Wouter
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: