We have a big suite of Selenium tests. It is running on a remote continuous integration server (Jenkins). Some tests are successfully passing on the local machine but are always failing when running on the server. It was really difficult to find a cause of the failure on a remote server using only logs.
Task/goal: Find a way of graphical monitoring of the tests running process on the remote server.
Short idea & results: We started sharing X display of a remote server over VNC to our local computers. This really helped, because now we can see what is going on with tests when they’re running on the remote machine and it is much easier to fix broken tests.
First of all install:
- x11vnc (on a remote server ) - a Virtual Network Computing (VNC) server program. It allows remote access from a remote client to a computer hosting a X Window session and the x11vnc software, continuously polling the X server's frame buffer for changes
- VNC client (on a local machine) - a program that watches, controls, and interacts with a server. The client controls the server.
Follow the steps below:
- Open your Jenkins project configuration page and make sure that this check-box is checked.
Now Xvfb will start every time our project is building. Run a Jenkins project now.
- Find a number of display on which your Jenkins job is running.
- in command prompt launch to your server via SSH and run a command: ps afx | grep vfb
- you should see something like this (in this case number of display is 2):
- Start x11vnc server on a display which you found in a previous step:
x11vnc -display :<NUMBER_OF_DISPLAY>
- Create an SSH tunnel between your local machine and the server where you tests are running:
- Run VNC client on your local machine, create a new connection. With Chicken of the VNC it looks like this:
Now click on Connect, wait for a while…Woohoo! Now you see what is going on with your tests on a remote machine.