-
Notifications
You must be signed in to change notification settings - Fork 430
Adding system tests to make sure token exchange works as expected. #153
Conversation
I'm going to need some more hand-holding on this - please file an issue so that we can have separate conversations about (a) the particular problem that needs to be solved and (2) the particular solution being proposed for the problem. Also let's look at breaking up the content of the pull request. A CONTRIBUTING.md file is a great idea but most of its content has nothing to do with the rest of this code - can we separate it out into its own contribution? How necessary is it to use an unreleased version of https://github.com/jcgregorio/httplib2? Has anyone actually asked @jcgregorio when the next release will be, or to cut a new release that includes the fix? |
RE: "How necessary is it to use an unreleased version of By removing it diff --git a/tox.ini b/tox.ini
index d55d91d..578e3b5 100644
--- a/tox.ini
+++ b/tox.ini
@@ -88,9 +88,5 @@ basepython =
commands =
{toxinidir}/scripts/run_system_tests.sh
deps =
- # Use a development checkout of httplib2 until a release is made
- # incorporating https://github.com/jcgregorio/httplib2/pull/291
- # and https://github.com/jcgregorio/httplib2/pull/296
- -egit+https://github.com/jcgregorio/httplib2.git#egg=httplib2
pycrypto==2.6
pyopenssl==0.14 and running
I asked @jcgregorio last week about cutting a release and have yet to hear back.
Issue #127 already exists to cover (a), and I think it also covers (2). Let me know what you think about that. |
You're absolutely right that #127 is the relevant issue for this change; sorry to have let it slip out of my mind. |
@nathanielmanistaatgoogle I have rebased on top of #155 and #156. I split this PR into two commits to make the barrier clear between the tests themselves and the Travis config. The second commit is a dummy / stand-in and should not be accepted in it's current state. Remaining work to be done:
export OAUTH2CLIENT_TEST_JSON_KEY_PATH="tests/data/key.json"
export OAUTH2CLIENT_TEST_P12_KEY_PATH="tests/data/key.p12"
# Account from svc. account P12 key
export OAUTH2CLIENT_TEST_P12_KEY_EMAIL="foo@developer.gserviceaccount.com"
export OAUTH2CLIENT_TEST_USER_KEY_PATH="tests/data/user-key.json"
# Account from user JSON key
export OAUTH2CLIENT_TEST_USER_KEY_EMAIL="foo@gmail.com"
travis env set OAUTH2CLIENT_TEST_JSON_KEY_PATH \
"${OAUTH2CLIENT_TEST_JSON_KEY_PATH}" --repo "google/oauth2client"
travis env set OAUTH2CLIENT_TEST_P12_KEY_PATH \
"${OAUTH2CLIENT_TEST_P12_KEY_PATH}" --repo "google/oauth2client"
travis env set OAUTH2CLIENT_TEST_P12_KEY_EMAIL \
"${OAUTH2CLIENT_TEST_P12_KEY_EMAIL}" --repo "google/oauth2client"
travis env set OAUTH2CLIENT_TEST_USER_KEY_PATH \
"${OAUTH2CLIENT_TEST_USER_KEY_PATH}" --repo "google/oauth2client"
travis env set OAUTH2CLIENT_TEST_USER_KEY_EMAIL \
"${OAUTH2CLIENT_TEST_USER_KEY_EMAIL}" --repo "google/oauth2client"
travis encrypt-file tests/data/key.json --repo "google/oauth2client"
travis encrypt-file tests/data/key.p12 --repo "google/oauth2client"
travis encrypt-file tests/data/user-key.json --repo "google/oauth2client" This will create the files travis logout |
@nathanielmanistaatgoogle Any blockers here? |
- Updates CONTRIBUTING.md to explain how to set-up and run these tests. - Requires a version of httplib2 that has not been released on PyPI yet in order to work on Python 3. - Simply creates 3 different token types (JSON key for svc. acct., P12 key for svc. acct., JSON key for user acct.) and then authorizes an httplib2.Http object to hit the USERINFO API.
I just updated this PR to incorporate the new release of This will also mark the first time this library works with Python 3. |
Adds files which have been encrypted by Travis and decrypts those files in scripts/run_system_tests.sh using a key and initialization vector (iv) provided by the Travis environment for this project.
Fixes #127