code-coverage-api-plugin: Cannot found source file for... - cobertura

Hello

I don’t have a coverage per file.

Log from build:

Source File Navigation is enabled - Current level: STORE_LAST_BUILD
34 source files need to be copied
Cannot found source file for jenkinsprojects\secret1\secret2\secret3\secret4\secret5\153\src\file.cpp

I’m using a pipeline with parallel builds on slaves with a custom workspace

Jenkinsfile:

steps {
ws("${env.JENKINS_PROJECTS}/${env.JOB_NAME}/${env.BRANCH_NAME}/${env.STAGE_NAME}/${env.BUILD_NUMBER}".replace('%2F', '_').replace(' ', '_')){
run unit tests + coverage
publishCoverage adapters: [coberturaAdapter('testcoverage32.xml')], sourceFileResolver: sourceFiles('STORE_LAST_BUILD')

Piece of xml coverage:

<coverage line-rate="0.91334598355471219" branch-rate="0" complexity="0" branches-covered="0" branches-valid="0" timestamp="0" lines-covered="1444" lines-valid="1581" version="0">
  <sources>
    <source>c:</source>
  </sources>
  <packages>
    <package name="C:\JenkinsProjects\Secret1\Secret2\Secret3\Secret4\Secret5\153\tests\x86\Debug\SecretTests.exe" line-rate="0.91334598355471219" branch-rate="0" complexity="0">
      <classes>
        <class name="file.cpp" filename="jenkinsprojects\secret1\secret2\secret3\secret4\secret5\153\src\file.cpp.h" line-rate="1" branch-rate="0" complexity="0">
          <methods/>

I tried:

  • add “c:” to filename
  • convert all "" to “/” and vice versa
  • remove "jenkinsprojects\secret1\secret2\secret3\secret4\secret5\153" from filename …

The ‘old’ cobertura-plugin works without any problems on the same configuration.

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Reactions: 1
  • Comments: 30 (14 by maintainers)

Most upvoted comments

@cizezsy Ping: when ‘this week’ will be? (more or less - without pressure 😃 )