2013-06-25 18:00:48 +04:00
|
|
|
env:
|
2013-06-25 21:05:18 +04:00
|
|
|
global:
|
2015-09-16 15:00:34 +03:00
|
|
|
- DATABASE_URL='mysql://root@localhost/test_treeherder'
|
|
|
|
- DATABASE_URL_RO='mysql://root@localhost/test_treeherder'
|
2015-11-18 19:44:02 +03:00
|
|
|
- BROKER_URL='amqp://guest:guest@localhost:5672//'
|
2016-04-02 21:54:02 +03:00
|
|
|
- TREEHERDER_DJANGO_SECRET_KEY='secretkey-of-at-50-characters-to-pass-check-deploy'
|
2015-10-29 22:57:07 +03:00
|
|
|
matrix:
|
|
|
|
include:
|
|
|
|
# Each entry here creates another sub-job.
|
|
|
|
|
2016-05-04 20:03:00 +03:00
|
|
|
# Job 1: Linters
|
2015-10-29 23:04:33 +03:00
|
|
|
- env: linters
|
|
|
|
sudo: false
|
|
|
|
language: python
|
2015-12-16 19:33:42 +03:00
|
|
|
python: "2.7.11"
|
2015-10-29 23:04:33 +03:00
|
|
|
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
|
2016-05-26 13:10:34 +03:00
|
|
|
- if [[ ! -f ~/venv/bin/activate ]]; then virtualenv -p python ~/venv; fi
|
2015-10-29 23:04:33 +03:00
|
|
|
- source ~/venv/bin/activate
|
2016-05-04 20:02:09 +03:00
|
|
|
- pip install --disable-pip-version-check --upgrade pip==8.1.1
|
2016-05-03 16:41:40 +03:00
|
|
|
# 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;'
|
2015-10-29 23:04:33 +03:00
|
|
|
install:
|
|
|
|
- npm install
|
2016-01-20 19:22:54 +03:00
|
|
|
- pip install --disable-pip-version-check --require-hashes -r requirements/common.txt -r requirements/dev.txt
|
2015-10-29 23:04:33 +03:00
|
|
|
script:
|
|
|
|
- grunt checkjs
|
2016-03-09 16:24:32 +03:00
|
|
|
- python lints/queuelint.py
|
2015-10-29 23:04:33 +03:00
|
|
|
- flake8 --show-source
|
|
|
|
- isort --check-only --diff --quiet
|
2016-05-03 16:41:40 +03:00
|
|
|
# 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}'
|
2015-10-29 23:04:33 +03:00
|
|
|
|
2016-05-04 20:03:00 +03:00
|
|
|
# Job 2: Nodejs UI tests
|
2015-10-29 23:20:32 +03:00
|
|
|
- env: ui-tests
|
|
|
|
sudo: false
|
|
|
|
language: node_js
|
2016-05-26 14:54:26 +03:00
|
|
|
node_js: "6.2.0"
|
2015-10-29 23:20:32 +03:00
|
|
|
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
|
|
|
|
|
2016-05-04 20:03:00 +03:00
|
|
|
# Job 3: Python Tests Chunk A
|
2015-10-30 00:48:07 +03:00
|
|
|
- env: python-tests-main
|
2015-10-29 23:04:33 +03:00
|
|
|
# Once mysql 5.6 is available on the container infra, we should switch back
|
2016-05-04 20:05:19 +03:00
|
|
|
# to it for its faster boot time, by setting `sudo: false`.
|
2015-10-29 22:57:07 +03:00
|
|
|
sudo: required
|
|
|
|
dist: trusty
|
2015-10-29 23:26:03 +03:00
|
|
|
language: python
|
2015-12-16 19:33:42 +03:00
|
|
|
python: "2.7.11"
|
2016-05-04 20:05:19 +03:00
|
|
|
cache:
|
|
|
|
directories:
|
|
|
|
- ~/venv
|
2016-05-26 13:13:45 +03:00
|
|
|
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
|
2015-10-29 22:57:07 +03:00
|
|
|
services:
|
|
|
|
- rabbitmq
|
|
|
|
- memcached
|
|
|
|
before_install:
|
2016-05-25 19:21:53 +03:00
|
|
|
- echo -e '\n[mysqld]\nsql_mode="STRICT_ALL_TABLES"\n' | sudo tee -a /etc/mysql/my.cnf
|
|
|
|
- sudo service mysql restart
|
2016-05-04 20:05:19 +03:00
|
|
|
# Create a clean virtualenv rather than using the one given to us,
|
|
|
|
# to work around: https://github.com/travis-ci/travis-ci/issues/4873
|
2016-05-26 13:10:34 +03:00
|
|
|
- if [[ ! -f ~/venv/bin/activate ]]; then virtualenv -p python ~/venv; fi
|
2016-05-04 20:05:19 +03:00
|
|
|
- source ~/venv/bin/activate
|
2016-05-04 20:02:09 +03:00
|
|
|
- pip install --disable-pip-version-check --upgrade pip==8.1.1
|
2015-10-29 22:57:07 +03:00
|
|
|
install:
|
2016-01-20 19:22:54 +03:00
|
|
|
- pip install --disable-pip-version-check --require-hashes -r requirements/common.txt -r requirements/dev.txt
|
2015-10-29 22:57:07 +03:00
|
|
|
script:
|
2016-05-26 15:44:31 +03:00
|
|
|
- py.test tests/ --runslow --ignore=tests/e2e/ --ignore=tests/etl/ --ignore=tests/log_parser/ --ignore=tests/webapp/
|
2015-11-11 15:41:44 +03:00
|
|
|
|
2016-05-04 20:03:00 +03:00
|
|
|
# Job 4: Python Tests Chunk B
|
2016-05-26 15:44:31 +03:00
|
|
|
- env: python-tests-e2e-etl-logparser
|
2015-10-30 00:48:07 +03:00
|
|
|
# Once mysql 5.6 is available on the container infra, we should switch back
|
2016-05-04 20:05:19 +03:00
|
|
|
# to it for its faster boot time, by setting `sudo: false`.
|
2015-10-30 00:48:07 +03:00
|
|
|
sudo: required
|
|
|
|
dist: trusty
|
|
|
|
language: python
|
2015-12-16 19:33:42 +03:00
|
|
|
python: "2.7.11"
|
2016-05-04 20:05:19 +03:00
|
|
|
cache:
|
|
|
|
directories:
|
|
|
|
- ~/venv
|
2016-05-26 13:13:45 +03:00
|
|
|
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
|
2015-10-30 00:48:07 +03:00
|
|
|
services:
|
|
|
|
- rabbitmq
|
|
|
|
- memcached
|
|
|
|
before_install:
|
2016-05-25 19:21:53 +03:00
|
|
|
- echo -e '\n[mysqld]\nsql_mode="STRICT_ALL_TABLES"\n' | sudo tee -a /etc/mysql/my.cnf
|
|
|
|
- sudo service mysql restart
|
2016-05-04 20:05:19 +03:00
|
|
|
# Create a clean virtualenv rather than using the one given to us,
|
|
|
|
# to work around: https://github.com/travis-ci/travis-ci/issues/4873
|
2016-05-26 13:10:34 +03:00
|
|
|
- if [[ ! -f ~/venv/bin/activate ]]; then virtualenv -p python ~/venv; fi
|
2016-05-04 20:05:19 +03:00
|
|
|
- source ~/venv/bin/activate
|
2016-05-04 20:02:09 +03:00
|
|
|
- pip install --disable-pip-version-check --upgrade pip==8.1.1
|
2015-10-30 00:48:07 +03:00
|
|
|
install:
|
2016-01-20 19:22:54 +03:00
|
|
|
- pip install --disable-pip-version-check --require-hashes -r requirements/common.txt -r requirements/dev.txt
|
2015-10-30 00:48:07 +03:00
|
|
|
script:
|
2015-11-11 15:41:44 +03:00
|
|
|
- py.test tests/e2e/ tests/etl/ tests/log_parser/ --runslow
|
2015-10-29 22:57:07 +03:00
|
|
|
|
2016-05-26 15:44:31 +03:00
|
|
|
# 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
|
|
|
|
|
2013-06-27 20:57:44 +04:00
|
|
|
notifications:
|
2015-03-08 18:00:57 +03:00
|
|
|
email:
|
|
|
|
on_success: never
|
|
|
|
on_failure: always
|
2015-05-25 19:24:59 +03:00
|
|
|
|
|
|
|
# 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
|