Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can I integrate Jenkins and XCTest

Is it possible to use Jenkins with XCTest?

There's a ruby script (OCUnit2JUnit -- https://github.com/ciryon/OCUnit2JUnit) that parses OCUnit output and creates XML files that Jenkins can parse.

Is there something equivalent to handle the new XCTest output?

Right now, using Apple's continuous integration is not a possibility.

like image 417
Humble Objective-Cer Avatar asked Oct 09 '13 23:10

Humble Objective-Cer


2 Answers

Two options:

1) pipe your xcodebuild output into xcpretty and use their Junit formatter. Then Jenkins can publish that.

B) use xctool instead of xcodebuild. Xctool has built in Junit reporter you can specify for tests.

We've done both and they both work fine on Jenkins.

like image 117
plluke Avatar answered Oct 17 '22 17:10

plluke


You need to add a shell script build phase.

First add the ocunit2junit gem to the build machine:

sudo gem install ocunit2junit

Then add the build phase shell script and make sure you're in the project directory when you execute the script:

xcodebuild -workspace yourWorkSpace.xcworkspace -scheme YourTestsScheme -configuration Debug clean test 2>&1 | ocunit2junit

Then make sure to add the publish JUnit test results post build action to the Jenkins job configured to find the output for ocunit2junit: **/test-reports/*.xml

like image 34
cynistersix Avatar answered Oct 17 '22 18:10

cynistersix