realm / SwiftCov

A tool to generate test code coverage information for Swift.
MIT License
561 stars 41 forks source link

Why SwiftCov does not work in TravisCI? #56

Open guidomb opened 9 years ago

guidomb commented 9 years ago

I want to know why SwiftCov does not work in travis and what needs to be done to fix it.

jpsim commented 9 years ago

How are you installing it?

guidomb commented 9 years ago

I uploaded the .pkg to my repo and I installed it using the installer command. The problem is that it fails to generate the coverage files.

— Sent from Mailbox

On Wed, Jul 8, 2015 at 7:58 PM, JP Simard notifications@github.com wrote:

How are you installing it?

Reply to this email directly or view it on GitHub: https://github.com/realm/SwiftCov/issues/56#issuecomment-119754124

jpsim commented 9 years ago

Fails in what way?

guidomb commented 9 years ago

I don't really know is weird. I have this project building in travis. When I run the script/coverage upload script locally it works fine and uploads the coverage report to coveralls.io. The same script when is run in travis uploads a coverage report of 0% which is not true.

Reading the build log (I listed the coverage folder to check that all the .gcov files are generated) you can see the following message: Failed to generate test code coverage files. Which is not true because the coverage folder contains all the .gcov files.

kishikawakatsumi commented 9 years ago

I'm not sure what happened on Travis CI, I also tried many times, but did not succeed. Maybe it seems that LLDB failed to attach to test process. I think it is something different between local environment and Travis CI. It takes time to investigate it. Since there is no way to find other than to see the log.

guidomb commented 9 years ago

I've just printed the coverage.json file generated by coveralls-gcov and the problem is that code coverage could not be calculated somehow. But I have no idea where to look now.

[{"name":"ReactiveArray/Operation.swift","source_digest":"9776ed85b5acfcf37dcb4fb060b95633","coverage":[null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null]},{"name":"ReactiveArray/ReactiveArray.swift","source_digest":"7429f76c399275c581e4d151d2adeef1","coverage":[null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null]}]}
kishikawakatsumi commented 9 years ago

The results show that executing any function of breakpoints have failed. Therefore, it seems all lines are not running. Perhaps debugger failed to attach the process, but I do not know why fail on Travis CI.

guidomb commented 9 years ago

Yeah is super hard to debug anything in travis. Maybe with ssh access and adding logs to SwiftCov. I may try that.

jenkinsja commented 9 years ago

I run into a very similar issue when running swiftcov from Jenkins. In addition to the Failed to generate test code coverage files error message, I also get a python crash akin to that which was reported in https://github.com/realm/SwiftCov/issues/6. Any information on how to resolve this issue would be greatly appreciated.

pawurb commented 7 years ago

Do you have any plans on adding Travis CI support ? As far as I know it is the only free option for OS projects. Maybe sth changed since 1 year ago ;)