Skip to content

Commit cede1e1

Browse files
authored
[3.7] Enable GUI testing on Travis Linux builds via Xvfb (GH-7887)
(cherry picked from commit b12112b)
1 parent 339e0c1 commit cede1e1

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

.travis.yml

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,10 @@ matrix:
4040
# compiler here and the other to run the coverage build. Clang is preferred
4141
# in this instance for its better error messages.
4242
env: TESTING=cpython
43+
addons:
44+
apt:
45+
packages:
46+
- xvfb
4347
- os: linux
4448
language: python
4549
# Build the docs against a stable version of Python so code bugs don't hold up doc-related PRs.
@@ -56,6 +60,10 @@ matrix:
5660
language: c
5761
compiler: gcc
5862
env: OPTIONAL=true
63+
addons:
64+
apt:
65+
packages:
66+
- xvfb
5967
before_script:
6068
- ./configure
6169
- make -s -j4
@@ -65,7 +73,7 @@ matrix:
6573
- ./venv/bin/python -m test.pythoninfo
6674
script:
6775
# Skip tests that re-run the entire test suite.
68-
- ./venv/bin/python -m coverage run --pylib -m test --fail-env-changed -uall,-cpu -x test_multiprocessing_fork -x test_multiprocessing_forkserver -x test_multiprocessing_spawn -x test_concurrent_futures
76+
- xvfb-run ./venv/bin/python -m coverage run --pylib -m test --fail-env-changed -uall,-cpu -x test_multiprocessing_fork -x test_multiprocessing_forkserver -x test_multiprocessing_spawn -x test_concurrent_futures
6977
after_script: # Probably should be after_success once test suite updated to run under coverage.py.
7078
# Make the `coverage` command available to Codecov w/ a version of Python that can parse all source files.
7179
- source ./venv/bin/activate
@@ -135,7 +143,7 @@ script:
135143
# Check that all symbols exported by libpython start with "Py" or "_Py"
136144
- make smelly
137145
# `-r -w` implicitly provided through `make buildbottest`.
138-
- make buildbottest TESTOPTS="-j4 -uall,-cpu"
146+
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then XVFB_RUN=xvfb-run; fi; $XVFB_RUN make buildbottest TESTOPTS="-j4 -uall,-cpu"
139147

140148
notifications:
141149
email: false

0 commit comments

Comments
 (0)