postbuild UIAutomation脚本没有在jenkins中运行 [英] postbuild UIAutomation script not running in jenkins

查看:500
本文介绍了postbuild UIAutomation脚本没有在jenkins中运行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试为 iOS项目执行端到端自动化。我的目标是通过附加 UIAutomation 脚本作为后期构建操作来自动执行持续集成过程。
因此,当用户在SVN中检查他的代码并且直到我们获得自动化测试结果时,一切都将自动化。

I am trying to do End-to-End automation for an iOS project. My aim is to automate the continuous integration process with attaching UIAutomation scripts as post build action. So from the time when a user do check his code in SVN and till we get test result of automation, everything will be automated.

Jenkins 安装在我的本地计算机上并在 localhost 上运行。

现在我通过<$自动构建过程c $ c> jenkins 在另一端我准备好了我的shell脚本,它将在构建输出上运行 UIAutomation java脚本。

当我使用我的shell脚本作为后期构建操作时,我在运行instrument命令时遇到错误(在shell脚本中编写),但如果我通过终端手动运行此脚本,那么它可以正常工作。

Jenkins is installed on my local machine and running on localhost.
Now I have automated build process through jenkins and at other end I have my shell script ready which will run UIAutomation java scripts on build output.
When I use my shell script as post build action then I get error in running instrument command(written inside shell script) but if I run this script manually through terminal then it works fine.

instruments[64703:60f] -[NSAlert alertWithError:] called with nil NSError. A generic error message will be displayed, but the user deserves better.
_RegisterApplication(), FAILED TO establish the default connection to the WindowServer, _CGSDefaultConnection() is NULL. Mon Feb  6 13:15:20 inpunml310743 instruments[64703] <Error>: kCGErrorFailure: Set a breakpoint @ CGErrorBreakpoint() to catch errors as they are logged. 2012-02-06 13:15:20.179 instruments[64703:60f] Recording cancelled : At least one target failed to launch; aborting run Instruments Trace Error : Failed to start trace. Build step 'Execute shell' marked build as failure Finished: FAILURE

然后我用sudo尝试了这个命令然后我收到以下错误
sudo:没有tty存在且没有指定askpass程序

then i tried this command with sudo then I got following error sudo: no tty present and no askpass program specified

请告诉我如何运行这些命令成功,只有这一步留在我的任务中。

Please let me know how can I run these commands successful, only this step is left in my task.

推荐答案

Jenkins默认安装为LaunchDaemon,这意味着它没有足够的权限来启动WindowsServer。

Jenkins by default installs as a LaunchDaemon, which means it has insufficient permissions to launch WindowsServer.

您需要将其配置为LaunchAgent:

You’ll need to configure it as a LaunchAgent:

sudo launchctl unload /Library/LaunchDaemons/org.jenkins-ci.plist
sudo mv /Library/LaunchDaemons/org.jenkins-ci.plist /Library/LaunchAgents/org.jenkins-ci.plist

然后以Jenkins身份登录并保持会话开放。

Then login as Jenkins and keep a session open.

如果您不知道Jenkins密码你可以改为:

If you don't know the Jenkins password you can change it with:

sudo passwd jenkins

这篇关于postbuild UIAutomation脚本没有在jenkins中运行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