sajrashid
(Sajid Rashid)
July 29, 2021, 5:23am
1
Template for a good new topic, formatted with Markdown :
ALM used (GitHub)
CI system used (Github actions)
Languages of the repository - Javascript
SonarQube Cloud
run yarn coverage to see the coverage report from jest is updated, but not showing the new updates on sonar cloud.
thanks
Error observed no error just not updating
Steps to reproduce - run github action
Action
on:
Trigger analysis when pushing in master or pull requests, and when creating
a pull request.
push:
branches:
- main
pull_request:
types: [opened, synchronize, reopened]
name: Sonar
jobs:
sonarcloud:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Get main
run: git fetch origin main
- name: Install dependencies
run: npm install
- name: Install Jest globally
run: sudo npm install -g jest
- name: Run Tests
run: npm run test
- name: SonarCloud Scan
uses: sonarsource/sonarcloud-github-action@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
Hi @sajrashid
Are you setting some kind of sonar.*.coveragePath somewhere ?
Mickaël
sajrashid
(Sajid Rashid)
August 7, 2021, 2:52am
3
Hi @mickaelcaro ,
Yes in sonar-project.properties Repo Link to sonar-project-properties
sonar.organization=sajrashid
sonar.projectKey=sajrashid_React-Dynamic-Json-Table
sonar.sources=.
sonar.exclusions=src/tests/** ,src/components/hooks/, coverage/ , src/public/, src/dist/ , src/pages/** , /examples/**, src/index.js, src/App.js, src/reportWebVitals.js, src/wrapper.js, src/setupTests.js, src/craco.config.js
sonar.language=js
sonar.javascript.lcov.reportPaths=coverage/lcov.info
sonar.testExecutionReportPaths=test-report.xml
sonar.sourceEncoding=UTF-8
Thanks for looking.
Thanks.
I see this warning in your Analysis logs on GH actions
WARN: No coverage information will be saved because LCOV file cannot be found.
WARN: Provided LCOV file path: coverage/lcov.info. Seek file with path: /github/workspace/coverage/lcov.info
WARN: No coverage information will be saved because all LCOV files cannot be found.
So i guess you may check the exact path where the coverage file is to fill it in in the property correctly.
Mickaël