Skip to content

Commit c0398e0

Browse files
authored
Add DISPLAY variable
1 parent cb9aebd commit c0398e0

File tree

1 file changed

+19
-9
lines changed

1 file changed

+19
-9
lines changed

docs/troubleshooting.rst

Lines changed: 19 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -127,15 +127,25 @@ And here is a working Qt6 Azure Pipelines CI/CD config for ``ubuntu-latest`` :
127127

128128
.. code-block:: yaml
129129
130-
# this was tested with ``ubuntu-latest`` image
131-
- script: |
132-
sudo apt update
133-
sudo apt-get install -y xvfb libxkbcommon-x11-0 libxcb-icccm4 libxcb-image0 libxcb-keysyms1 libxcb-randr0 libxcb-render-util0 libxcb-xinerama0 libxcb-xinput0 libxcb-xfixes0 libxcb-shape0 libglib2.0-0 libgl1-mesa-dev
134-
sudo apt-get install -y '^libxcb.*-dev' libx11-xcb-dev libglu1-mesa-dev libxrender-dev libxi-dev libxkbcommon-dev libxkbcommon-x11-dev
135-
sudo apt-get install -y x11-utils
136-
/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
137-
displayName: 'Install and start xvfb and other dependencies on Linux for Qt GUI tests'
138-
condition: and(succeededOrFailed(), eq(variables['Agent.OS'], 'Linux'))
130+
# Set these environment variables for the job that runs tests
131+
132+
variables:
133+
DISPLAY: ':99.0' # This is needed for pytest-qt not to crash as mentioned above
134+
# Python fault handler is enabled in case UI tests crash without meaningful error messages
135+
PYTHONFAULTHANDLER: 'enabled' # https://docs.python.org/3/library/faulthandler.html
136+
137+
# Add this step to your CI pipeline before running your pytest-qt-based Qt6 tests with pytest
138+
139+
# this was tested with ``ubuntu-latest`` image
140+
- script: |
141+
sudo apt update
142+
sudo apt-get install -y xvfb libxkbcommon-x11-0 libxcb-icccm4 libxcb-image0 libxcb-keysyms1 libxcb-randr0 libxcb-render-util0 libxcb-xinerama0 libxcb-xinput0 libxcb-xfixes0 libxcb-shape0 libglib2.0-0 libgl1-mesa-dev
143+
sudo apt-get install -y '^libxcb.*-dev' libx11-xcb-dev libglu1-mesa-dev libxrender-dev libxi-dev libxkbcommon-dev libxkbcommon-x11-dev
144+
sudo apt-get install -y x11-utils
145+
/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
146+
displayName: 'Install and start xvfb and other dependencies on Linux for Qt GUI tests'
147+
condition: and(succeededOrFailed(), eq(variables['Agent.OS'], 'Linux'))
148+
139149
# After this step, assuming you have ``pytest-qt`` installed, just run ``pytest`` and your PyQt6 tests will work
140150
141151

0 commit comments

Comments
 (0)