Skip to content

Commit

Permalink
.github/workflows/tests.yml: add dependencies for GUI testing
Browse files Browse the repository at this point in the history
According to pytest-qt's documentation [1]:
> It might happen that your tox run finishes abruptly without any useful information, e.g.:
> ...
> pytest-qt needs a DISPLAY to run, otherwise Qt calls abort() and the process crashes immediately.

To mitigate this, I've followed instructions in [2].

[1] https://pytest-qt.readthedocs.io/en/latest/troubleshooting.html#tox-invocationerror-without-further-information
[2] https://pytest-qt.readthedocs.io/en/latest/troubleshooting.html#github-actions-azure-pipelines-travis-ci-and-gitlab-ci-cd
  • Loading branch information
Tomer Shalev committed May 4, 2024
1 parent 38d8eee commit c024563
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ jobs:
os : [ubuntu-latest]
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
fail-fast: false

env:
DISPLAY: ':99.0'
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
Expand All @@ -22,7 +23,8 @@ jobs:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
sudo apt-get install -y libegl1
sudo apt-get install -y libegl1 libxkbcommon-x11-0 libxcb-icccm4 libxcb-image0 libxcb-keysyms1 libxcb-randr0 libxcb-render-util0 libxcb-xinerama0 libxcb-xfixes0 x11-utils
/sbin/start-stop-daemon --start --quiet --pidfile /tmp/custom_xvfb_99.pid --make-pidfile --background --exec /usr/bin/Xvfb -- :99 -screen 0 1920x1200x24 -ac +extension GLX
python -m pip install --upgrade pip
pip install tox tox-gh-actions
- name: Test with tox
Expand Down

0 comments on commit c024563

Please sign in to comment.