问题描述
我们有 Jenkins 的主从配置.我们的 .NET 项目是由在 Windows 上运行的从属 Jenkins 实例构建的.
We have a master-slave configuration for Jenkins. Our .NET project is built by a slave Jenkins instance running on Windows.
有很多 GUI 测试,但它们似乎只有在远程桌面连接 (RDC) 会话打开时才会运行.
There are a bunch of GUI tests, however they only seem to run if there's a remote desktop connection (RDC) session open.
当尝试在没有 RDC 的情况下运行测试时,Jenkins 没有显示任何测试进度.但是,然后我连接到 Slave 的桌面,可以看到启动的应用程序的主窗口,但是 UI 测试框架(白色)无法执行任何操作.
When trying to run the tests with no RDC, Jenkins doesn't show any progress in testing. Then, however, I connect to the Slave's desktop and can see the main window of the application launched, however the UI testing framework (White) cannot perform any actions.
Jenkins slave 通过 Java Web Start 启动.
The Jenkins slave is launched via Java Web Start.
我在几个网站上读到,不幸的是,没有 RDC 会话就无法运行 GUI 测试.
I read on several websites that unfortunately it is not possible to run GUI tests without RDC session.
我只是想确认这是真的,想知道是否有任何解决方法.
I just want to confirm that it is true and wonder if there is any workaround.
推荐答案
你的从机必须在桌面上才能正常运行测试.我们遇到了同样的问题.
Your slave machines have to be at a desktop before the test can run properly. We had the same problem.
解决方案是让测试机器启动并自动登录到桌面.为了确保测试仅在桌面可用后开始,我们添加了一个计划任务,设置为在用户登录时运行,这将通过 Java Web Start 启动 Jenkins 从站.这样,Jenkins 只会在桌面运行时看到从属服务器.之后,一切正常.
Solution was to have the test machine start up and auto-logon to the desktop. To ensure that the test would ONLY start after the desktop was available, we added a scheduled task, set to run at user login, that would launch the Jenkins slave via Java Web Start. That way, Jenkins would only see the slave once the desktop was running. After that, everything worked fine.
这篇关于没有 RDC 的 Windows 和 GUI 测试上的 Jenkins的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!