fastlane-community / xcov

Nice code coverage reporting without hassle
MIT License
556 stars 107 forks source link

How to show xcov results in Jenkins #120

Open prolificcoder opened 6 years ago

prolificcoder commented 6 years ago

Apologize if this has been answered or known already. I tried searching through other documentation and issues but haven't found a solution yet.

We are using Jenkins with fastlane and able to generate code coverage with xcov. I can see the report.json file being generated. Now I would like this report to be integrated within Jenkins something like this: image ^Is a report from corbertura and slather. Is it possible to do this with xcov.

I prefer not to use Danger because it seems to be adding more complexity into the tool set. Ours is a GitHub enterprise so something like coveralls doesn't work as well.

yashwanth777 commented 6 years ago

hey I am trying to do the same how did you generate the report using xcov I am having some issues in generating it [19:21:49]: Unable to find any .xccoverage file. [19:21:49]: Make sure you have enabled 'Gather code coverage' setting on your scheme settings. [19:21:49]: Alternatively you can provide the full path to your .xccoverage file.

prolificcoder commented 6 years ago

I did few things

  1. code_coverage:true in scan
  2. legacy_support:xccoverage in xcov

I made more progress than you but i am still not there yet :|

yashwanth777 commented 6 years ago

I got the report now I am now trying to integrate it with sonarqube

cisum-la commented 6 years ago

@yashwanth777 Can you please outline the steps to get coverage shown in Jenkins through Cobertura (which i think expects xml format)

gustanas commented 6 years ago

@yashwanth777 Interested in that too

greenzeal commented 5 years ago

@yashwanth777 please share info :)

@gustanas ;)

liang-notes commented 5 years ago

I got the report now I am now trying to integrate it with sonarqube

hey, how did you generate the report using xcov, i still have problem: [13:52:10]: $ xcodebuild -showBuildSettings -workspace fastlaneDemo.xcworkspace -scheme fastlaneDemo [13:52:12]: Unable to find any .xccoverage file. [13:52:12]: Make sure you have enabled 'Gather code coverage' setting on your scheme settings. [13:52:12]: Alternatively you can provide the full path to your .xccoverage file. can you help me?

Speakus commented 4 years ago

it would be nice to have option for cobertura xml as result https://github.com/fastlane-community/xcov/issues/160 to allow to use https://plugins.jenkins.io/cobertura

or find some other plugin to publish json generated with option json_report: true

BeibeiLewis commented 2 years ago

2. legacy_support:xccoverage

h

I got the report now I am now trying to integrate it with sonarqube

Hello, my brother, how to resolve the issue? i hit the issue too.

chipsnyder commented 1 year ago

I've found a solution to this issue by using https://github.com/a7ex/xcresultparser instead of xcov.

From my Fastfile I'm running:

system("xcresultparser -o cobertura #{lane_context[SharedValues::SCAN_GENERATED_XCRESULT_PATH]} > test_output/cobertura.xml")