I've written a number of unit tests for a Qt application using QTest which are packaged into a separate executable and can be run from a terminal. Both executables can be compiled and run fine from both my desktop and my Jenkins server.
However, when I try to run these unit tests via a job on Jenkins using SSH, I receive the following error:
qt.qpa.xcb: could not connect to display
qt.qpa.plugin: Could not load the Qt platform plugin "xcb" in "" even though it was found.
This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.
Available platform plugins are: eglfs, linuxfb, minimal, minimalegl, offscreen, vkkhrdisplay, vnc, wayland-egl, wayland, wayland-xcomposite-egl, wayland-xcomposite-glx, xcb.
I assume that this is an issue with SSH not supporting graphical interfaces, but I would assume Qt must have a way of running unit tests over SSH for continuous integration? Or is this not possible? This uses version 6.2.2 of Qt.