[Tests] Fix Xvfb for GTKUI tests running on TravisCI

This commit is contained in:
bendikro 2015-07-15 22:17:36 +02:00 committed by Calum Lind
commit 379ba33bb9
2 changed files with 8 additions and 9 deletions

View file

@ -3,11 +3,6 @@ language: python
python: python:
- "2.7" - "2.7"
# Cache packages download with apt
cache:
directories:
- $HOME/.pip-cache/
before_install: before_install:
- lsb_release -a - lsb_release -a
- sudo add-apt-repository ppa:deluge-team/ppa -y - sudo add-apt-repository ppa:deluge-team/ppa -y
@ -17,13 +12,14 @@ before_install:
install: install:
- bash -c "echo $APTPACKAGES" - bash -c "echo $APTPACKAGES"
- sudo apt-get install $APTPACKAGES - sudo apt-get install $APTPACKAGES
- pip install "tox>=1.8" --download-cache $HOME/.pip-cache - pip install "tox>=1.8"
env: env:
global: global:
- PIP_DOWNLOAD_CACHE=$HOME/.pip-cache/ - PIP_DOWNLOAD_CACHE=$HOME/.pip-cache/
- APTPACKAGES="python-libtorrent" - APTPACKAGES="python-libtorrent"
- APTPACKAGES_GTKUI="python-gobject python-glade2" - APTPACKAGES_GTKUI="python-gobject python-glade2"
- DISPLAY=:99.0
matrix: matrix:
- TOX_ENV=pydef - TOX_ENV=pydef
- TOX_ENV=flake8 - TOX_ENV=flake8
@ -43,8 +39,8 @@ virtualenv:
before_script: before_script:
- export PYTHONPATH=$PYTHONPATH:$PWD - export PYTHONPATH=$PYTHONPATH:$PWD
- python -c "import libtorrent as lt; print lt.version" - python -c "import libtorrent as lt; print lt.version"
- export DISPLAY=:99.0 - "/sbin/start-stop-daemon --start --quiet --pidfile /tmp/custom_xvfb_99.pid --make-pidfile --background --exec /usr/bin/Xvfb -- :99 -ac -screen 0 1280x1024x16"
- sh -e /etc/init.d/xvfb start
script: script:
- bash -c "echo $DISPLAY"
- tox -e $TOX_ENV - tox -e $TOX_ENV

View file

@ -14,6 +14,7 @@ envlist = py27, flake8, isort, docs
minversion=1.8 minversion=1.8
[testenv] [testenv]
passenv = DISPLAY
setenv = PYTHONPATH = {env:PWD}: setenv = PYTHONPATH = {env:PWD}:
sitepackages = True sitepackages = True
deps = deps =
@ -81,7 +82,9 @@ deps =
whitelist_externals = whitelist_externals =
{[testenv]whitelist_externals} {[testenv]whitelist_externals}
isort isort
commands = python -c "import subprocess, sys; output = subprocess.check_output('isort --stdout --diff --recursive deluge docs win32 *.py', shell=True); print output; sys.exit(len(output) != 0)" commands =
isort --version
python -c "import subprocess, sys; output = subprocess.check_output('isort --diff --recursive deluge docs win32 *.py', shell=True); print output; sys.exit(len(output) != 0)"
[testenv:flake8] [testenv:flake8]
setenv = {[testenv]setenv} setenv = {[testenv]setenv}