treeherder/.travis.yml

200 строки
8.9 KiB
YAML
Исходник Обычный вид История

dist: trusty
2013-06-25 18:00:48 +04:00
env:
2013-06-25 21:05:18 +04:00
global:
# Ensure the vendored libmysqlclient library can be found at run-time.
- LD_LIBRARY_PATH="$HOME/venv/lib/x86_64-linux-gnu:$LD_LIBRARY_PATH"
- BROKER_URL='amqp://guest:guest@localhost:5672//'
- DATABASE_URL='mysql://root@localhost/test_treeherder'
- ELASTICSEARCH_URL='http://127.0.0.1:9200'
- 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: python-linters
sudo: false
language: python
python: "2.7.13"
cache:
directories:
- ~/venv
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
install:
Bug 1213230 - Use pip 8's require-hashes feature instead of peep As of pip 8, peep has now been integrated into pip. Migrating from peep to this native feature has several advantages: * It avoids the complexity/learning curve of using a wrapper around pip. * It means we do not need to fork the official Heroku Python buildpack (which handles pip installation of requirements files) in order to use hash verification on Heroku. (Once the buildpack updates to pip 8.) * Omitted sub-dependencies result in install-time errors rather than the user discovering omissions at run-time. * pip's native caching is used, and all packages are installed in one pip invocation, so it's significantly faster. * It has better handling of errors and corner cases. Key facts about the native feature: * hash-checking mode is enabled if at least one hash is found in the requirements files passed to pip, or can be force enabled by passing `--requires-hashes` when running `pip install`. * Once enabled, hash-checking mode enforces that all packages: - are pinned to a specific version - have hashes listed - have all sub-dependencies specified * Older versions of pip will error out if either `--require-hashes` or the requirements file `--hash` syntax is used, meaning it's not possible to accidentally lose hash-checking protection if the pip used is older than expected. For more details, see: https://pip.pypa.io/en/stable/user_guide/#hash-checking-mode https://pip.pypa.io/en/stable/reference/pip_install/#hash-checking-mode The pip version on Travis and in the Vagrant virtualenv has been updated to 8.0.2 in bug 1241144, and the stage/prod virtualenv in bug 1241519. The Heroku Python buildpack pip was updated in bug 1241909. The requirements files hashes were ported using `peep port`, and then comments/URLs re-added by hand.
2016-01-20 19:22:54 +03:00
- pip install --disable-pip-version-check --require-hashes -r requirements/common.txt -r requirements/dev.txt
script:
- python lints/queuelint.py
- flake8 --show-source
- isort --check-only --diff --quiet
# Job 2: Nodejs UI tests
- env: ui-tests
sudo: false
language: node_js
node_js: "7.7.2"
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
addons:
firefox: latest
before_install:
# Required until Travis makes yarn available in the environment,
# since we override the default `install` for clarity.
- curl -sSfL https://yarnpkg.com/install.sh | bash
- export PATH=$HOME/.yarn/bin:$PATH
install:
# `--frozen-lockfile` will catch cases where people have forgotten to update `yarn.lock`.
# `--no-bin-links` is only necessary on Windows hosts, but we include here to ensure
# that the package.json scripts aren't relying on symlinks that won't exist elsewhere.
- yarn install --frozen-lockfile --no-bin-links
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:
- yarn run lint
- yarn test
- yarn run build
# Job 3: Python Tests Chunk A
- env: python-tests-main
# TODO: Investigate switching back to the container infra, by setting `sudo: false`.
sudo: required
language: python
python: "2.7.13"
cache:
directories:
- ~/venv
services:
- rabbitmq
before_install:
- curl -sSo ~/elasticsearch.deb https://download.elastic.co/elasticsearch/release/org/elasticsearch/distribution/deb/elasticsearch/2.3.5/elasticsearch-2.3.5.deb && sudo dpkg -i ~/elasticsearch.deb
- sudo service elasticsearch start
- sudo cp puppet/files/mysql/my.cnf /etc/mysql/conf.d/treeherder.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
- ./bin/vendor-libmysqlclient.sh ~/venv
# Create the test database for `manage.py check --deploy`.
- mysql -u root -e 'create database test_treeherder;'
install:
Bug 1213230 - Use pip 8's require-hashes feature instead of peep As of pip 8, peep has now been integrated into pip. Migrating from peep to this native feature has several advantages: * It avoids the complexity/learning curve of using a wrapper around pip. * It means we do not need to fork the official Heroku Python buildpack (which handles pip installation of requirements files) in order to use hash verification on Heroku. (Once the buildpack updates to pip 8.) * Omitted sub-dependencies result in install-time errors rather than the user discovering omissions at run-time. * pip's native caching is used, and all packages are installed in one pip invocation, so it's significantly faster. * It has better handling of errors and corner cases. Key facts about the native feature: * hash-checking mode is enabled if at least one hash is found in the requirements files passed to pip, or can be force enabled by passing `--requires-hashes` when running `pip install`. * Once enabled, hash-checking mode enforces that all packages: - are pinned to a specific version - have hashes listed - have all sub-dependencies specified * Older versions of pip will error out if either `--require-hashes` or the requirements file `--hash` syntax is used, meaning it's not possible to accidentally lose hash-checking protection if the pip used is older than expected. For more details, see: https://pip.pypa.io/en/stable/user_guide/#hash-checking-mode https://pip.pypa.io/en/stable/reference/pip_install/#hash-checking-mode The pip version on Travis and in the Vagrant virtualenv has been updated to 8.0.2 in bug 1241144, and the stage/prod virtualenv in bug 1241519. The Heroku Python buildpack pip was updated in bug 1241909. The requirements files hashes were ported using `peep port`, and then comments/URLs re-added by hand.
2016-01-20 19:22:54 +03:00
- pip install --disable-pip-version-check --require-hashes -r requirements/common.txt -r requirements/dev.txt
before_script:
- while ! curl localhost:9200 &>/dev/null; do sleep 1; done
script:
# 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.
- SITE_URL='https://treeherder.dev' TREEHERDER_DEBUG='False' ./manage.py check --deploy --fail-level WARNING
- py.test tests/ --runslow --ignore=tests/e2e/ --ignore=tests/etl/ --ignore=tests/log_parser/ --ignore=tests/webapp/ --ignore=tests/selenium/
# Job 4: Python Tests Chunk B
- env: python-tests-e2e-etl-logparser
# TODO: Investigate switching back to the container infra, by setting `sudo: false`.
sudo: required
language: python
python: "2.7.13"
cache:
directories:
- ~/venv
services:
- rabbitmq
before_install:
- curl -sSo ~/elasticsearch.deb https://download.elastic.co/elasticsearch/release/org/elasticsearch/distribution/deb/elasticsearch/2.3.5/elasticsearch-2.3.5.deb && sudo dpkg -i ~/elasticsearch.deb
- sudo service elasticsearch start
- sudo cp puppet/files/mysql/my.cnf /etc/mysql/conf.d/treeherder.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
- ./bin/vendor-libmysqlclient.sh ~/venv
install:
Bug 1213230 - Use pip 8's require-hashes feature instead of peep As of pip 8, peep has now been integrated into pip. Migrating from peep to this native feature has several advantages: * It avoids the complexity/learning curve of using a wrapper around pip. * It means we do not need to fork the official Heroku Python buildpack (which handles pip installation of requirements files) in order to use hash verification on Heroku. (Once the buildpack updates to pip 8.) * Omitted sub-dependencies result in install-time errors rather than the user discovering omissions at run-time. * pip's native caching is used, and all packages are installed in one pip invocation, so it's significantly faster. * It has better handling of errors and corner cases. Key facts about the native feature: * hash-checking mode is enabled if at least one hash is found in the requirements files passed to pip, or can be force enabled by passing `--requires-hashes` when running `pip install`. * Once enabled, hash-checking mode enforces that all packages: - are pinned to a specific version - have hashes listed - have all sub-dependencies specified * Older versions of pip will error out if either `--require-hashes` or the requirements file `--hash` syntax is used, meaning it's not possible to accidentally lose hash-checking protection if the pip used is older than expected. For more details, see: https://pip.pypa.io/en/stable/user_guide/#hash-checking-mode https://pip.pypa.io/en/stable/reference/pip_install/#hash-checking-mode The pip version on Travis and in the Vagrant virtualenv has been updated to 8.0.2 in bug 1241144, and the stage/prod virtualenv in bug 1241519. The Heroku Python buildpack pip was updated in bug 1241909. The requirements files hashes were ported using `peep port`, and then comments/URLs re-added by hand.
2016-01-20 19:22:54 +03:00
- pip install --disable-pip-version-check --require-hashes -r requirements/common.txt -r requirements/dev.txt
before_script:
- while ! curl localhost:9200 &>/dev/null; do sleep 1; done
script:
- py.test tests/e2e/ tests/etl/ tests/log_parser/ --runslow
# Job 5: Python Tests Chunk C
- env: python-tests-webapp
# TODO: Investigate switching back to the container infra, by setting `sudo: false`.
sudo: required
language: python
python: "2.7.13"
cache:
directories:
- ~/venv
services:
- rabbitmq
before_install:
- curl -sSo ~/elasticsearch.deb https://download.elastic.co/elasticsearch/release/org/elasticsearch/distribution/deb/elasticsearch/2.3.5/elasticsearch-2.3.5.deb && sudo dpkg -i ~/elasticsearch.deb
- sudo service elasticsearch start
- sudo cp puppet/files/mysql/my.cnf /etc/mysql/conf.d/treeherder.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
- ./bin/vendor-libmysqlclient.sh ~/venv
install:
- pip install --disable-pip-version-check --require-hashes -r requirements/common.txt -r requirements/dev.txt
before_script:
- while ! curl localhost:9200 &>/dev/null; do sleep 1; done
script:
- py.test tests/webapp/ --runslow
# Job 6: Python Tests - Selenium integration
- env: python-tests-selenium
# TODO: Investigate switching back to the container infra, by setting `sudo: false`.
sudo: required
language: python
python: "2.7.13"
cache:
directories:
- ~/venv
addons:
firefox: latest
services:
- rabbitmq
before_install:
- curl -sSo ~/elasticsearch.deb https://download.elastic.co/elasticsearch/release/org/elasticsearch/distribution/deb/elasticsearch/2.3.5/elasticsearch-2.3.5.deb && sudo dpkg -i ~/elasticsearch.deb
- sudo service elasticsearch start
- sudo cp puppet/files/mysql/my.cnf /etc/mysql/conf.d/treeherder.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
- ./bin/vendor-libmysqlclient.sh ~/venv
- mkdir -p $HOME/bin
- wget https://github.com/mozilla/geckodriver/releases/download/v0.14.0/geckodriver-v0.14.0-linux64.tar.gz
- tar -xzf geckodriver-v0.14.0-linux64.tar.gz -C $HOME/bin
install:
- pip install --disable-pip-version-check --require-hashes -r requirements/common.txt -r requirements/dev.txt
before_script:
- while ! curl localhost:9200 &>/dev/null; do sleep 1; done
- "export DISPLAY=:99.0"
- "sh -e /etc/init.d/xvfb start"
- sleep 3 # give xvfb some time to start
script:
- py.test tests/selenium/ --runselenium --driver Firefox
2013-06-27 20:57:44 +04:00
notifications:
email:
on_success: never
on_failure: always