I’m actually working on a React project using Bitbucket pipelines and sonarCloud to coverage code for this project.
Running sonar scan work fine
step: &step-sonar-scan
size: 2x
name: Analyze on SonarCloud
services:
- docker
caches:
- docker
- sonar
script:
- pipe: sonarsource/sonarcloud-scan:1.2.2
variables:
SONAR_TOKEN: ${SONAR_TOKEN}
EXTRA_ARGS: '-Dsonar.sources=src -Dsonar.tests=src -Dsonar.test.inclusions="**/__test__/**, **.test.js, **/*.spec.js" -Dsonar.javascript.lcov.reportPaths=coverage/lcov.info'
But the quality gate didn’t show me the coverage code %.
step: &step-sonar-quality-gate
trigger: 'manual' # Could be reset to default state automatic
name: Sonar Quality Gate
services:
- docker
caches:
- docker
- node # added
- sonar
script:
- yarn test --coverage --watchAll=false --cache
- pipe: sonarsource/sonarcloud-quality-gate:0.1.4
Locally, the cmd yarn test --coverage --watchAll=false --cache
show coverage code equal to 86%
--------------------------------------------|-------------|---------------|--------------|------------|----------------------------
File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s |
---|---|---|---|---|---|
All files | 86.57 | 85 | 81.82 | 91.53 | |
-------------------------------------------- | ------------- | --------------- | -------------- | ------------ | ---------------------------- |
at sonar coverage it still always 0%
Could anyone please tell me if I made a mistake, or what am I missing?