如何在OSX Lion for Maven项目上使用xvnc配置jenkins [英] How to configure jenkins with xvnc on OSX Lion for maven project

查看:153
本文介绍了如何在OSX Lion for Maven项目上使用xvnc配置jenkins的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

jenkins作业运行时,我得到以下输出:

When the jenkins job runs I get this output:

...

启动xvnc

[workspace] $ /Applications/VNCServer.app/OSXvnc-server -rfbauth /Applications/VNCServer.app/pass.word :11 -geometry 800x600

2012-02-08 22:04:05.375 OSXvnc-server[3412:707] Arguments: -rfbauth /Applications/VNCServer.app/pass.word :11 -geometry 800x600 

2012-02-08 22:04:05.394 OSXvnc-server[3412:707] Main Bundle: /Applications/VNCServer.app
[workspace] $ /bin/sh -xe /var/folders/5d/jp_23pvd3bq5331x7myfcrym0000gq/T/hudson487661983531354780.sh

2012-02-08 22:04:05.425 OSXvnc-server[3412:707] Loading Bundle /Applications/VNCServer.app/Contents/Resources/TigerBundle.bundle

Parsing POMs
2012-02-08 22:04:05.441 OSXvnc-server[3412:707] Loading Bundle /Applications/VNCServer.app/Contents/Resources/JaguarBundle.bundle

2012-02-08 22:04:05.447 OSXvnc-server[3412:707] Running in Little Endian

2012-02-08 22:04:05.448 OSXvnc-server[3412:707] Pasteboard Inaccessible - Pasteboard sharing disabled

2012-02-08 22:04:05.449 OSXvnc-server[3412:707] Waiting for clients

2012-02-08 22:04:05.449 OSXvnc-server[3412:2c03] Using Private Event Source

2012-02-08 22:04:05.450 OSXvnc-server[3412:2c03] No Event Source -- Using 10.3 API

2012-02-08 22:04:05.451 OSXvnc-server[3412:2c03] Using Dynamic Event Tap -- HID for console user

2012-02-08 22:04:05.452 OSXvnc-server[3412:2c03] Registering Bonjour Service(_rfb._tcp.) - jjmacbook.local

2012-02-08 22:04:05.452 OSXvnc-server[3412:3503] IPv6: Started Listener Thread on port 5901

2012-02-08 22:04:05.453 OSXvnc-server[3412:2c03] Started Listener Thread on port 5901

[workspace] $ /Library/Java/Home//bin/java -cp /Users/jenkins/.jenkins/plugins/maven-plugin/WEB-INF/lib/maven3-agent-1.2.jar:/Users/jenkins/.jenkins/tools/Maven/boot/plexus-classworlds-2.4.jar org.jvnet.hudson.maven3.agent.Maven3Main 

/Users/jenkins/.jenkins/tools/Maven /Users/jenkins/.jenkins/war/WEB-INF/lib/remoting-2.9.jar /Users/jenkins/.jenkins/plugins/maven-plugin/WEB-INF/lib/maven3-interceptor-1.2.jar 50302

<===[JENKINS REMOTING CAPACITY]===>channel started

Executing Maven:  -B -f /Users/jenkins/.jenkins/jobs/chess-svg/workspace/pom.xml clean install

但是自动UI测试仍然在我的屏幕上弹出他们的窗口.

However the automated UI tests still pops up their windows on my screen.

使用的vncserver是 http://sourceforge.net/projects/osxvnc/

The vncserver used is http://sourceforge.net/projects/osxvnc/

推荐答案

我遇到了同样的问题,我认为这实际上是不可能的.

I'm hitting the same sort of problem, and I think it may actually be impossible.

问题是OSX上运行的Firefox/Chrome版本适用于OSX,而​​不是普通" X11-因此,即使您运行X11服务器并使用xvfb/xvnc/并传递DISPLAY =:123 ,Firefox/Chrome不在乎,因为它们不是基于X的,而是基于Carbon/Cocoa的.

The problem is that the versions of Firefox/Chrome that run on OSX are for OSX, not "plain" X11 -- so even if you run the X11 server and use xvfb / xvnc / whatever and pass in DISPLAY=:123, Firefox/Chrome don't care, because they're not X-based, they're Carbon/Cocoa-based.

您可以自己确认以下内容:

You can confirm this yourself as follows:

  1. 运行X11服务器(通过Spotlight)
  2. 在新的xterm中,键入"xhost +"(请确保输入)
  3. xvfb -br -screen 0 1280x1024x24:123123&
  4. 现在您在显示屏123123上有了一个新的帧缓冲区-在那运行一个xterm:
  5. DISPLAY =:123123 xterm&
  6. 主屏幕上什么都没有出现,因为该新xterm位于后台.检查它是否存在:
  7. xlsclients -display:123123
  8. 您将看到一个条目,即您在其中生成的xterm.
  9. 现在使用浏览器尝试一下:
  10. DISPLAY =:123123/Applications/Firefox.app/Contents/MacOS/firefox
  11. ...,并且Firefox仍显示在您的主屏幕上.

  1. Run X11 server (from spotlight)
  2. in the new xterm, type "xhost +" (just to make sure)
  3. xvfb -br -screen 0 1280x1024x24 :123123 &
  4. Now you have a new framebuffer on display 123123 -- run an xterm on there:
  5. DISPLAY=:123123 xterm &
  6. Nothing appeared on your main screen, because that new xterm, is in the background. Check it's there:
  7. xlsclients -display :123123
  8. You'll see one entry, the xterm you spawned on there.
  9. Now try it with a browser:
  10. DISPLAY=:123123 /Applications/Firefox.app/Contents/MacOS/firefox
  11. ...and Firefox still shows up on your main screen.

您可以通过其他方法进行检查-如果您执行"DISPLAY =:123123 xcalc",则xcalc将不会出现在主屏幕上,但是它将显示在xlsclients的事物列表中,因为它是X-基于.

You can check this with other things -- if you do "DISPLAY=:123123 xcalc", xcalc won't appear on the main screen, but it will show up in the list of things from xlsclients, because it's X-based.

但是,如果您尝试"DISPLAY =:123123/Applications/Calculator/Contents/MacOS/Calculator",则OSX计算器将显示在主屏幕上,因为它不是基于X的.

But if you try "DISPLAY=:123123 /Applications/Calculator/Contents/MacOS/Calculator", the OSX calculator shows up on the main screen, because it's not X-based.

(另一种可能的解决方案是使用硒服务器,但是我们的Web应用程序中断了硒服务器,因此这不是我们的选择-最后,我转而使用基于Windows的Jenkins安装,其中硒和chromedriver可以正常工作从詹金斯(Jenkins)运行时.

(another possible solution is to use selenium server, but our web app breaks selenium server so that's not an option for us -- in the end, I switched to using a Windows-based Jenkins install, where selenium and chromedriver works fine when run from Jenkins).

这篇关于如何在OSX Lion for Maven项目上使用xvnc配置jenkins的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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