- which versions are you using: SonarQube Community Edition Version 9.9.4 (build 87374)
- how is SonarQube deployed: Github actions
- what are you trying to achieve: show count of unit tests and e2e tests - is it possible to show the count of e2e tests? is it possible to show the count of cucumber tests?
- what have you tried so far to achieve this:
My yml step is:
- name: SonarQube Scan
env:
SONAR_PROJECT_KEY: ${{ secrets.sonar_projectkey }}
SONAR_TOKEN: ${{ secrets.sonar_token }}
SONAR_HOST_URL: ${{ secrets.sonar_host_url }}
run: |
sonar-scanner \
-Dsonar.projectKey=$SONAR_PROJECT_KEY \
-Dsonar.sources=. \
-Dsonar.tests=src/app,cucumber/step-definitions,playwright/tests \
-Dsonar.exclusions="**/main.ts,**/docker/**,**/babel.config.js,**/commitlint.config.js,**/jest-cucumber.config.js,**/jest.config.js,**/playwright.config.ts,**/setup-jest.ts,**/*.scss,playwright/pages/**,**/**/*routes.ts,**/**/*config.ts,**/*.config.ts,**/*.config.js" \
-Dsonar.test.exclusions="playwright/pages,playwright/results" \
-Dsonar.javascript.lcov.reportPaths=coverage/lcov-merged.info \
-Dsonar.testExecutionReportPaths=coverage/unit-tests/sonar-report.xml
Logs say:
INFO: Parsing /home/runner/actions-runner/_work/…/coverage/unit-tests/sonar-report.xml
INFO: Imported test execution data for 0 files
INFO: Test execution data ignored for 1 unknown files, including:
src/app/app.component.spec.ts
xml file:
<testExecutions version="1">
<file path="src/app/app.component.spec.ts">
<testCase name="AppComponent should have as title '...'" duration="36" />
<testCase name="AppComponent should create the app" duration="9" />
<testCase name="AppComponent should allow change of status" duration="9" />
</file>
</testExecutions>