forked from buildbot/buildbot
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
184 lines (155 loc) · 6.81 KB
/
.travis.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
# Travis CI configuration file
# http://about.travis-ci.org/docs/
addons:
postgresql: "9.4"
apt_packages:
- enchant
- aspell
- aspell-en
- ispell
- iamerican
services:
- mysql
- postgresql
language: python
# Available Python versions:
# http://about.travis-ci.org/docs/user/ci-environment/#Python-VM-images
python:
- "2.7"
env:
# lint, docs and coverage first as they're more likely to find issues
- TWISTED=latest SQLALCHEMY=latest TESTS=lint
- TWISTED=latest SQLALCHEMY=latest TESTS=docs
- TWISTED=latest SQLALCHEMY=latest TESTS=coverage
# add js tests in separate job. Start it early because it is quite long
- TWISTED=latest SQLALCHEMY=latest TESTS=js
- TWISTED=14.0.2 SQLALCHEMY=latest TESTS=trial
- TWISTED=15.4.0 SQLALCHEMY=latest TESTS=trial
- TWISTED=latest SQLALCHEMY=latest TESTS=trial
# Configuration when SQLite database is persistent between running tests
# (by default in other tests in-memory SQLite database is used which is
# recreated for each test).
# Helps to detect issues with incorrect database setup/cleanup in tests.
- TWISTED=latest SQLALCHEMY=latest TESTS=trial BUILDBOT_TEST_DB_URL=sqlite:////tmp/test_db.sqlite
# Configuration that runs tests with real MySQL database
- TWISTED=latest SQLALCHEMY=latest TESTS=trial BUILDBOT_TEST_DB_URL=mysql+mysqldb://[email protected]/bbtest
- TWISTED=latest SQLALCHEMY=latest TESTS=trial BUILDBOT_TEST_DB_URL=mysql+mysqldb://[email protected]/bbtest&storage_engine=InnoDB
# Configuration that runs tests with real PostgreSQL database with pg8000 and psycopg2 drivers
- TWISTED=latest SQLALCHEMY=latest TESTS=trial BUILDBOT_TEST_DB_URL=postgresql+psycopg2:///bbtest?user=postgres
- TWISTED=latest SQLALCHEMY=latest TESTS=trial BUILDBOT_TEST_DB_URL=postgresql+pg8000:///bbtest?user=postgres
# Test different versions of SQLAlchemy
- TWISTED=15.5.0 SQLALCHEMY=0.8.0 TESTS=trial
- TWISTED=15.5.0 SQLALCHEMY=latest TESTS=trial
# Configuration to run `python setup.py test` to check this test runner.
# - TWISTED=latest SQLALCHEMY=latest TESTS=setuppy_test
cache:
directories:
- $HOME/.cache/pip
- www/base/node_modules
- www/codeparameter/node_modules
- www/console_view/node_modules
- www/waterfall_view/node_modules
- www/nestedexample/node_modules
- www/base/libs
- www/codeparameter/libs
- www/console_view/libs
- www/waterfall_view/libs
- www/nestedexample/libs
matrix:
fast_finish: true
include:
# Tests of buildbot-worker on python 2.6
# Specify SQLALCHEMY=latest to avoid errors installing.
- python: "2.6"
env: TWISTED=14.0.2 TESTS=trial_worker SQLALCHEMY=latest
- python: "2.6"
env: TWISTED=15.4.0 TESTS=trial_worker SQLALCHEMY=latest
# python 3 tests
# - python: "3.4"
# env: TWISTED=latest SQLALCHEMY=latest TESTS=py3
# Dependencies installation commands
install:
- pip install -U pip
# codecov is the interface to codecov.io; see after_success
- pip install codecov
- "[ $TWISTED = latest ] || pip install Twisted==$TWISTED"
- "[ $SQLALCHEMY = latest ] || pip install sqlalchemy==$SQLALCHEMY"
# Install MySQL-python for tests that uses real MySQL
# Install psycopg2 and pg8000 for tests that uses real PostgreSQL
- |
[ $TESTS != trial -a $TESTS != coverage -a $TESTS != lint -a $TESTS != js ] || \
pip install -e pkg \
-e master[tls,test] \
-e worker \
MySQL-python \
psycopg2 \
pg8000 \
- |
[ $TESTS != trial_worker ] || \
pip install -e worker
# install buildbot_www from pip in order to run the www tests
- "[ $TESTS != trial -a $TESTS != coverage ] || pip install --pre buildbot_www"
# for python 3 we dont install everything yet..
- |
[ $TESTS != py3 ] || \
pip install -e worker \
future
# Run additional tests only in latest configuration
# Astroid 1.3.0 dropped Python-2.6 spuport
- "[ $TRAVIS_PYTHON_VERSION != 2.7 ] || pip install 'astroid<1.3.0'"
# Note pylint version is pinned because newer versions can't import zope.interface - http://www.logilab.org/92792
# astroid > 1.4 is incompatible with pylint 1.1.0
- "[ $TESTS != lint ] || pip install pylint==1.1.0 'flake8~=2.6.0' astroid==1.3.8"
# Install sphinx so that pylint will be able to import it
- "[ $TESTS != lint ] || pip install sphinx"
# Install docs dependencies for running the tests
- "[ $TESTS != docs ] || pip install -e ./master[docs]"
# Check that Twisted is not installed during previous steps on setuppy_test configuration.
# In setuppy_test all dependencies should be installed by setuptools during tests.
- "[ $TESTS != setuppy_test ] || ! (pip list | grep Twisted)"
# Automatic installation of autobahn during `setup.py test` fails due to:
# https://github.com/pypa/setuptools/issues/500
- "[ $TESTS != setuppy_test ] || pip install autobahn Twisted"
before_script:
# create real MySQL database for tests
- mysql -e 'create database bbtest;'
# create real PostgreSQL database for tests
- psql -c 'create database bbtest;' -U postgres
# Tests running commands
script:
# make frontend_install_tests takes 17 min, so we only do it post submit
- "[ $TESTS != js -o ${TRAVIS_PULL_REQUEST} = false ] || make frontend"
- "[ $TESTS != js -o ${TRAVIS_PULL_REQUEST} != false ] || make frontend_install_tests"
- "[ $TESTS != trial ] || trial --reporter=text --rterrors buildbot.test buildbot_worker.test"
- "[ $TESTS != trial_worker ] || trial --reporter=text --rterrors buildbot_worker.test"
# run tests under coverage for latest only (it's slower..)
- "[ $TESTS != coverage ] || coverage run --rcfile=.coveragerc $(which trial) --reporter=text --rterrors buildbot.test buildbot_worker.test"
# run tests that are know to work on py3
- "[ $TESTS != py3 ] || trial --reporter=text --rterrors buildbot_worker.test"
# Run additional tests in their separate job
- "[ $TESTS != lint ] || make pylint"
- "[ $TESTS != lint ] || make flake8"
- "[ $TESTS != lint ] || isort --check -df `git ls-files |grep '.py$'`"
# Build documentation
- "[ $TESTS != docs ] || make docs"
# Run spell checker on documentation
- "[ $TESTS != docs ] || make -C master/docs SPHINXOPTS=-W spelling"
# Runs Sphinx' external link checker only on post submit build (it is too unstable)
- "[ $TESTS != docs -o ${TRAVIS_PULL_REQUEST} != false ] || make -C master/docs SPHINXOPTS=-q linkcheck"
- "[ $TESTS != setuppy_test ] || (cd master; python setup.py test)"
- "[ $TESTS != setuppy_test ] || (cd worker; python setup.py test)"
notifications:
email: false
after_success:
- "[ $TESTS != coverage ] || codecov"
after_script:
# List installed packages along with their versions.
- "pip list"
sudo: false
branches:
# Only build main-line branches.
only:
- master
- eight
git:
depth: 300