- ALM used Github
- CI system used Github Actions
- Scanner command used when applicable (private details masked)
- name: SonarCloud Scan
uses: sonarsource/sonarcloud-github-action@master
with:
args: >
-Dsonar.projectKey=company_project
-Dsonar.organization=company
-Dsonar.sources=./
-Dsonar.verbose=true
-Dsonar.externalIssuesReportPaths=sonar-issues.json
-Dsonar.coverageReportPaths=sonar-coverage.xml
- Languages of the repository
Only Rust files are contained in the sonar-coverage.xml file and the sonar-issues.json only contains:
{"issues":[]}
The sonar-coverage.xml file is formatted such below; occasionally a file with no coverage will have an empty block<file path="src/asdf.rs"></file>
:
<coverage version="1"><file path="src/main.rs"><lineToCover lineNumber="2" covered="false"/><lineToCover lineNumber="3" covered="false"/><lineToCover lineNumber="6" covered="true"/><lineToCover lineNumber="7" covered="true"/><lineToCover lineNumber="11" covered="false"/><lineToCover lineNumber="12" covered="false"/><lineToCover lineNumber="13" covered="false"/><lineToCover lineNumber="14" covered="false"/><lineToCover lineNumber="22" covered="true"/><lineToCover lineNumber="23" covered="true"/><lineToCover lineNumber="24" covered="true"/></file></coverage>
- Only if the SonarCloud project is public, the URL
Not public - Error observed (wrap logs/code around with triple quotes ``` for proper formatting)
03:17:46.583 ERROR: Error during SonarScanner execution
03:17:46.583 ERROR: Error during parsing of the generic coverage report '/github/workspace/sonar-coverage.xml'. Look at SonarQube documentation to know the expected XML format.
03:17:46.584 ERROR: Caused by: Line 1 of report refers to a file with an unknown language: console_backend/benches/cpu_benches.rs
03:17:46.584 ERROR:
03:17:46.585 ERROR: Re-run SonarScanner using the -X switch to enable full debug logging.
- Potential workaround:
I’m thinking maybe I could forcefully change the file extensions to something known, to at least get the results in SonarCloud but just inform people of the hack.
Is there any work being done to get rust whitelisted as a generic test coverage language?