I have added a perl script to the “Execute shell” command in Jenkins. This perl script starts the Instruments via command line, to run the js tests(We use tuneup_js framework). When the script stats one of the tests, the jenkins console output is completely different from what instruments outputs. See below for the output given by Jenkins console:
Oct 17 15:06:03 macserver.local instruments[7197] <Error>: CGImageCreateWithImageProvider: invalid image size: 0 x 0.
2012-10-17 15:08:10.312 ScriptAgent[13266:13403] actionSheet:<UIAActionSheet_0x7c41ab0 uiaxElement=0x7c41a30 AXUIElementRef=0x7c41940>
2012-10-17 15:08:10.316 ScriptAgent[13266:13403] actionSheet:<UIAActionSheet_0xaa28be0 uiaxElement=0x7c41a30 AXUIElementRef=0x7c41940>
2012-10-17 15:08:10.320 ScriptAgent[13266:13403] actionSheet:<UIAActionSheet_0xaa2a5d0 uiaxElement=0x7c41a30 AXUIElementRef=0x7c41940>
2012-10-17 15:08:10.324 ScriptAgent[13266:13403] actionSheet:<UIAActionSheet_0xa4274e0 uiaxElement=0x7c41a30 AXUIElementRef=0x7c41940>
2012-10-17 15:08:10.328 ScriptAgent[13266:13403] actionSheet:<UIAActionSheet_0x7c433a0 uiaxElement=0x7c41a30 AXUIElementRef=0x7c41940>
2012-10-17 15:08:10.332 ScriptAgent[13266:13403] actionSheet:<UIAActionSheet_0x7c43c50 uiaxElement=0x7c41a30 AXUIElementRef=0x7c41940>
2012-10-17 15:08:10.335 ScriptAgent[13266:13403] actionSheet:<UIAActionSheet_0x7c44d90 uiaxElement=0x7c41a30 AXUIElementRef=0x7c41940>
2012-10-17 15:08:10.339 ScriptAgent[13266:13403] actionSheet:<UIAActionSheet_0x7c43340 uiaxElement=0x7c41a30 AXUIElementRef=0x7c41940>
2012-10-17 15:08:10.343 ScriptAgent[13266:13403] actionSheet:<UIAActionSheet_0x7c45ab0 uiaxElement=0x7c41a30 AXUIElementRef=0x7c41940>
I can see the tests running perfectly on the Simulator. If I run the same tests via Instruments my output would look something like:
2012-10-17 21:10:32 +0000 Start:
2012-10-17 21:10:32 +0000 Pass:
2012-10-17 21:10:32 +0000 Start:
2012-10-17 21:10:32 +0000 Issue:
2012-10-17 21:10:32 +0000 Issue:
2012-10-17 21:10:32 +0000 Pass:
2012-10-17 21:10:32 +0000 Start:
2012-10-17 21:10:32 +0000 Debug: target.setDeviceOrientation("3")
2012-10-17 21:10:33 +0000 Issue:
2012-10-17 21:10:33 +0000 Debug: target.setDeviceOrientation("1")
2012-10-17 21:10:35 +0000 Debug: target.frontMostApp().mainWindow().scrollViews()[0].buttons()["t"].tap()
2012-10-17 21:10:36 +0000 Debug: target.setDeviceOrientation("3")
2012-10-17 21:10:38 +0000 Issue:
I want the output of the console something similar to the output above. Is this possible?
I finally got it to work!
The problem was in the perl script which was running the tests.
Instead of using system($command), I was using back tick operator.
I dont know why the the backtick operator wouldn’t return the output nor why system() works here.