Skip to content

Commit b12112b

Browse files
authored
Enable GUI testing on Travis Linux builds via Xvfb (pythonGH-7887)
1 parent 504373c commit b12112b

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

.travis.yml

+7-2
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.
@@ -70,6 +74,7 @@ matrix:
7074
apt:
7175
packages:
7276
- lcov
77+
- xvfb
7378
before_script:
7479
- ./configure
7580
- make coverage -s -j4
@@ -79,7 +84,7 @@ matrix:
7984
- ./venv/bin/python -m test.pythoninfo
8085
script:
8186
# Skip tests that re-run the entire test suite.
82-
- ./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
87+
- 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
8388
after_script: # Probably should be after_success once test suite updated to run under coverage.py.
8489
# Make the `coverage` command available to Codecov w/ a version of Python that can parse all source files.
8590
- source ./venv/bin/activate
@@ -150,7 +155,7 @@ script:
150155
# Check that all symbols exported by libpython start with "Py" or "_Py"
151156
- make smelly
152157
# `-r -w` implicitly provided through `make buildbottest`.
153-
- make buildbottest TESTOPTS="-j4 -uall,-cpu"
158+
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then XVFB_RUN=xvfb-run; fi; $XVFB_RUN make buildbottest TESTOPTS="-j4 -uall,-cpu"
154159

155160
notifications:
156161
email: false

0 commit comments

Comments
 (0)