From a1e3cb27a7d60bc371308eb89741afc9920b90af Mon Sep 17 00:00:00 2001 From: Alex Pyrgiotis Date: Mon, 24 Jul 2023 13:49:56 +0300 Subject: [PATCH] ci: Pass X11 socket to tests Pass the X11 socket of the Linux CI runners to the container where our CI tests run, with the `-g` flag of `dev_scripts/env.py`. By having a working X11 socket, we can run GUI tests. Prior to this fix, we would encounter this error: tests/gui/test_main_window.py::test_change_document_button 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: xcb, offscreen, wayland-egl, wayland, eglfs, vnc, minimalegl, vkkhrdisplay, linuxfb, minimal. Another alternative we considered was to use the `QT_QPA_PLATFORM=offscreen` environment variable. This alternative works, but it's less close to the end-user's environment, so we decided in favor of the approach above. --- .circleci/config.yml | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 2299dc2..dd08b69 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -178,7 +178,7 @@ jobs: - run: name: Run CI tests command: | - ./dev_scripts/env.py --distro ubuntu --version 23.04 run --dev \ + ./dev_scripts/env.py --distro ubuntu --version 23.04 run -g --dev \ bash -c 'cd dangerzone; poetry run make test' ci-ubuntu-kinetic: @@ -205,7 +205,7 @@ jobs: - run: name: Run CI tests command: | - ./dev_scripts/env.py --distro ubuntu --version 22.10 run --dev \ + ./dev_scripts/env.py --distro ubuntu --version 22.10 run -g --dev \ bash -c 'cd dangerzone; poetry run make test' ci-ubuntu-jammy: @@ -232,7 +232,7 @@ jobs: - run: name: Run CI tests command: | - ./dev_scripts/env.py --distro ubuntu --version 22.04 run --dev \ + ./dev_scripts/env.py --distro ubuntu --version 22.04 run -g --dev \ bash -c 'cd dangerzone; poetry run make test' ci-ubuntu-focal: @@ -259,7 +259,7 @@ jobs: - run: name: Run CI tests command: | - ./dev_scripts/env.py --distro ubuntu --version 20.04 run --dev \ + ./dev_scripts/env.py --distro ubuntu --version 20.04 run -g --dev \ bash -c 'cd dangerzone; poetry run make test' ci-fedora-38: @@ -286,7 +286,7 @@ jobs: - run: name: Run CI tests command: | - ./dev_scripts/env.py --distro fedora --version 38 run --dev \ + ./dev_scripts/env.py --distro fedora --version 38 run -g --dev \ bash -c 'cd dangerzone; poetry run make test' ci-fedora-37: @@ -313,7 +313,7 @@ jobs: - run: name: Run CI tests command: | - ./dev_scripts/env.py --distro fedora --version 37 run --dev \ + ./dev_scripts/env.py --distro fedora --version 37 run -g --dev \ bash -c 'cd dangerzone; poetry run make test' ci-debian-trixie: @@ -340,7 +340,7 @@ jobs: - run: name: Run CI tests command: | - ./dev_scripts/env.py --distro debian --version trixie run --dev \ + ./dev_scripts/env.py --distro debian --version trixie run -g --dev \ bash -c 'cd dangerzone; poetry run make test' ci-debian-bookworm: @@ -367,7 +367,7 @@ jobs: - run: name: Run CI tests command: | - ./dev_scripts/env.py --distro debian --version bookworm run --dev \ + ./dev_scripts/env.py --distro debian --version bookworm run -g --dev \ bash -c 'cd dangerzone; poetry run make test' # NOTE: Making CI tests work in Debian Bullseye requires some tip-toeing @@ -427,7 +427,7 @@ jobs: - run: name: Run CI tests command: | - ./dev_scripts/env.py --distro debian --version bullseye run --dev \ + ./dev_scripts/env.py --distro debian --version bullseye run -g --dev \ bash -c 'cd dangerzone; poetry run make test' build-ubuntu-lunar: