Skip to content

Commit 499375c

Browse files
author
Jon Wayne Parrott
authored
Enable cover tox env on Travis (googleapis#628)
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
1 parent 9c1ece5 commit 499375c

File tree

4 files changed

+11
-104
lines changed

4 files changed

+11
-104
lines changed

.travis.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ matrix:
2121
env: TOX_ENV=system-tests
2222
- python: 3.4
2323
env: TOX_ENV=system-tests3
24+
- python: 2.7
25+
env: TOX_ENV=cover
2426
env:
2527
global:
2628
- GAE_PYTHONPATH=${HOME}/.cache/google_appengine
@@ -33,7 +35,7 @@ install:
3335
script:
3436
- ./scripts/run.sh
3537
after_success:
36-
- if [[ "${TOX_ENV}" == "gae" ]]; then tox -e coveralls; fi
38+
- if [[ "${TOX_ENV}" == "cover" ]]; then coveralls; fi
3739
notifications:
3840
email: false
3941

scripts/fetch_gae_sdk.py

Lines changed: 0 additions & 85 deletions
This file was deleted.

scripts/install.sh

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,12 @@
1616

1717
set -ev
1818

19-
pip install tox
19+
pip install --upgrade pip setuptools tox coveralls
2020

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

2627
# Travis ships with an old version of PyPy, so install at least version 2.6.

tox.ini

Lines changed: 4 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[tox]
2-
envlist = py27,py34,py35,pypy,gae,cover
2+
envlist = flake8,py27,py34,py35,pypy,gae,cover
33

44
[testenv]
55
basedeps = mock>=1.3.0
@@ -31,7 +31,7 @@ commands =
3131
--cov=oauth2client \
3232
--cov=tests \
3333
--cov-append \
34-
--gae-sdk={env:GAE_PYTHONPATH} \
34+
--gae-sdk={env:GAE_PYTHONPATH:} \
3535
tests/contrib/appengine
3636
deps = {[testenv]deps}
3737
coverage
@@ -45,17 +45,6 @@ commands =
4545
deps =
4646
{[coverbase]deps}
4747

48-
[testenv:coveralls]
49-
basepython = {[coverbase]basepython}
50-
commands =
51-
{[coverbase]commands}
52-
coverage report --show-missing
53-
coveralls
54-
deps =
55-
{[coverbase]deps}
56-
coveralls
57-
passenv = {[testenv:system-tests]passenv}
58-
5948
[testenv:docs]
6049
basepython = python2.7
6150
deps =
@@ -71,7 +60,7 @@ commands = {toxinidir}/scripts/build_docs.sh
7160
basepython = python2.7
7261
deps = {[testenv]basedeps}
7362
commands =
74-
py.test --gae-sdk={env:GAE_PYTHONPATH} tests/contrib/appengine
63+
py.test --gae-sdk={env:GAE_PYTHONPATH:} tests/contrib/appengine
7564

7665
[testenv:system-tests]
7766
basepython =
@@ -111,7 +100,7 @@ deps =
111100
flake8-import-order
112101

113102
[flake8]
114-
exclude = .tox,.git,./*.egg,build,
103+
exclude = .tox,.git,./*.egg,build,.cache,env,__pycache__
115104
application-import-names = oauth2client, tests
116105
putty-ignore =
117106
# E402 module level import not at top of file

0 commit comments

Comments
 (0)