Skip to content
This repository has been archived by the owner on Nov 5, 2019. It is now read-only.

Adding travis and tox configuration to run the app engine tests #275

Merged
merged 1 commit into from
Aug 17, 2015

Conversation

theacodes
Copy link
Contributor

Fixes #270.

@theacodes
Copy link
Contributor Author

(Going to have to modify this a few times until travis works, will ping when it's green)

@theacodes theacodes force-pushed the master branch 3 times, most recently from bfb3b9d to 305e5a6 Compare August 17, 2015 19:31
@dhermes
Copy link
Contributor

dhermes commented Aug 17, 2015

We need to turn on caching so these installs don't take 50 seconds every time.

@dhermes
Copy link
Contributor

dhermes commented Aug 17, 2015

I've seen this before on my machine when trying to fool it.

OSError: Config directory does not exist: /home/travis/.config/gcloud

@theacodes theacodes force-pushed the master branch 2 times, most recently from 86d0826 to 5f9ffb1 Compare August 17, 2015 19:38
@theacodes
Copy link
Contributor Author

Was waiting to enable cache until I got it passing. The latest push should light up all green and should be ready to merge.

@theacodes
Copy link
Contributor Author

Sigh. Not yet. Hold on.

@theacodes theacodes force-pushed the master branch 2 times, most recently from 7ac4d00 to 2c2639d Compare August 17, 2015 19:45
@dhermes
Copy link
Contributor

dhermes commented Aug 17, 2015

w00t green!

Regarding #212, we'll never light up as "100%" coverage unless the GAE tests run side-by-side with the rest. This PR is a fine stop-gap for now, but probably worth just doing them all at once once the cache is turned on (and we can just pull GAE stuff from the cache).

I know right know that the GAE imports get angry when django>1.5 is installed, but we could probably deal with that in the cover env.

@theacodes
Copy link
Contributor Author

You can also trick coverage into compiling stats from multiple runs. We did this with the docs samples as well.

# - TOX_ENV=pypy
# - TOX_ENV=docs
# - TOX_ENV=system-tests
# - TOX_ENV=system-tests3

This comment was marked as spam.

This comment was marked as spam.

@theacodes
Copy link
Contributor Author

Can you reset travis' cache? It seems I cached a bad install of the SDK. Once that's reset, we should have green tests.

# - TOX_ENV=system-tests3
- TOX_ENV=gae
global:
- GAE_PYTHONPATH=$HOME/google_appengine

This comment was marked as spam.

This comment was marked as spam.

@theacodes theacodes force-pushed the master branch 2 times, most recently from b9649b0 to 51eef9d Compare August 17, 2015 19:56
@theacodes
Copy link
Contributor Author

Still trying to get travis' cache to play along.

@@ -51,6 +51,15 @@ basepython = python2.6
deps = {[testenv]basedeps}
django>=1.5,<1.6

[testenv:gae]

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

# - TOX_ENV=system-tests3
- TOX_ENV=gae
global:
- GAE_PYTHONPATH=$HOME/.cache/google_appengine

This comment was marked as spam.

This comment was marked as spam.

@dhermes
Copy link
Contributor

dhermes commented Aug 17, 2015

RE:

You can also trick coverage into compiling stats from multiple runs. We did this with the docs samples as well.

So cool! Does this work when using matrix env in Travis?

@theacodes
Copy link
Contributor Author

So cool! Does this work when using matrix env in Travis?

I don't think so. Maybe?
GAE causes all kinds of testing problems.

@dhermes
Copy link
Contributor

dhermes commented Aug 17, 2015

I can clear it for you in the settings if need be (you might not have privileges, I might not either though): http://docs.travis-ci.com/user/caching/#Clearing-Caches

travis cache --delete

@theacodes
Copy link
Contributor Author

I don't have rights to clear the cache.

@dhermes
Copy link
Contributor

dhermes commented Aug 17, 2015

Do you want me to try to clear it?

@theacodes
Copy link
Contributor Author

Okay - confirmed the settings are correct with a new cache directory (cache2). If someone can kill the broken cache, then this should light up all green. :)

@theacodes
Copy link
Contributor Author

Do you want me to try to clear it?

Yes, please.

@dhermes
Copy link
Contributor

dhermes commented Aug 17, 2015

@jonparrott Just deleted the cache

@theacodes
Copy link
Contributor Author

Presses big red button

mkdir -p `dirname ${GAE_PYTHONPATH}`
cd `dirname ${GAE_PYTHONPATH}`
wget https://storage.googleapis.com/appengine-sdks/featured/google_appengine_1.9.25.zip
unzip -q google_appengine_1.9.25.zip

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

@theacodes
Copy link
Contributor Author

system-tests3 failed for some weird unrelated reason. This should be good to go, but I can trigger another build to be sure.

@dhermes
Copy link
Contributor

dhermes commented Aug 17, 2015

No need to re-trigger, but there are at two comments un-addressed (about hard-coding the version and making the ~/.config/gcloud dir)

@@ -25,3 +25,9 @@ if [[ "${TOX_ENV}" == "pypy" ]]; then
pyenv install pypy-2.6.0
pyenv global pypy-2.6.0
fi

if [[ "${TOX_ENV}" == "gae" && ! -d ${GAE_PYTHONPATH} ]]; then
python scripts/fetch_gae_sdk.py `dirname ${GAE_PYTHONPATH}`

This comment was marked as spam.

@theacodes
Copy link
Contributor Author

travis has forced my hand on the one test that depends on ~/.config/gcloud, I just pushed a change that should fix that.

@theacodes
Copy link
Contributor Author

Finally, green.

@@ -240,8 +242,10 @@ def test_get_access_token(self):
self.assertEqual(None, token.expires_in)

def test_save_to_well_known_file(self):
os.environ[_CLOUDSDK_CONFIG_ENV_VAR] = tempfile.mkdtemp()

This comment was marked as spam.

@dhermes
Copy link
Contributor

dhermes commented Aug 17, 2015

LGTM

dhermes added a commit that referenced this pull request Aug 17, 2015
Adding travis and tox configuration to run the app engine tests
@dhermes dhermes merged commit 904d228 into googleapis:master Aug 17, 2015
@dhermes dhermes mentioned this pull request Aug 26, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants