You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
SonarQube not showing coverage report for cobertura coverage file generated using xcresultparser #56
Hi Team,
xcresultparser works very well for generic code coverage file.. Azure pipeline shows test coverage where as
generated cobertura code coverage file (uploaded to SonarQube cloud) not showing coverage report..
This is how I use to generate cobertura.xml for code coverage
Try to provide the project root, so that the absolute paths to the files can be converted to relative path names. Sonarqube requires relative path names rooting in the directory which you provide to the sonar scanner als source root. Provide the same source root to xcresultparser using the -p or --project-root switch.
E.g.
--project-root "work/myApp/"
It seems so. I do not use cobertura format myself and don't even know how/where to test it. I feed sonarqube with the generic format for coverage.
That is: I use the -c switch and as format I use "xml" and the --project-root thingie as well.
So:
xcresultparser -o xml -c --project-root project/root test.xcresult
Actually our pipeline is pre-configured with cobertura to feed sonarqube,
Do you use azure dev ops (I mean azure pipeline) to feed sonarqube, if yes, could you please let me know which tool you use in pipeline, possibly I will try to use same with the generic format for coverage
Activity
a7ex commentedon Jun 11, 2025
Try to provide the project root, so that the absolute paths to the files can be converted to relative path names. Sonarqube requires relative path names rooting in the directory which you provide to the sonar scanner als source root. Provide the same source root to xcresultparser using the -p or --project-root switch.
E.g.
--project-root "work/myApp/"
SurendraMetrobank commentedon Jun 11, 2025
thank you for assisting, I am going to try it now
SurendraMetrobank commentedon Jun 11, 2025
Hi @a7ex ,
it seems like by adding --project-root, it fixes file name however class name is showing as name space e.g.
Should be like this?
SonarQube cloud not showing coverage yet
Regards,
Surendra
a7ex commentedon Jun 11, 2025
It seems so. I do not use cobertura format myself and don't even know how/where to test it. I feed sonarqube with the generic format for coverage.
That is: I use the -c switch and as format I use "xml" and the --project-root thingie as well.
So:
xcresultparser -o xml -c --project-root project/root test.xcresult
SurendraMetrobank commentedon Jun 11, 2025
Actually our pipeline is pre-configured with cobertura to feed sonarqube,
Do you use azure dev ops (I mean azure pipeline) to feed sonarqube, if yes, could you please let me know which tool you use in pipeline, possibly I will try to use same with the generic format for coverage
thank you
SurendraMetrobank commentedon Jun 12, 2025
Hi @a7ex ,
Is there any suggestion / solution to update class name in cobertura coverage xml file?
Regards,