forked from buildbot/buildbot
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.bbtravis.yml
188 lines (157 loc) · 6.27 KB
/
.bbtravis.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
185
186
187
188
# BBTravis CI configuration file
services:
- mysql
- postgresql
language: python
# Available Python versions:
# http://about.travis-ci.org/docs/user/ci-environment/#Python-VM-images
python:
- "2.7"
env:
global:
- BUILDBOT_TEST_DB_URL=sqlite://
matrix:
# 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 (TODO does not work yet with our docker image)
#- 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
# Install MySQL-python for tests that uses real MySQL
# Install psycopg2 and pg8000 for tests that uses real PostgreSQL
- |
# pip installs
set -e
[ $TWISTED = latest ] || pip install Twisted==$TWISTED
[ $SQLALCHEMY = latest ] || pip install sqlalchemy==$SQLALCHEMY
[ $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 \
codecov
[ $TESTS != trial_worker ] || pip install -e worker
[ $TESTS != trial -a $TESTS != coverage ] || pip install --pre buildbot_www
[ $TESTS != py3 ] || pip install -e worker future
[ $python != 2.6 ] || pip install 'astroid<1.3.0'
[ $TESTS != lint ] || pip install sphinx 'pylint==1.1.0' 'flake8~=2.6.0' 'astroid==1.3.8'
[ $TESTS != docs ] || pip install -e './master[docs]'
[ $TESTS != setuppy_test ] || ! (pip list | grep Twisted)
[ $TESTS != setuppy_test ] || pip install autobahn Twisted
before_script:
# create real database for tests
- condition: '"mysql" in BUILDBOT_TEST_DB_URL'
cmd: mysql -e 'create database bbtest;'
- condition: '"postgresql" in BUILDBOT_TEST_DB_URL'
cmd: 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
- title: frontend tests
condition: TESTS == "js" and TRAVIS_PULL_REQUEST
cmd: make frontend
- title: full frontend tests
condition: TESTS == "js" and not TRAVIS_PULL_REQUEST
cmd: make frontend_install_tests
- title: master and worker tests
condition: TESTS == "trial"
cmd: trial --reporter=text --rterrors buildbot.test buildbot_worker.test
- title: worker tests
condition: TESTS == "trial_worker"
cmd: trial --reporter=text --rterrors buildbot_worker.test
# run tests under coverage for latest only (it's slower..)
- title: coverage tests
condition: TESTS == "coverage"
cmd: coverage run --rcfile=.coveragerc $(which trial) --reporter=text --rterrors buildbot.test buildbot_worker.test
- title: py3 tests
condition: TESTS == "py3"
cmd: trial --reporter=text --rterrors buildbot_worker.test"
# Run additional tests in their separate job (TODO pylint crashes on our docker image)
# - title: pylint
# condition: TESTS == "lint"
# cmd: make pylint
- title: flake8
condition: TESTS == "lint"
cmd: make flake8
- title: isort
condition: TESTS == "lint"
cmd: isort --check -df `git ls-files |grep '.py$'`
# Build documentation
- title: docs
condition: TESTS == "docs"
cmd: make docs
# Run spell checker on documentation
- title: spelling
condition: TESTS == "docs"
cmd: make -C master/docs SPHINXOPTS=-W spelling
# Runs Sphinx' external link checker only on post submit build (it is too unstable)
- title: linkcheck
condition: TESTS == "docs" and not TRAVIS_PULL_REQUEST
cmd: make -C master/docs SPHINXOPTS=-q linkcheck
notifications:
email: false
after_success:
- |
# codecov
[ $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