Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Fake X server for testing?

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.

like image 860
Stefano Borini Avatar asked Jan 14 '13 15:01

Stefano Borini


1 Answers

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
like image 144
sharakan Avatar answered Oct 21 '22 15:10

sharakan