Jenkins 集成 xctool 执行 iOS 单元测试失败,提示“Failed for unknown reason.”


环境:
Jenkins搭建在Mac服务器上面,安装在tomcat当中以webapp方式启动。
mac系统版本:10.9.4
xctool版本:0.2.2
jenkins版本:1.598

现象:
在mac本机执行测试通过,使用jenkins shell方式执行失败,模拟器启动后显示黑屏。

测试命令:
xctool -project Sample.xcodeproj -scheme SampleTests -sdk iphonesimulator test -freshInstall -freshSimulator

错误日志如下:


 --------------------------------------------------------------------------------
iOS deployment target '8.1' for architecture 'i386' and variant 'normal' is greater than the maximum value '8.0.99' for the Simulator - iOS 8.0 SDK.
--------------------------------------------------------------------------------
      ~ Write auxiliary files (3 ms)
--------------------------------------------------------------------------------
/bin/mkdir -p /Users/wangmy/Library/Developer/Xcode/DerivedData/Sample-haasvciuwqzzcociidumavsvdwoo/Build/Intermediates/Sample.build/Debug-iphonesimulator/SampleTests.build
write-file /Users/wangmy/Library/Developer/Xcode/DerivedData/Sample-haasvciuwqzzcociidumavsvdwoo/Build/Intermediates/Sample.build/Debug-iphonesimulator/SampleTests.build/SampleTests-project-headers.hmap
write-file /Users/wangmy/Library/Developer/Xcode/DerivedData/Sample-haasvciuwqzzcociidumavsvdwoo/Build/Intermediates/Sample.build/Debug-iphonesimulator/SampleTests.build/SampleTests-generated-files.hmap
write-file /Users/wangmy/Library/Developer/Xcode/DerivedData/Sample-haasvciuwqzzcociidumavsvdwoo/Build/Intermediates/Sample.build/Debug-iphonesimulator/SampleTests.build/SampleTests-all-target-headers.hmap
write-file /Users/wangmy/Library/Developer/Xcode/DerivedData/Sample-haasvciuwqzzcociidumavsvdwoo/Build/Intermediates/Sample.build/Debug-iphonesimulator/SampleTests.build/SampleTests-own-target-headers.hmap
write-file /Users/wangmy/Library/Developer/Xcode/DerivedData/Sample-haasvciuwqzzcociidumavsvdwoo/Build/Intermediates/Sample.build/Debug-iphonesimulator/SampleTests.build/SampleTests.hmap
write-file /Users/wangmy/Library/Developer/Xcode/DerivedData/Sample-haasvciuwqzzcociidumavsvdwoo/Build/Intermediates/Sample.build/Debug-iphonesimulator/SampleTests.build/SampleTests-all-non-framework-target-headers.hmap
/bin/mkdir -p /Users/wangmy/Library/Developer/Xcode/DerivedData/Sample-haasvciuwqzzcociidumavsvdwoo/Build/Intermediates/Sample.build/Debug-iphonesimulator/SampleTests.build/Objects-normal/i386
write-file /Users/wangmy/Library/Developer/Xcode/DerivedData/Sample-haasvciuwqzzcociidumavsvdwoo/Build/Intermediates/Sample.build/Debug-iphonesimulator/SampleTests.build/Objects-normal/i386/SampleTests.LinkFileList
--------------------------------------------------------------------------------
      ~ Create product structure (0 ms)
