Skip to content
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 ignored #31

Closed
lukewar opened this issue Jun 7, 2016 · 3 comments
Closed

Code coverage ignored #31

lukewar opened this issue Jun 7, 2016 · 3 comments

Comments

@lukewar
Copy link

lukewar commented Jun 7, 2016

I generate code coverage with success but it is not reported on the Web.
Is there an option to get verbose logs that will tell me why cobertura.xml is not uploaded?

@viteinfinite
Copy link
Contributor

Hey, sorry for the delay. For more logs, you can run sonar runner with the -e or -X options.
Also, please double check your report file (and the paths in it).
HTH

@mgrebenets
Copy link

@lukewar What are the paths in your cobertura.xml?
Could it be related to #36?

Also, what's your sonar.swift.coverage.reportPattern value in sonar-project.properties?
I had it set to stuff like .fastlane/coverage*.xml, sonar-reports/coverage*.xml.
I tried sonar.swift.coverage.report too, but it didn't work.

Only after I removed all sonar.swift.coverage.report... lines from properties file and put a report into sonar-reports directory, I saw a message like this in sonar runner log:

- Processing coverage report /Users/path/to/project/sonar-reports/coverage.xml

@lukewar
Copy link
Author

lukewar commented Aug 5, 2016

Thanks guys for helping me with investigating this issue. It is weird since I have 4 other projects where everything works just fine. All projects have sources in both Swift and Obj-C.

Eventually I have found what was the reason. This project had tests written only in Obj-C. Apparently sonar-runner implementation is skipping coverage check if /*Tests directory does not contain any file with .swift extension. Adding empty file with .swift extension resolved this.

I will answer questions from previous comments as somebody may find it useful:

@lukewar lukewar closed this as completed Aug 5, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants