2018-10-03 15:12:29 +00:00
|
|
|
dist: xenial
|
2017-02-16 11:37:54 +00:00
|
|
|
sudo: required
|
|
|
|
|
2014-09-21 14:37:29 +00:00
|
|
|
language: python
|
|
|
|
python:
|
2019-05-22 13:14:44 +00:00
|
|
|
# Travis Xenial Python to support system_site_packages
|
2018-10-25 14:02:53 +00:00
|
|
|
- 3.5
|
2016-05-21 17:53:40 +00:00
|
|
|
cache: pip
|
2018-10-10 13:49:39 +00:00
|
|
|
virtualenv:
|
|
|
|
system_site_packages: true
|
|
|
|
|
|
|
|
env:
|
|
|
|
global:
|
|
|
|
- DISPLAY=:99.0
|
2016-05-21 17:53:40 +00:00
|
|
|
|
2019-05-22 11:12:46 +00:00
|
|
|
git:
|
|
|
|
# Set greater depth to get version from tags.
|
|
|
|
depth: 1000
|
|
|
|
|
2018-10-10 13:49:39 +00:00
|
|
|
matrix:
|
|
|
|
include:
|
2019-05-27 14:21:05 +00:00
|
|
|
- name: Unit tests
|
2018-10-10 13:49:39 +00:00
|
|
|
env: TOX_ENV=py3
|
2019-05-27 14:21:05 +00:00
|
|
|
- name: Unit tests (libtorrent 1.2)
|
|
|
|
env: TOX_ENV=py3
|
|
|
|
addons:
|
|
|
|
apt:
|
|
|
|
sources: [sourceline: "ppa:libtorrent.org/1.2-daily"]
|
|
|
|
packages: [python3-libtorrent, python3-venv]
|
2018-10-10 13:49:39 +00:00
|
|
|
- if: commit_message =~ SECURITY_TEST
|
|
|
|
env: TOX_ENV=security
|
|
|
|
- name: Code linting
|
|
|
|
env: TOX_ENV=lint
|
|
|
|
- name: Docs build
|
|
|
|
env: TOX_ENV=docs
|
2018-10-25 14:02:53 +00:00
|
|
|
- name: GTK unit tests
|
|
|
|
env: TOX_ENV=gtkui
|
2018-10-10 13:49:39 +00:00
|
|
|
- name: Plugins unit tests
|
|
|
|
env: TOX_ENV=plugins
|
2014-09-21 14:37:29 +00:00
|
|
|
|
2018-10-05 14:33:26 +00:00
|
|
|
addons:
|
|
|
|
apt:
|
|
|
|
sources:
|
2019-05-27 14:21:05 +00:00
|
|
|
- sourceline: "ppa:libtorrent.org/rc-1.1-daily"
|
2018-10-05 14:33:26 +00:00
|
|
|
- deadsnakes
|
|
|
|
packages:
|
2018-10-10 13:49:39 +00:00
|
|
|
- python3-libtorrent
|
|
|
|
# Install py36 specifically for pre-commit to run black formatter.
|
2018-10-05 14:33:26 +00:00
|
|
|
- python3.6
|
2018-10-10 13:49:39 +00:00
|
|
|
# Intall python3-venv to provide ensurepip module for tox.
|
2018-10-08 15:05:40 +00:00
|
|
|
- python3-venv
|
2018-10-05 14:33:26 +00:00
|
|
|
|
2018-10-10 13:49:39 +00:00
|
|
|
# Install dependencies
|
2014-10-13 14:57:46 +00:00
|
|
|
install:
|
2018-10-03 15:12:29 +00:00
|
|
|
- pip install tox tox-venv
|
2019-05-21 14:48:43 +00:00
|
|
|
# GTKUI tests
|
2018-10-25 14:02:53 +00:00
|
|
|
- "if [ $TOX_ENV == 'gtkui' ]; then
|
2019-05-22 13:14:44 +00:00
|
|
|
sudo apt install python3-gi python3-gi-cairo gir1.2-gtk-3.0;
|
2018-10-10 13:49:39 +00:00
|
|
|
fi"
|
2019-05-21 14:48:43 +00:00
|
|
|
# Security tests
|
2018-10-03 15:12:29 +00:00
|
|
|
- "if [ $TOX_ENV == 'security' ]; then
|
|
|
|
testssl_url=https://github.com/drwetter/testssl.sh/archive/v2.9.5-5.tar.gz;
|
|
|
|
wget -O- $testssl_url | tar xz
|
|
|
|
&& mv -t deluge/tests/data testssl.sh-2.9.5-5/testssl.sh testssl.sh-2.9.5-5/etc/;
|
|
|
|
fi"
|
2014-09-21 14:37:29 +00:00
|
|
|
|
|
|
|
before_script:
|
|
|
|
- export PYTHONPATH=$PYTHONPATH:$PWD
|
2019-05-21 14:48:43 +00:00
|
|
|
# Verify libtorrent installed and version
|
2018-10-08 15:05:40 +00:00
|
|
|
- python -c "import libtorrent as lt; print(lt.__version__)"
|
2018-10-10 13:49:39 +00:00
|
|
|
# Start xvfb for the GTKUI tests
|
2018-10-25 14:02:53 +00:00
|
|
|
- "if [ $TOX_ENV == 'gtkui' ]; then
|
2018-10-10 13:49:39 +00:00
|
|
|
/sbin/start-stop-daemon --start --quiet --background \
|
|
|
|
--make-pidfile --pidfile /tmp/custom_xvfb_99.pid \
|
|
|
|
--exec /usr/bin/Xvfb -- :99 -ac -screen 0 1280x1024x16;
|
|
|
|
fi"
|
2014-09-21 14:37:29 +00:00
|
|
|
|
|
|
|
script:
|
|
|
|
- tox -e $TOX_ENV
|