-
Notifications
You must be signed in to change notification settings - Fork 204
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Code coverage not showing on Sonar dashboard #44
Comments
thanks for your feedback. there is a problem with the code coverage and Xcode 5, I guess this is your problem: #39 You can check the content of your coverage-FIDApp.xml file, I guess it is almost empty, right? |
The coverage file is not empty. It has every class entry in it. I had to tweak the xctool/xcodebuild command line switch a little bit. When I use the gcovr commandline with html output option I can see real coverage. If you would like a copy of the coverage file for testing purpose let me know. I can also send you zipped up sonar-reports folder. |
In this case, yes, I am interested in your input. I am interested both in:
If you could you make a Gist with all that, that would be perfect! I realize I should add a troubleshooting section on GitHub also to make things easier to report. |
I have uploaded related files to: run-sonar-new.sh is a modified version of run-sonar.sh, where we had to put temporary workaround for OCLint. Because Xcode5 by default doesn't generate coverage files, we found a workaround of including XCTest+GCovFlush.h and XCTest+GCovFlush.m in our xcode project. This looks like triggers the flushing our of the gcc coverage files and we were able to see the coverage in both xml and html (manually generated by gcovr) |
sorry for the delay, I just looked at your issue again. It seems you had 2 issues, right?
|
I have filed a separate issue #48 about OCLint. About coverage, our workaround (with XCTest+GCovFlush.h/.m) only solves part of the problem, up to the point we can get coverage XML. However, seems Sonar runner is NOT picking up the xml report, therefore we are not seeing coverage in Sonar dashboard. Let me know if provided information (source code and log) is suffcient: |
I think I'm getting the same error: |
Hi, I'm getting the same error too. My coverage file is properly created in ${ROOT_PROJECT_DIRECTORY}/sonar-reports/coverage-.xml after running the run-sonar.sh script. The file is not empty but it seems that sonar can't find it (even i force the path in Sonar project Objective-C settings). Maybe is more related about the Sonar plugin than the script. Thank you for your support! |
Yea, looks like we're running into a similar issue. We get unit tests to run (and show 100% success), and a nice cobertura coverage report is generated, but no coverage data is showing in the Sonar app |
Same thing here... :(... |
I was seeing the problem with SonarQube 4.2 When I switched to 3.7.4, things were working. Maybe give that a shot? |
Potentially, but it depends on what your organization is running. Also, for the people installing it through brew you are automatically pushed the 4.2 release. [web [iPhone msg]]
|
Any solutions to this? |
Having a similar problem myself. ... looks like I need to stick to the LTS version, unless anyone has found a fix? |
Having a similar problem. It is, in fact, multifold:
Sensor org.sonar.plugins.objectivec.coverage.CoberturaSensor@7136d1b3
The cobertura XML file is NOT empty. Any idea? Thanks, |
Facing similar problem with Xcode 7.x |
Facing same issue with Xcode 7.x. Eventhough the cobertura.xml file is generated successfully (not empty) and fyi: Cobertura plugin is also installed and i am using a build from PR#79. Sonar: 5.3 |
Even i was facing the same problem. But late it got solved. |
Any updates on this?
I even printed the coverage.xml file previously in my jenkins pipeline and it looks fine:
|
coverage report xml was generated by xctool under sonar-reports directory but not showing on Sonar dashboard.
Xcode version is 5.0.
Verbose mode run-sonar.sh output showing the coverage report was recognized by Sonar runner and processed:
18:29:47.020 INFO - Sensor org.sonar.plugins.objectivec.coverage.CoberturaSensor@37bce5dc...
18:29:47.030 INFO - Processing coverage report /ffas/workspaces/FFAS_Mobile_Framework_Sonar/FFASMobileFramework/FIDApp/src/FIDApp/sonar-reports/coverage-FIDApp.xml
18:29:47.037 INFO - Sensor org.sonar.plugins.objectivec.coverage.CoberturaSensor@37bce5dc done: 17 ms
The text was updated successfully, but these errors were encountered: