lghiur
(Laurentiu Ghiur)
November 8, 2021, 2:40pm
1
Hello,
A while ago we configured sonar cloud to show coverage report by uploading our lcov file. We haven’t done any change on our GH actions or so, and all of a sudden we have 0% coverage in sonarcloud.
The message we get is INFO: No LCOV files were found using coverage/lcov.info
WARN: No coverage information will be saved because all LCOV files cannot be found.
PS: we have listed the files and folders in the GH actions and coverage files are there.
And this is our workflow.
name: Test React
on:
- pull_request
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 1
- uses: actions/setup-node@v2
with:
node-version: '15.x'
- uses: actions/cache@v2
with:
path: |
node_modules
~/.npm
key: ${{ runner.os }}-${{ hashFiles('**/package-lock.json') }}
- name: install
run: |
npm config set //registry.npmjs.org/:_authToken "${{ secrets.NPM_TOKEN }}"
npm install --legacy-peer-deps
npm run test
ls
ls coverage/
- name: SonarCloud Scan
uses: sonarsource/sonarcloud-github-action@master
with:
projectBaseDir: app
args: >
-Dsonar.organization={org_key}
-Dsonar.projectKey={our_project_key}
-Dsonar.sources=.
-Dsonar.coverage.exclusions=**/tests/**
-Dsonar.test.inclusions=**/tests/**
-Dsonar.tests=.
-Dsonar.javascript.lcov.reportPaths=coverage/lcov.info
-Dsonar.eslint.eslintconfigpath=.modern-eslintrc
env:
CI: true
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
saberduck
(Tibor Blenessy)
November 9, 2021, 4:19pm
2
hi @lghiur ,
we deployed a change recently, however it should still work as before.
Can you please include full debug logs from the scan?
Also, where does the property sonar.eslint.eslintconfigpath
come from? I don’t think this is something we support with SonarCloud.
saberduck
(Tibor Blenessy)
November 9, 2021, 4:22pm
3
Also, can you investigate precisely when this stopped working? The change I am mentioning was deployed on the 4th of Nov, would be interesting to know if this correlates with your observation.
lghiur
(Laurentiu Ghiur)
November 9, 2021, 5:21pm
4
@saberduck thanks for the reply. Last successful measurement happened on 3rd of Nov, then on the next PR which happened on 8th of Nov this stopped working.
Yeah, that eslint config is a mistake but it wasn’t a problem for Sonarcloud so far
lghiur
(Laurentiu Ghiur)
November 9, 2021, 5:31pm
5
Here is a full log of what we get
Run sonarsource/sonarcloud-github-action@master
with:
projectBaseDir: app
args: -Dsonar.organization={org} -Dsonar.projectKey={key} -Dsonar.sources=. -Dsonar.coverage.exclusions=**/tests/** -Dsonar.test.inclusions=**/tests/** -Dsonar.tests=. -Dsonar.javascript.lcov.reportPaths=coverage/lcov.info -Dsonar.eslint.eslintconfigpath=.modern-eslintrc
env:
CI: true
GITHUB_TOKEN: ***
SONAR_TOKEN: ***
INFO: Scanner configuration file: /opt/sonar-scanner/conf/sonar-scanner.properties
INFO: Project root configuration file: NONE
INFO: SonarScanner 4.6.2.2472
INFO: Java 11.0.11 Alpine (64-bit)
INFO: Linux 5.11.0-1020-azure amd64
INFO: User cache: /opt/sonar-scanner/.sonar/cache
INFO: Scanner configuration file: /opt/sonar-scanner/conf/sonar-scanner.properties
INFO: Project root configuration file: NONE
INFO: Analyzing on SonarCloud
INFO: Default locale: "en_US", source code encoding: "UTF-8" (analysis is platform dependent)
INFO: Load global settings
INFO: Load global settings (done) | time=579ms
INFO: Server id: 1BD809FA-AWHW8ct9-T_TB3XqouNu
INFO: User cache: /opt/sonar-scanner/.sonar/cache
INFO: Load/download plugins
INFO: Load plugins index
INFO: Load plugins index (done) | time=136ms
INFO: Load/download plugins (done) | time=30523ms
INFO: Loaded core extensions: developer-scanner
INFO: Found an active CI vendor: 'Github Actions'
INFO: Load project settings for component key: {key}
INFO: Load project settings for component key: {key} (done) | time=115ms
INFO: Process project properties
INFO: Execute project builders
INFO: Execute project builders (done) | time=3ms
INFO: Project key: {key}
INFO: Base dir: /github/workspace/app
INFO: Working dir: /github/workspace/app/.scannerwork
INFO: Load project branches
INFO: Load project branches (done) | time=104ms
INFO: Check ALM binding of project {key}
INFO: Detected project binding: BOUND
INFO: Check ALM binding of project {key} (done) | time=99ms
INFO: Load project pull requests
INFO: Load project pull requests (done) | time=122ms
INFO: Load branch configuration
INFO: Github event: pull_request
INFO: Auto-configuring pull request 2574
INFO: Load branch configuration (done) | time=634ms
INFO: Load quality profiles
INFO: Load quality profiles (done) | time=151ms
INFO: Load active rules
INFO: Load active rules (done) | time=3655ms
INFO: Organization key: {org_key}
INFO: Pull request 2574 for merge into master from sonar-end-of-line-fix
INFO: Load project repositories
INFO: Load project repositories (done) | time=141ms
INFO: SCM collecting changed files in the branch
WARN: Could not find ref: master in refs/heads, refs/remotes/upstream or refs/remotes/origin
INFO: SCM collecting changed files in the branch (done) | time=175ms
INFO: Indexing files...
INFO: Project configuration:
INFO: Excluded sources: **/*.html, **/*.css, **/*.scss, **/tests/*.js, **/*.xml, **/*.json, **/fonts/**, **/tests/**
INFO: Included tests: **/tests/**
INFO: Excluded sources for coverage: **/tests/**
INFO: 1175 files indexed
INFO: 1786 files ignored because of inclusion/exclusion patterns
INFO: 0 files ignored because of scm ignore settings
INFO: Quality profile for js: Sonar way
INFO: Quality profile for yaml: Sonar way
INFO: ------------- Run sensors on module {key}
INFO: Load metrics repository
INFO: Load metrics repository (done) | time=109ms
INFO: Sensor CSS Rules [cssfamily]
INFO: Sensor CSS Rules is restricted to changed files only
INFO: No CSS, PHP, HTML or VueJS files are found in the project. CSS analysis is skipped.
INFO: Sensor CSS Rules [cssfamily] (done) | time=5ms
INFO: Sensor IaC CloudFormation Sensor [iac]
INFO: 0 source files to be analyzed
INFO: 0/0 source files have been analyzed
INFO: Sensor IaC CloudFormation Sensor [iac] (done) | time=21ms
INFO: Sensor C# Project Type Information [csharp]
INFO: Sensor C# Project Type Information [csharp] (done) | time=5ms
INFO: Sensor C# Analysis Log [csharp]
INFO: Sensor C# Analysis Log [csharp] (done) | time=15ms
INFO: Sensor C# Properties [csharp]
INFO: Sensor C# Properties [csharp] (done) | time=0ms
INFO: Sensor JavaXmlSensor [java]
INFO: Sensor JavaXmlSensor [java] (done) | time=20ms
INFO: Sensor HTML [web]
INFO: Sensor HTML is restricted to changed files only
INFO: Sensor HTML [web] (done) | time=9ms
INFO: Sensor VB.NET Project Type Information [vbnet]
INFO: Sensor VB.NET Project Type Information [vbnet] (done) | time=2ms
INFO: Sensor VB.NET Analysis Log [vbnet]
INFO: Sensor VB.NET Analysis Log [vbnet] (done) | time=22ms
INFO: Sensor VB.NET Properties [vbnet]
INFO: Sensor VB.NET Properties [vbnet] (done) | time=3ms
INFO: Sensor JaCoCo XML Report Importer [jacoco]
INFO: 'sonar.coverage.jacoco.xmlReportPaths' is not defined. Using default locations: target/site/jacoco/jacoco.xml,target/site/jacoco-it/jacoco.xml,build/reports/jacoco/test/jacocoTestReport.xml
INFO: No report imported, no coverage information will be imported by JaCoCo XML Report Importer
INFO: Sensor JaCoCo XML Report Importer [jacoco] (done) | time=14ms
INFO: Sensor JavaScript analysis [javascript]
INFO: Deploying custom rules bundle jar:file:/opt/sonar-scanner/.sonar/cache/8aa50956575faef23c5a269a418f196f/sonar-securityjsfrontend-plugin.jar!/js-vulnerabilities-rules-1.0.0.tgz to /github/workspace/app/.scannerwork/.sonartmp/eslint-bridge-bundle/package/custom-rules14642282764117635184
INFO: 1127 source files to be analyzed
INFO: 9/1127 files analyzed, current file: pages/api-activity/js/api-activity-details.react.js
INFO: 133/1127 files analyzed, current file: pages/portal-configuration2/index.js
INFO: 323/1127 files analyzed, current file: pages/developers/developers-add-edit/js/developer-activity.react.js
INFO: 462/1127 files analyzed, current file: common/components/tyk-input/index.js
INFO: 641/1127 files analyzed, current file: pages/apis/designer/tags-select/tags-select.js
INFO: 782/1127 files analyzed, current file: pages/apis/designer/graphql/js/graphql-schema-designer-field-form.js
INFO: 951/1127 files analyzed, current file: pages/certificates/js/certificates.actions.js
INFO: 1127/1127 source files have been analyzed
INFO: Sensor JavaScript analysis [javascript] (done) | time=82663ms
INFO: Sensor TypeScript analysis [javascript]
INFO: No input files found for analysis
INFO: Sensor TypeScript analysis [javascript] (done) | time=1ms
INFO: Sensor JavaScript/TypeScript Coverage [javascript]
INFO: No LCOV files were found using coverage/lcov.info
WARN: No coverage information will be saved because all LCOV files cannot be found.
INFO: Sensor JavaScript/TypeScript Coverage [javascript] (done) | time=462ms
INFO: Sensor ThymeLeaf template sensor [securityjavafrontend]
INFO: Sensor ThymeLeaf template sensor [securityjavafrontend] (done) | time=8ms
INFO: Sensor Serverless configuration file sensor [security]
INFO: 0 Serverless function entries were found in the project
INFO: 0 Serverless function handlers were kept as entrypoints
INFO: Sensor Serverless configuration file sensor [security] (done) | time=13ms
INFO: Sensor AWS SAM template file sensor [security]
INFO: Sensor AWS SAM template file sensor [security] (done) | time=3ms
INFO: Sensor JavaSecuritySensor [security]
INFO: Reading type hierarchy from: /github/workspace/app/.scannerwork/ucfg2/java
INFO: Read 0 type definitions
INFO: Reading UCFGs from: /github/workspace/app/.scannerwork/ucfg2/java
INFO: No UCFGs have been included for analysis.
INFO: Sensor JavaSecuritySensor [security] (done) | time=10ms
INFO: Sensor CSharpSecuritySensor [security]
INFO: Reading type hierarchy from: /github/workspace/app/ucfg_cs2
INFO: Read 0 type definitions
INFO: Reading UCFGs from: /github/workspace/app/ucfg_cs2
INFO: No UCFGs have been included for analysis.
INFO: Sensor CSharpSecuritySensor [security] (done) | time=3ms
INFO: Sensor PhpSecuritySensor [security]
INFO: Reading type hierarchy from: /github/workspace/app/.scannerwork/ucfg2/php
INFO: Read 0 type definitions
INFO: Reading UCFGs from: /github/workspace/app/.scannerwork/ucfg2/php
INFO: No UCFGs have been included for analysis.
INFO: Sensor PhpSecuritySensor [security] (done) | time=3ms
INFO: Sensor PythonSecuritySensor [security]
INFO: Reading type hierarchy from: /github/workspace/app/.scannerwork/ucfg2/python
INFO: Read 0 type definitions
INFO: Reading UCFGs from: /github/workspace/app/.scannerwork/ucfg2/python
INFO: No UCFGs have been included for analysis.
INFO: Sensor PythonSecuritySensor [security] (done) | time=2ms
INFO: Sensor JsSecuritySensor [security]
INFO: Reading type hierarchy from: /github/workspace/app/.scannerwork/ucfg2/js
INFO: Read 0 type definitions
INFO: Reading UCFGs from: /github/workspace/app/.scannerwork/ucfg2/js
INFO: 13:38:50.31712 Building Runtime Type propagation graph
INFO: 13:38:50.654645 Running Tarjan on 48487 nodes
INFO: 13:38:50.75656 Tarjan found 48485 components
INFO: 13:38:50.929949 Variable type analysis: done
INFO: 13:38:50.942095 Building Runtime Type propagation graph
INFO: 13:38:51.28999 Running Tarjan on 48487 nodes
INFO: 13:38:51.324971 Tarjan found 48485 components
INFO: 13:38:51.380869 Variable type analysis: done
INFO: Analyzing 6101 ucfgs to detect vulnerabilities.
INFO: Taint analysis starting. Entrypoints: 1041
INFO: Running symbolic analysis for 'JS'
INFO: Taint analysis: done.
INFO: Sensor JsSecuritySensor [security] (done) | time=10395ms
INFO: ------------- Run sensors on project
INFO: Sensor Zero Coverage Sensor
INFO: Sensor Zero Coverage Sensor (done) | time=72ms
INFO: SCM Publisher SCM provider for this project is: git
INFO: SCM Publisher 2 source files to be analyzed
WARN: Shallow clone detected, no blame information will be provided. You can convert to non-shallow with 'git fetch --unshallow'.
INFO: SCM Publisher 0/2 source files have been analyzed (done) | time=10ms
WARN: Missing blame information for the following files:
WARN: * pages/portal-configuration/js/admin/index.js
WARN: * pages/portal-configuration/js/emails/index.js
WARN: This may lead to missing/broken features in SonarCloud
INFO: CPD Executor 318 files had no CPD blocks
INFO: CPD Executor Calculating CPD for 722 files
INFO: CPD Executor CPD calculation finished (done) | time=245ms
INFO: SCM writing changed lines
WARN: Could not find ref: master in refs/heads, refs/remotes/upstream or refs/remotes/origin
INFO: SCM writing changed lines (done) | time=5ms
INFO: Analysis report generated in 195ms, dir size=1022 KB
INFO: Analysis report compressed in 912ms, zip size=919 KB
INFO: Analysis report uploaded in 746ms
INFO: ANALYSIS SUCCESSFUL, you can find the results at: {url}
INFO: Note that you will be able to access the updated dashboard once the server has processed the submitted analysis report
INFO: More about the report processing at https://sonarcloud.io/api/ce/task?id=AX0E7GIkdxB5xWPr-cvY
INFO: Analysis total time: 1:52.219 s
INFO: ------------------------------------------------------------------------
INFO: EXECUTION SUCCESS
INFO: ------------------------------------------------------------------------
INFO: Total time: 2:27.388s
INFO: Final Memory: 140M/470M
INFO: ------------------------------------------------------------------------
saberduck
(Tibor Blenessy)
November 10, 2021, 12:32pm
6
Hello @lghiur ,
thank you for providing the log. Can you please add -X
as a parameter, so we also see DEBUG
logs?
Can you verify that coverage/lcov.info
is produced and it is at the right location relative to the root of the application? The location of the file based on your logs should be /github/workspace/app/coverage/lcov.info