From 620d5caa7708873e648208243577bec96ea3463b Mon Sep 17 00:00:00 2001 From: Jon Wayne Parrott Date: Mon, 17 Aug 2015 11:33:58 -0700 Subject: [PATCH] Adding travis and tox configuration to run the app engine tests --- .travis.yml | 22 ++++++++++++++-------- scripts/install.sh | 8 ++++++++ tests/data/app.yaml | 10 ++++++++++ tox.ini | 11 ++++++++++- 4 files changed, 42 insertions(+), 9 deletions(-) create mode 100644 tests/data/app.yaml diff --git a/.travis.yml b/.travis.yml index 46f1cb6f6..2b16bcb48 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,14 +3,20 @@ python: 2.7 sudo: false env: matrix: - - TOX_ENV=py26 - - TOX_ENV=py27 - - TOX_ENV=py33 - - TOX_ENV=py34 - - TOX_ENV=pypy - - TOX_ENV=docs - - TOX_ENV=system-tests - - TOX_ENV=system-tests3 + # - TOX_ENV=py26 + # - TOX_ENV=py27 + # - TOX_ENV=py33 + # - TOX_ENV=py34 + # - TOX_ENV=pypy + # - TOX_ENV=docs + # - TOX_ENV=system-tests + # - TOX_ENV=system-tests3 + - TOX_ENV=gae + global: + - GAE_PYTHONPATH=$HOME/google_appengine +cache: + directories: + - $HOME/google_appengine install: - ./scripts/install.sh script: diff --git a/scripts/install.sh b/scripts/install.sh index 5e8a17d98..7c5784021 100755 --- a/scripts/install.sh +++ b/scripts/install.sh @@ -25,3 +25,11 @@ if [[ "${TOX_ENV}" == "pypy" ]]; then pyenv install pypy-2.6.0 pyenv global pypy-2.6.0 fi + +if [[ "${TOX_ENV}" == "gae" && ! -d $HOME/google_appengine ]]; then + cd $HOME + wget https://storage.googleapis.com/appengine-sdks/featured/google_appengine_1.9.25.zip + unzip -q google_appengine_1.9.25.zip + # Directory is required for the write to well known file test to pass. + mkdir -p $HOME/.config/gcloud +fi diff --git a/tests/data/app.yaml b/tests/data/app.yaml new file mode 100644 index 000000000..9268dfa7d --- /dev/null +++ b/tests/data/app.yaml @@ -0,0 +1,10 @@ +# Dummy app.yaml to placate nosegae. +application: oauth2client +version: 1 +runtime: python27 +api_version: 1 +threadsafe: yes + +handlers: +- url: /.* + script: null.app diff --git a/tox.ini b/tox.ini index 342f512db..39fe50606 100644 --- a/tox.ini +++ b/tox.ini @@ -1,5 +1,5 @@ [tox] -envlist = py26,py27,py33,py34,pypy,cover +envlist = py26,py27,py33,py34,pypy,gae,cover [testenv] basedeps = keyring @@ -51,6 +51,15 @@ basepython = python2.6 deps = {[testenv]basedeps} django>=1.5,<1.6 +[testenv:gae] +basepython = python2.7 +deps = {[testenv]basedeps} + nosegae +commands = + nosetests --with-gae --gae-application=tests/data --logging-level=INFO {posargs} tests/test_appengine.py +setenv: + PYTHONPATH={env:GAE_PYTHONPATH:} + [testenv:system-tests] basepython = python2.7