Hello everyone!
This is my third question related to same issue I am facing for last few months.
I followed same steps mentioned in this link
I successfully generated sonarqube-generic-coverage.xml file using commands mentioned at above link. Below is the snippet from data inside in this file.
INFO: Sensor AWS SAM template file sensor [security] (done) | time=73ms
INFO: Sensor AWS SAM Inline template file sensor [security]
INFO: Sensor AWS SAM Inline template file sensor [security] (done) | time=2ms
INFO: Sensor Generic Coverage Report
INFO: Parsing /Users/runner/work/1/s/sonarqube-generic-coverage.xml
INFO: Imported coverage data for 0 files
INFO: Coverage data ignored for 582 unknown files, including:
/TapCheck/Application/AppDelegate.swift
/TapCheck/Application/BaseViewController.swift
/TapCheck/Application/ViewController.swift
/TapCheck/Controllers/Account/Authentication/ForgotPasswordVC.swift
/TapCheck/Controllers/Account/Authentication/SignInVC.swift
INFO: Sensor Generic Coverage Report (done) | time=398ms
INFO: Sensor javabugs [dbd]
INFO: Reading IR files from: /Users/runner/work/1/s/.scannerwork/ir/java
INFO: No IR files have been included for analysis.
INFO: Sensor javabugs [dbd] (done) | time=2ms
INFO: Sensor pythonbugs [dbd]
INFO: Reading IR files from: /Users/runner/work/1/s/.scannerwork/ir/python
INFO: No IR files have been included for analysis.
INFO: Sensor pythonbugs [dbd] (done) | time=4ms
INFO: Sensor JavaSecuritySensor [security]
INFO: Reading type hierarchy from: /Users/runner/work/1/s/.scannerwork/ucfg2/java
INFO: Read 0 type definitions
INFO: Reading UCFGs from: /Users/runner/work/1/s/.scannerwork/ucfg2/java
INFO: No UCFGs have been included for analysis.
INFO: Sensor JavaSecuritySensor [security] (done) | time=13ms
INFO: Sensor CSharpSecuritySensor [security]
INFO: Reading type hierarchy from: /Users/runner/work/1/s/ucfg_cs2
INFO: Read 0 type definitions
INFO: Reading UCFGs from: /Users/runner/work/1/s/ucfg_cs2
Need help/suggesion on below error. INFO: Coverage data ignored for 582 unknown files, including: /TapCheck/Application/AppDelegate.swift /TapCheck/Application/BaseViewController.swift /TapCheck/Application/ViewController.swift /TapCheck/Controllers/Account/Authentication/ForgotPasswordVC.swift /TapCheck/Controllers/Account/Authentication/SignInVC.swift
I’m not sure what to tell you. You’ll need to see what configuration options are available on the tools you’re using or do some pre-processing of the report.
Hi Ann,
Below command of tool generates coverage file which always set absolute path.
bash xccov-to-sonarqube-generic.sh Build/Logs/Test/*.xcresult/ > sonarqube-generic-coverage.xml
Even on their sample github project Link, issue was opened by someone releated to this.
INFO: Sensor Generic Coverage Report
INFO: Parsing /Users/runner/work/1/s/sonarqube-generic-coverage.xml
INFO: ------------------------------------------------------------------------
INFO: EXECUTION FAILURE
INFO: ------------------------------------------------------------------------
INFO: Total time: 44.008s
INFO: Final Memory: 36M/124M
INFO: ------------------------------------------------------------------------
##[error]ERROR: Error during SonarScanner execution
ERROR: Error during SonarScanner execution
##[error]ERROR: Error during parsing of the generic coverage report '/Users/runner/work/1/s/sonarqube-generic-coverage.xml'. Look at SonarQube documentation to know the expected XML format.
ERROR: Caused by: Line 539 is out of range in the file TapCheck/Controllers/Home/HomeVC.swift (lines: 538)
ERROR:
ERROR: Re-run SonarScanner using the -X switch to enable full debug logging.
ERROR: Error during parsing of the generic coverage report '/Users/runner/work/1/s/sonarqube-generic-coverage.xml'. Look at SonarQube documentation to know the expected XML format.
ERROR: Caused by: Line 539 is out of range in the file TapCheck/Controllers/Home/HomeVC.swift (lines: 538)
ERROR:
ERROR: Re-run SonarScanner using the -X switch to enable full debug logging.
##[error]The process '/Users/runner/work/_tasks/SonarCloudAnalyze_ce096e50-6155-4de8-8800-4221aaeed4a1/1.33.1/sonar-scanner/bin/sonar-scanner' failed with exit code 2
Finishing: SonarCloudAnalyze
I even checked line 539 of my HomeVC file but there is nothing wrong anywhere in this file.
For Refernece, I have attached file
Unfortunately, I need to ask you to create a new thread for the parsing error. As you’re aware, we try to keep it to one topic per thread, and we’ve now migrated from “why are the entries in my coverage report ignored?” to “coverage report parsing errors out on valid line”.
I would create the thread for you by splitting this thread, but it’s not doable cleanly.
Hi,
Thanks for updating the title of this thread.
I removed HomeVC path from sonar-coverage report and now coverage report shows up.
This thread helped me alot to generate releated path.
Thanks alot Ann for helping me through out this journey.