--------------------------------------------------------------------------------
/bin/mkdir -p /Users/wangmy/Library/Developer/Xcode/DerivedData/Sample-haasvciuwqzzcociidumavsvdwoo/Build/Products/Debug-iphonesimulator/SampleTests.xctest
--------------------------------------------------------------------------------
      ~ Process Info.plist (3 ms)
      ~ Compile CSSTests.mm (1461 ms)
      ~ Compile HistoryManageTests.mm (1002 ms)
      ~ Compile RenderTests.mm (1260 ms)
      ~ Compile ERTLuaCoreUnitTests.mm (616 ms)
      ~ Compile ERTCoreTests.mm (346 ms)
      ~ Link SampleTests (30 ms)
      ~ Generate SampleTests.xctest.dSYM (53 ms)
      ~ Touch SampleTests.xctest (2 ms)
      0 errored, 1 warning (1566 ms)


  [Info] Collecting info for testables... (1584 ms)
  run-test SampleTests.xctest (iphonesimulator8.0, application-test)
    [Warning] Tried to install the test host app 'net.light.sample' but failed. (63 ms)
    [Info] Preparing test environment failed; will retry 2 more times (0 ms)
    [Info] Verified iOS Simulators... (0 ms)
    [Info] Shut down iOS Simulator... (0 ms)
    [Info] Stopped any existing iOS simulator jobs to get a fresh simulator. (123 ms)
    [Info] Reset iOS simulator content and settings at path "/Users/wangmy/Library/Developer/CoreSimulator/Devices/2EE9285F-1031-4A63-BE94-F1395C79C083/data" (541 ms)
    [Warning] Tried to install the test host app 'net.light.sample' but failed. (15 ms)
    [Info] Preparing test environment failed; will retry 1 more time (0 ms)
    [Info] Verified iOS Simulators... (0 ms)
    [Info] Shut down iOS Simulator... (0 ms)
    [Info] Stopped any existing iOS simulator jobs to get a fresh simulator. (128 ms)
    [Info] Reset iOS simulator content and settings at path "/Users/wangmy/Library/Developer/CoreSimulator/Devices/2EE9285F-1031-4A63-BE94-F1395C79C083/data" (592 ms)
    [Warning] Tried to install the test host app 'net.light.sample' but failed. (15 ms)
    [Warning] Preparing test environment failed. (0 ms)
      -[TEST_BUNDLE FAILED_TO_START]
--------------------------------------------------------------------------------
There was a problem starting the test bundle: Simulator 'iPhone 4s' was not prepared: Failed for unknown reason.
----|---------------------------------------------------------------------------
    X -[TEST_BUNDLE FAILED_TO_START] (0 ms) (0)
      -[CSSTests testCSSCreate]
--------------------------------------------------------------------------------
Test did not run: Simulator 'iPhone 4s' was not prepared: Failed for unknown reason.
----|---------------------------------------------------------------------------
    X -[CSSTests testCSSCreate] (0 ms) (1)
      -[CSSTests testCSSParser]
--------------------------------------------------------------------------------
Test did not run: Simulator 'iPhone 4s' was not prepared: Failed for unknown reason.
----|---------------------------------------------------------------------------
    X -[CSSTests testCSSParser] (0 ms) (2)
      -[CSSTests testColorParser]
--------------------------------------------------------------------------------
Test did not run: Simulator 'iPhone 4s' was not prepared: Failed for unknown reason.
----|---------------------------------------------------------------------------
    X -[CSSTests testColorParser] (0 ms) (3)
      -[CSSTests testPerformanceExample]
--------------------------------------------------------------------------------
Test did not run: Simulator 'iPhone 4s' was not prepared: Failed for unknown reason.
----|---------------------------------------------------------------------------
    X -[CSSTests testPerformanceExample] (0 ms) (4)
      -[ERTCoreTests testExample]
--------------------------------------------------------------------------------
Test did not run: Simulator 'iPhone 4s' was not prepared: Failed for unknown reason.
----|---------------------------------------------------------------------------
    X -[ERTCoreTests testExample] (0 ms) (5)
      -[ERTCoreTests testPerformanceExample]
--------------------------------------------------------------------------------
Test did not run: Simulator 'iPhone 4s' was not prepared: Failed for unknown reason.
----|---------------------------------------------------------------------------
    X -[ERTCoreTests testPerformanceExample] (0 ms) (6)
      -[HistoryManageTests testHistoryManage]
--------------------------------------------------------------------------------
Test did not run: Simulator 'iPhone 4s' was not prepared: Failed for unknown reason.
----|---------------------------------------------------------------------------
    X -[HistoryManageTests testHistoryManage] (0 ms) (7)
      -[RenderTests testCreateRender]
--------------------------------------------------------------------------------
Test did not run: Simulator 'iPhone 4s' was not prepared: Failed for unknown reason.
----|---------------------------------------------------------------------------
    X -[RenderTests testCreateRender] (0 ms) (8)
      -[RenderTests testPerformanceExample]
