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.
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.
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With