Skip to content

Commit

Permalink
Merge pull request #208 from blueyed/travis-improvements
Browse files Browse the repository at this point in the history
Travis: travis_retry, allow failures with Django master, sudo=false
  • Loading branch information
blueyed committed Mar 2, 2015
2 parents c79cd9b + 07b9147 commit 7edf1e4
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 0 deletions.
17 changes: 17 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# Use container-based environment (faster startup, allows caches).
sudo: false
language: python
python:
- "3.4"
Expand Down Expand Up @@ -26,6 +28,21 @@ env:
- TESTENV=checkqa-python3.4
- TESTENV=checkqa-pypy
- TESTENV=checkqa-pypy3
matrix:
allow_failures:
- env: TESTENV=pypy-master-sqlite_file
- env: TESTENV=pypy3-master-sqlite_file
- env: TESTENV=python2.7-master-mysql_innodb
- env: TESTENV=python2.7-master-mysql_myisam
- env: TESTENV=python2.7-master-sqlite_file
- env: TESTENV=python3.2-master-sqlite_file
- env: TESTENV=python3.3-master-sqlite_file
- env: TESTENV=python3.4-master-postgres
- env: TESTENV=python3.4-master-sqlite
- env: TESTENV=python3.4-master-sqlite_file
before_install:
# Wrap "pip" with "travis_retry" to retry on network failures.
- pip() { travis_retry command pip "$@"; }
install:
- pip install tox
script: tox -e $TESTENV
12 changes: 12 additions & 0 deletions generate_configurations.py
Original file line number Diff line number Diff line change
Expand Up @@ -209,23 +209,35 @@ def make_tox_ini(envs, default_envs):

def make_travis_yml(envs):
contents = dedent("""
# Use container-based environment (faster startup, allows caches).
sudo: false
language: python
python:
- "%(RUN_PYTHON)s"
env:
%(testenvs)s
%(checkenvs)s
matrix:
allow_failures:
%(allow_failures)s
before_install:
# Wrap "pip" with "travis_retry" to retry on network failures.
- pip() { travis_retry command pip "$@"; }
install:
- pip install tox
script: tox -e $TESTENV
""").strip("\n")
testenvs = '\n'.join(' - TESTENV=%s' % testenv_name(env) for env in envs)
checkenvs = '\n'.join(' - TESTENV=checkqa-%s' %
python for python in PYTHON_VERSIONS)
allow_failures = '\n'.join(' - env: TESTENV=%s' %
testenv_name(env) for env in envs
if env.django_version == 'master')

return contents % {
'testenvs': testenvs,
'checkenvs': checkenvs,
'allow_failures': allow_failures,
'RUN_PYTHON': RUN_PYTHON,
}

Expand Down

0 comments on commit 7edf1e4

Please sign in to comment.