通过JNLP使用Jenkins时

通过JNLP使用Jenkins时

本文介绍了通过JNLP使用Jenkins时,iOS测试不会在模拟器上运行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在尝试让xcodebuild测试在使用Jenkins的远程计算机上工作.我遇到了无法通过SSH启动GUI的错误,并通过JNLP启动从站来解决它,如下所示:通过SSH在Xcode 6下运行xcodebuild测试时超时.现在我遇到了一个新错误:

I have been trying to get xcodebuild tests to work on a remote machine using Jenkins. I ran into the error of not being able to launch a GUI through SSH and solved it by launching a slave through JNLP as suggested here:Timeout when running xcodebuild tests under Xcode 6 via SSH.Now I'm getting a new error:

Error Domain = IDEUnitTestsOperationsObserverErrorDomain代码= 3由于等待测试过程中的登录超时而取消测试..."

Error Domain=IDEUnitTestsOperationsObserverErrorDomain Code=3 "Canceling tests due to timeout in Waiting for test process to check in..."

无论是在终端机上还是通过Jenkins成功构建并运行测试,我都会遇到这些错误:

I also get these errors whether I successfully build and run the tests on the terminal or through Jenkins:

iPhoneSimulator:无法连接到"com.apple.instruments.deviceservice.lockdown"(错误域= com.apple.Core.SimError.SimError代码= 146无法在当前状态下查找:关机"

iPhoneSimulator: Unable to connect to "com.apple.instruments.deviceservice.lockdown" (Error Domain=com.apple.CoreSimulator.SimError Code=146 "Unable to lookup in current state: Shutdown"

我已经确保在安装XCode的地方启用了所有权,已经重置了模拟器上的内容和设置,并且已经将plist文件移动到了/Library/LaunchAgents中.我已经尝试使用Google搜索这些错误,但找不到与我的问题有关的任何内容.有人还有其他建议吗?

I've made sure ownership is enabled where XCode is installed, I've reset the content and settings on the simulator, and I've moved my plist file into /Library/LaunchAgents. I've tried Googling these errors and could not find anything that seems to relate to my issue. Does anyone have any other suggestions?

其他信息:

XCode版本6.2(6C131e)

XCode Version 6.2 (6C131e)

日志文件:

2015-03-24 12:14:10.719 Beginning test session with Xcode 6C131e
2015-03-24 12:14:10.720 /Applications/Xcode.app/Contents/Developer/usr/bin/xcodebuild test -project proj.xcodeproj -scheme development -destination platform=iOS Simulator,name=iPad Air
2015-03-24 12:14:10.720 Testing on device: <DVTiPhoneSimulator: 0x7f8235cb3570> {SimDevice: SimDevice : iPad Air (625C9344-19B9-4F6C-B70B-8BDD3B753E17) : state={ Booted } deviceType={ SimDeviceType : com.apple.CoreSimulator.SimDeviceType.iPad-Air } runtime={ SimRuntime : 8.2 (12D508) - com.apple.CoreSimulator.SimRuntime.iOS-8-2 }}
2015-03-24 12:14:10.720 Writing testing status log to /var/folders/mx/9d2jm4sj6t54sld_9cj1bgz40000gn/T/com.apple.dt.XCTest-status/Session-2015-03-24_12:14:10-QR746X.log.
2015-03-24 12:14:10.720 Initializing test infrastructure.
2015-03-24 12:14:10.749 Creating the connection.
2015-03-24 12:14:10.749 Listening for proxy connection request from the test bundle (all platforms)
2015-03-24 12:14:10.749 Resuming the connection.
2015-03-24 12:14:10.749 Test connection requires daemon assistance.
2015-03-24 12:14:10.933 Checking test manager availability..., will wait up to 120s
2015-03-24 12:14:10.936 testmanagerd handled session request.
2015-03-24 12:14:10.936 Waiting for test process to launch.
2015-03-24 12:14:15.951 Launch session started, setting a disallow-finish-token on the run operation.
2015-03-24 12:14:15.952 Waiting for test process to check in..., will wait up to 120s
2015-03-24 12:14:15.979 Adding console adaptor for test process.
2015-03-24 12:16:15.956 Unable to get debug console for logging target process thread state.
2015-03-24 12:16:15.956 Test operation failure: Canceling tests due to timeout in Waiting for test process to check in...
2015-03-24 12:16:15.956 _finishWithError:Error Domain=IDEUnitTestsOperationsObserverErrorDomain Code=3 "Canceling tests due to timeout in Waiting for test process to check in..." UserInfo=0x7f8231c1dff0 {NSLocalizedDescription=Canceling tests due to timeout in Waiting for test process to check in...} didCancel: 1

推荐答案

我仍然看到错误消息,但是我能够让Jenkins运行我的单元测试.以下是对我有用的步骤:

I still see the error messages, but I was able to get Jenkins to run my unit tests. Here are the steps that worked for me:

  1. 重新启动远程计算机
  2. 从Finder启动Xcode应用程序
  3. 退出Xcode
  4. 运行Jenkins测试脚本

这篇关于通过JNLP使用Jenkins时,iOS测试不会在模拟器上运行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!