At work we fully test the GUI components. The problem arises from the fact that, while the testsuite is running, the various components pop up, stealing the focus or making it impossible to continue working. The first thing I thought of was Xnest, but I was wondering if there's a more elegant solution to this problem.
Asked
Active
Viewed 6,190 times
1 Answers
16
I think what you need to do here is have your tests run on a different Display than the one you're working on.
When we moved our TeamCity agents to EC2, we had to figure out a solution to running our UI unit tests on a headless Linux server. I found a way to do it in this blog post, which outlines how to use Xvfb.
For my case, all I had to do was:
yum install xorg-x11-server-Xvfb
Xvfb :100 -ac
to run the server. I added this to my rc.local file on my EC2 agents to start it at machine startup.- Then I added
env.DISPLAY :100
to my TeamCity build configuration

sharakan
- 6,821
- 1
- 34
- 61
-
I tried your solution, but unfortunately my tests crash with segmentation fault. I am using a lot of stuff, in particular Qt and OpenGL. Are you aware of anything that may work on a standard X server, but fail on the Xvfb ? – Stefano Borini Jan 14 '13 at 16:46
-
1@StefanoBorini Unfortunately not. My understanding is that it should act like a 'real' X server, but of course there may be issues with the implementation, as with anything. A quick google did find this bug: https://bugs.launchpad.net/ubuntu/+source/xorg-server/+bug/296230 Note that the workaround was to boot Xvfb with -extension GLX – sharakan Jan 14 '13 at 17:07