Could not resolve xx file paths in lcov.info

Template for a good new topic, formatted with Markdown:

  • ALM used Bitbucket Cloud
  • CI system used Circle CI
  • Scanner command used when applicable (private details masked)
  - run:
      name: Sonar Scan
      command: |
        set -euo pipefail

        dir=/tmp/sonar-scanner
        os=linux
        version=<<parameters.sonar_scanner_version>>
        scanner_dir=${dir}/sonar-scanner-${version}-${os}

        if [[ ! -x "${scanner_dir}/bin/sonar-scanner" ]]; then
          curl --tlsv1 --output /tmp/sonar-scanner-cli.zip \
            "https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-${version}-${os}.zip"
          unzip -qq -o /tmp/sonar-scanner-cli.zip -d "$dir"
        fi

        export PATH=${PATH}:${scanner_dir}/bin

        <<parameters.command>>
  • Languages of the repository : React for FE and BE typescript
  • Only if the SonarCloud project is public, the URL
    • And if you need help with pull request decoration, then the URL to the PR too
  • Error observed : Could not resolve xx file paths in lcov.info
  • Steps to reproduce
  • Potential workaround

Error message :
WARN: Could not resolve 3 file paths in [/home/circleci/project/apps/xxx/…/…/coverage/apps/xxx/lcov.info]

Hi,

Welcome to the community!

This message is telling you that the paths in your coverage report don’t match the paths analysis is seeing. Is the coverage report generated in the same job/directory where analysis takes place?

 
Ann

Hi,

I have provided the path to the Lcov report in sonar-project.properties as follows, where lcov.info is being generated:

sonar.typescript.lcov.reportPaths=…/…/coverage/apps/{app-name}/lcov.info

It appears that is able to locate lcov.info, but it is encountering issues resolving the file paths within lcov.info:

INFO: Analysing [/home/circleci/project/apps/{app-name}/…/…/coverage/apps/ics-configuration-processor/lcov.info]
WARN: Could not resolve 3 file paths in [/home/circleci/project/apps/{app-name}/…/…/coverage/apps/{app-name}/lcov.info]
WARN: First unresolved path: apps/{app-name}/src/xxx/xxx.ts
(Run in DEBUG mode to get the full list of unresolved paths.)

It seems that it is having trouble resolving the paths within the lcov.info file. Consider running Sonar in DEBUG mode to obtain a comprehensive list of unresolved paths.