Question

I am upgrading a Jenkins CI server from XCode 4.6 to XCode 5 and iOS SDK 7.

To run unit tests, I must now use xcodebuild test. I am piping the output of this command to a Ruby script, that generates test reports.

This does not work any longer after the upgrade. I think the problem lies in the fact that xcodebuild test launches a new process to actually run the tests. The last statement in my log is

/bin/sh -c /Volumes/Data/Jenkins/jobs/MyProject-Unit/workspace/Build/Intermediates/Redacted.build/Debug-iphonesimulator/UnitTests.build/Script-261C7EA912FD9A4B00F7A53E.sh

The output after that point can not be found in the Jenkins log, but when I run it on my own machine, I get the test results printed in the console.

What is happening here, and how can I get the test reports back ?

Was it helpful?

Solution

I'm on the same trail. I believe if you look into that script, it will turn around and call this script:

${SYSTEM_DEVELOPER_DIR}/Tools/RunUnitTests

This is script that used to run unit tests. Now, in Xcode 5, it just tells you to remove the Run Script build phase that Xcode 4 automatically creates. If you run RunUnitTests from Xcode 5, it just says:

RunUnitTests is obsolete. To run unit tests for your target, use the Test scheme action in the Xcode IDE and the test action in xcodebuild. You can remove the Run Script build phase that invokes RunUnitTests from your unit test bundle target.

I've gone ahead and done what it says (removed the Run Script phase) and I still get no output under Jenkins, perhaps because, as you surmise, it's a new process, and Jenkins sees the first process complete, and jumps out.

Update: More info here: How can I get Xcode 5 to run iOS unit tests on a Jenkins slave?

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top