--------------------------------------------------------------------------------
Test did not run: Simulator 'iPhone 4s' was not prepared: Failed for unknown reason.
----|---------------------------------------------------------------------------
    X -[RenderTests testPerformanceExample] (0 ms) (9)
      -[RenderTests testRenderTree]
--------------------------------------------------------------------------------
Test did not run: Simulator 'iPhone 4s' was not prepared: Failed for unknown reason.
----|---------------------------------------------------------------------------
    X -[RenderTests testRenderTree] (0 ms) (10)
      -[RenderTests testSetInnerHtml]
--------------------------------------------------------------------------------
Test did not run: Simulator 'iPhone 4s' was not prepared: Failed for unknown reason.
----|---------------------------------------------------------------------------
    X -[RenderTests testSetInnerHtml] (0 ms) (11)
    0 passed, 0 failed, 12 errored, 12 total (1 ms)


Failures:

  0) -[TEST_BUNDLE FAILED_TO_START] (SampleTests.xctest)
--------------------------------------------------------------------------------
There was a problem starting the test bundle: Simulator 'iPhone 4s' was not prepared: Failed for unknown reason.
--------------------------------------------------------------------------------

  1) -[CSSTests testCSSCreate] (SampleTests.xctest)
--------------------------------------------------------------------------------
Test did not run: Simulator 'iPhone 4s' was not prepared: Failed for unknown reason.
--------------------------------------------------------------------------------

  2) -[CSSTests testCSSParser] (SampleTests.xctest)
--------------------------------------------------------------------------------
Test did not run: Simulator 'iPhone 4s' was not prepared: Failed for unknown reason.
--------------------------------------------------------------------------------

  3) -[CSSTests testColorParser] (SampleTests.xctest)
--------------------------------------------------------------------------------
Test did not run: Simulator 'iPhone 4s' was not prepared: Failed for unknown reason.
--------------------------------------------------------------------------------

  4) -[CSSTests testPerformanceExample] (SampleTests.xctest)
--------------------------------------------------------------------------------
Test did not run: Simulator 'iPhone 4s' was not prepared: Failed for unknown reason.
--------------------------------------------------------------------------------

  5) -[ERTCoreTests testExample] (SampleTests.xctest)
--------------------------------------------------------------------------------
Test did not run: Simulator 'iPhone 4s' was not prepared: Failed for unknown reason.
--------------------------------------------------------------------------------

  6) -[ERTCoreTests testPerformanceExample] (SampleTests.xctest)
--------------------------------------------------------------------------------
Test did not run: Simulator 'iPhone 4s' was not prepared: Failed for unknown reason.
--------------------------------------------------------------------------------

  7) -[HistoryManageTests testHistoryManage] (SampleTests.xctest)
--------------------------------------------------------------------------------
Test did not run: Simulator 'iPhone 4s' was not prepared: Failed for unknown reason.
--------------------------------------------------------------------------------

  8) -[RenderTests testCreateRender] (SampleTests.xctest)
--------------------------------------------------------------------------------
Test did not run: Simulator 'iPhone 4s' was not prepared: Failed for unknown reason.
--------------------------------------------------------------------------------

  9) -[RenderTests testPerformanceExample] (SampleTests.xctest)
--------------------------------------------------------------------------------
Test did not run: Simulator 'iPhone 4s' was not prepared: Failed for unknown reason.
--------------------------------------------------------------------------------

  10) -[RenderTests testRenderTree] (SampleTests.xctest)
--------------------------------------------------------------------------------
Test did not run: Simulator 'iPhone 4s' was not prepared: Failed for unknown reason.
--------------------------------------------------------------------------------

  11) -[RenderTests testSetInnerHtml] (SampleTests.xctest)
--------------------------------------------------------------------------------
Test did not run: Simulator 'iPhone 4s' was not prepared: Failed for unknown reason.
--------------------------------------------------------------------------------

** TEST FAILED: 0 passed, 0 failed, 12 errored, 12 total ** (77259 ms)

ios jenkins-ci xctool

坏坏的男孩 11 years, 8 months ago

Your Answer