forked from mozilla/treeherder
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
178 lines (171 loc) · 7.17 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
env:
global:
- DATABASE_URL='mysql://root@localhost/test_treeherder'
- DATABASE_URL_RO='mysql://root@localhost/test_treeherder'
- BROKER_URL='amqp://guest:guest@localhost:5672//'
- TREEHERDER_DJANGO_SECRET_KEY='secretkey-of-at-50-characters-to-pass-check-deploy'
matrix:
include:
# Each entry here creates another sub-job.
# Job 1: Linters
- env: linters
sudo: false
language: python
python: "2.7.11"
cache:
directories:
- ~/venv
- node_modules
before_install:
# Create a clean virtualenv rather than using the one given to us,
# to work around: https://github.com/travis-ci/travis-ci/issues/4873
- if [[ ! -f ~/venv/bin/activate ]]; then virtualenv -p python ~/venv; fi
- source ~/venv/bin/activate
- pip install --disable-pip-version-check --upgrade pip==8.1.1
# Manually create the test database (required by the Django system checks), since
# this job doesn't run pytest which would normally have created it for us.
- mysql -u root -e 'create database test_treeherder;'
install:
- npm install
- pip install --disable-pip-version-check --require-hashes -r requirements/common.txt -r requirements/dev.txt
script:
- grunt checkjs
- python lints/queuelint.py
- flake8 --show-source
- isort --check-only --diff --quiet
# Several security features in settings.py (eg setting HSTS headers) are conditional on
# 'https://' being in the site URL. In addition, we override the test environment's debug
# value so the tests pass. The real environment variable will be checked during deployment.
# Replace grep with `--fail-level WARNING` once we're using Django 1.10, since in
# previous versions an exit code of 1 is hard-coded to only ERROR and above:
# https://github.com/django/django/commit/287532588941d2941e19c4cd069bcbd8af889203
- SITE_URL='https://treeherder.dev' TREEHERDER_DEBUG='False' ./manage.py check --deploy 2>&1 | awk '/^WARNINGS/{err=1} {print} END{exit err}'
# Job 2: Nodejs UI tests
- env: ui-tests
sudo: false
language: node_js
node_js: "6.2.0"
cache:
# Note: This won't re-use the same cache as the linters job,
# since caches are tied to the language/version combination.
directories:
- node_modules
install:
- npm install
before_script:
# Required for Karma tests (http://docs.travis-ci.com/user/gui-and-headless-browsers/)
- export DISPLAY=:99.0
- sh -e /etc/init.d/xvfb start
script:
- npm test
- ./node_modules/.bin/grunt build --production
# Job 3: Python Tests Chunk A
- env: python-tests-main
# Once mysql 5.6 is available on the container infra, we should switch back
# to it for its faster boot time, by setting `sudo: false`.
sudo: required
dist: trusty
language: python
python: "2.7.11"
cache:
directories:
- ~/venv
addons:
apt:
packages:
# Install mysql 5.6 since the default is v5.5.
- mysql-server-5.6
- mysql-client-core-5.6
- mysql-client-5.6
services:
- rabbitmq
- memcached
before_install:
- echo -e '\n[mysqld]\nsql_mode="STRICT_ALL_TABLES"\n' | sudo tee -a /etc/mysql/my.cnf
- sudo service mysql restart
# Create a clean virtualenv rather than using the one given to us,
# to work around: https://github.com/travis-ci/travis-ci/issues/4873
- if [[ ! -f ~/venv/bin/activate ]]; then virtualenv -p python ~/venv; fi
- source ~/venv/bin/activate
- pip install --disable-pip-version-check --upgrade pip==8.1.1
install:
- pip install --disable-pip-version-check --require-hashes -r requirements/common.txt -r requirements/dev.txt
script:
- py.test tests/ --runslow --ignore=tests/e2e/ --ignore=tests/etl/ --ignore=tests/log_parser/ --ignore=tests/webapp/
# Job 4: Python Tests Chunk B
- env: python-tests-e2e-etl-logparser
# Once mysql 5.6 is available on the container infra, we should switch back
# to it for its faster boot time, by setting `sudo: false`.
sudo: required
dist: trusty
language: python
python: "2.7.11"
cache:
directories:
- ~/venv
addons:
apt:
packages:
# Install mysql 5.6 since the default is v5.5.
- mysql-server-5.6
- mysql-client-core-5.6
- mysql-client-5.6
services:
- rabbitmq
- memcached
before_install:
- echo -e '\n[mysqld]\nsql_mode="STRICT_ALL_TABLES"\n' | sudo tee -a /etc/mysql/my.cnf
- sudo service mysql restart
# Create a clean virtualenv rather than using the one given to us,
# to work around: https://github.com/travis-ci/travis-ci/issues/4873
- if [[ ! -f ~/venv/bin/activate ]]; then virtualenv -p python ~/venv; fi
- source ~/venv/bin/activate
- pip install --disable-pip-version-check --upgrade pip==8.1.1
install:
- pip install --disable-pip-version-check --require-hashes -r requirements/common.txt -r requirements/dev.txt
script:
- py.test tests/e2e/ tests/etl/ tests/log_parser/ --runslow
# Job 5: Python Tests Chunk C
- env: python-tests-webapp
# Once mysql 5.6 is available on the container infra, we should switch back
# to it for its faster boot time, by setting `sudo: false`.
sudo: required
dist: trusty
language: python
python: "2.7.11"
cache:
directories:
- ~/venv
addons:
apt:
packages:
# Install mysql 5.6 since the default is v5.5.
- mysql-server-5.6
- mysql-client-core-5.6
- mysql-client-5.6
services:
- rabbitmq
- memcached
before_install:
- echo -e '\n[mysqld]\nsql_mode="STRICT_ALL_TABLES"\n' | sudo tee -a /etc/mysql/my.cnf
- sudo service mysql restart
# Create a clean virtualenv rather than using the one given to us,
# to work around: https://github.com/travis-ci/travis-ci/issues/4873
- if [[ ! -f ~/venv/bin/activate ]]; then virtualenv -p python ~/venv; fi
- source ~/venv/bin/activate
- pip install --disable-pip-version-check --upgrade pip==8.1.1
install:
- pip install --disable-pip-version-check --require-hashes -r requirements/common.txt -r requirements/dev.txt
script:
- py.test tests/webapp/ --runslow
notifications:
email:
on_success: never
on_failure: always
# Do not run these on the travis server at this time.
# The end to end tests require the service to be running, but travis can't
# start the service for us. So we would have to have the default point to
# a dedicated dev service instance that is reach-able by travis. However, we
# require /etc/hosts to have an entry at this point to reach our current dev
# server. So these tests should be run only locally for now.
# - karma start config/karma-e2e.conf.js --reporters=dots --browsers=Firefox