I am trying to generate an “Overall - Coverage” details from my test project, but even after a lot attempts I’m still getting 0% of covering test.
The file .xhr containing the quantity of test is showing up fine, on total 66 tests as the images show.
I followed some tracked issues on Github pages and Sonar.community but no success unfortunally.
Hope somebody have a tip or facing the same issue for give me any advice
What are the scanner logs telling you? Look for information along these lines:
13:23:38.857 INFO: Sensor C# Tests Coverage Report Import [csharp]
13:23:38.858 INFO: Parsing the Visual Studio coverage XML report d:\support\Scanner\coveragebug\ConsoleApp1\vs.coveragexml
13:23:38.861 INFO: Adding this code coverage report to the cache for later reuse: d:\support\Scanner\coveragebug\ConsoleApp1\vs.coveragexml
13:23:38.864 DEBUG: Found some coverage info for the file 'D:\support\Scanner\coveragebug\ConsoleApp1\ConsoleApp1\Program.cs'.
13:23:38.865 INFO: Sensor C# Tests Coverage Report Import [csharp] (done) | time=8ms
I am not sure about the track you need, but I faced this log
INFO: Sensor C# Tests Coverage Report Import [csharp]
INFO: Parsing the OpenCover report E:\Jenkins\workspace\HAN-6_SonarScan\report.coverage.xml
INFO: Adding this code coverage report to the cache for later reuse: E:\Jenkins\workspace\HAN-6_SonarScan\report.coverage.xml
INFO: Coverage Report Statistics: 121 files, 111 main files, 111 main files with coverage, 10 test files, 0 project excluded files, 0 other language files.
INFO: Sensor C# Tests Coverage Report Import [csharp] (done) | time=1369ms
INFO: Sensor C# Unit Test Results Import [csharp]
INFO: Parsing the Visual Studio Test Results file ‘E:\Jenkins\workspace\HAN-6_SonarScan\coverage.trx’.
INFO: Sensor C# Unit Test Results Import [csharp] (done) | time=15ms
INFO: Sensor Zero Coverage Sensor
INFO: Sensor Zero Coverage Sensor (done) | time=0ms
INFO: CPD Executor 7 files had no CPD blocks
INFO: CPD Executor Calculating CPD for 79 files
INFO: CPD Executor CPD calculation finished (done) | time=78ms
INFO: Analysis report generated in 313ms, dir size=1.7 MB
INFO: Analysis report compressed in 930ms, zip size=550.5 kB
INFO: Analysis report uploaded in 78ms
INFO: ANALYSIS SUCCESSFUL, you can browse http://[url]/dashboard?id=HAN-6
INFO: Note that you will be able to access the updated dashboard once the server has processed the submitted analysis report
INFO: More about the report processing at http://[url]/api/ce/task?id=AX4jriVL4bLWae_woKI1
INFO: Analysis total time: 28.783 s
INFO: ------------------------------------------------------------------------
INFO: EXECUTION SUCCESS
INFO: ------------------------------------------------------------------------
INFO: Total time: 30.890s
INFO: Final Memory: 14M/54M
INFO: ------------------------------------------------------------------------
The SonarScanner CLI has finished
03:02:06.603 Post-processing succeeded.
If is not enough, please let me know. Thanks again.
Is there something what I should be configured with nodejs? I did not see any about this in other threads.
In your second question, I do not cleary understand your meaning, but in my thought the coverage lines percentage should be changed according to my test implementation project, or am I wrong? Am I on a correct tought line? You can check the Code tab detailed on image bellow.
I appreciate your help in this case, but I found the issue that I was facing.
After replace the vstest path “/d:sonar.cs.vstest.reportsPaths=“E:\Jenkins\workspace\HAN-6_SonarScan\coverage.trx”” and put the xunit path “/d:sonar.cs.xunit.reportsPaths=“E:\Jenkins\workspace\BRANCH-6_SonarScan\report.tests.xml”” the sonar started to recognizing the line coverage as you can see.