Skip to content

Commit

Permalink
Enable cover tox env on Travis
Browse files Browse the repository at this point in the history
Replace fragile app engine sdk download script with gcprepotools script -
this ensures the SDK is up-to-date and is a no-op if the SDK is installed
and up-to-date.

Resolves googleapis#617
  • Loading branch information
Jon Wayne Parrott committed Aug 12, 2016
1 parent c6b30bf commit b5e82ec
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 104 deletions.
4 changes: 3 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ matrix:
env: TOX_ENV=system-tests
- python: 3.4
env: TOX_ENV=system-tests3
- python: 2.7
env: TOX_ENV=cover
env:
global:
- GAE_PYTHONPATH=${HOME}/.cache/google_appengine
Expand All @@ -33,7 +35,7 @@ install:
script:
- ./scripts/run.sh
after_success:
- if [[ "${TOX_ENV}" == "gae" ]]; then tox -e coveralls; fi
- if [[ "${TOX_ENV}" == "cover" ]]; then coveralls; fi
notifications:
email: false

Expand Down
85 changes: 0 additions & 85 deletions scripts/fetch_gae_sdk.py

This file was deleted.

7 changes: 4 additions & 3 deletions scripts/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,12 @@

set -ev

pip install tox
pip install tox coveralls

# App Engine tests require the App Engine SDK.
if [[ "${TOX_ENV}" == "gae" && ! -d ${GAE_PYTHONPATH} ]]; then
python scripts/fetch_gae_sdk.py `dirname ${GAE_PYTHONPATH}`
if [[ "${TOX_ENV}" == "gae" || "${TOX_ENV}" == "cover" ]]; then
pip install git+https://github.com/GoogleCloudPlatform/python-repo-tools.git
gcprepotools download-appengine-sdk `dirname ${GAE_PYTHONPATH}`
fi

# Travis ships with an old version of PyPy, so install at least version 2.6.
Expand Down
19 changes: 4 additions & 15 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[tox]
envlist = py27,py34,py35,pypy,gae,cover
envlist = flake8,py27,py34,py35,pypy,gae,cover

[testenv]
basedeps = mock>=1.3.0
Expand Down Expand Up @@ -30,7 +30,7 @@ commands =
--cov=oauth2client \
--cov=tests \
--cov-append \
--gae-sdk={env:GAE_PYTHONPATH} \
--gae-sdk={env:GAE_PYTHONPATH:} \
tests/contrib/appengine
deps = {[testenv]deps}
coverage
Expand All @@ -44,17 +44,6 @@ commands =
deps =
{[coverbase]deps}

[testenv:coveralls]
basepython = {[coverbase]basepython}
commands =
{[coverbase]commands}
coverage report --show-missing
coveralls
deps =
{[coverbase]deps}
coveralls
passenv = {[testenv:system-tests]passenv}

[testenv:docs]
basepython = python2.7
deps =
Expand All @@ -70,7 +59,7 @@ commands = {toxinidir}/scripts/build_docs.sh
basepython = python2.7
deps = {[testenv]basedeps}
commands =
py.test --gae-sdk={env:GAE_PYTHONPATH} tests/contrib/appengine
py.test --gae-sdk={env:GAE_PYTHONPATH:} tests/contrib/appengine

[testenv:system-tests]
basepython =
Expand Down Expand Up @@ -110,7 +99,7 @@ deps =
flake8-import-order

[flake8]
exclude = .tox,.git,./*.egg,build,
exclude = .tox,.git,./*.egg,build,.cache,env,__pycache__
application-import-names = oauth2client, tests
putty-ignore =
# E402 module level import not at top of file
Expand Down

0 comments on commit b5e82ec

Please sign in to comment.