From 7e4ea6e681801d551639889ccf86e58ff8014fe2 Mon Sep 17 00:00:00 2001 From: Tomas D'Stefano Date: Tue, 24 Dec 2024 12:39:39 +0000 Subject: [PATCH] Start Xvfb before running tests. Chromium requires a virtual display in headless environments. --- .github/workflows/build-and-deploy.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/build-and-deploy.yml b/.github/workflows/build-and-deploy.yml index 34e1b5c953..f3dcd4003d 100644 --- a/.github/workflows/build-and-deploy.yml +++ b/.github/workflows/build-and-deploy.yml @@ -242,6 +242,9 @@ jobs: docker compose exec -T web /bin/sh -c 'bundle config --local disable_exec_load true' docker compose exec -T web /bin/sh -c 'apk add --no-cache chromium chromium-chromedriver xvfb xauth' docker compose exec -T web /bin/sh -c "echo 'Checking if chromedriver is installed...'; which chromium; which chromedriver; ls -l /usr/bin/chromium; ls -l /usr/bin/chromedriver; chromium --version; chromedriver --version" + # Ensure that xvfb is set up to allow GUI-based apps like Chromium to run headlessly + docker compose exec -T web /bin/sh -c 'Xvfb :99 -ac &' + docker compose exec -T web /bin/sh -c 'export DISPLAY=:99' docker compose exec -T web /bin/sh -c 'bundle exec rake parallel:setup' - name: ${{ matrix.tests }} tests