build: fix system tests, move to Kokoro (#372)
diff --git a/scripts/decrypt-secrets.sh b/scripts/decrypt-secrets.sh
index e02bfc1..f0ef994 100755
--- a/scripts/decrypt-secrets.sh
+++ b/scripts/decrypt-secrets.sh
@@ -20,8 +20,11 @@
# Work from the project root.
cd $ROOT
-openssl aes-256-cbc -k "$1" \
- -in system_tests/secrets.tar.enc \
- -out system_tests/secrets.tar -d
+gcloud kms decrypt \
+ --location=global \
+ --keyring=ci \
+ --key=kokoro-secrets \
+ --ciphertext-file=system_tests/secrets.tar.enc \
+ --plaintext-file=system_tests/secrets.tar
tar xvf system_tests/secrets.tar
rm system_tests/secrets.tar
diff --git a/scripts/encrypt-secrets.sh b/scripts/encrypt-secrets.sh
index c6291b7..b6521e8 100755
--- a/scripts/encrypt-secrets.sh
+++ b/scripts/encrypt-secrets.sh
@@ -20,13 +20,13 @@
# Work from the project root.
cd $ROOT
-read -s -p "Enter password for encryption: " PASSWORD
-echo
-
tar cvf system_tests/secrets.tar system_tests/data
-openssl aes-256-cbc -k "$PASSWORD" \
- -in system_tests/secrets.tar \
- -out system_tests/secrets.tar.enc
-rm system_tests/secrets.tar
-travis encrypt "SECRETS_PASSWORD=$PASSWORD" --add --override
+gcloud kms encrypt \
+ --location=global \
+ --keyring=ci \
+ --key=kokoro-secrets \
+ --plaintext-file=system_tests/secrets.tar \
+ --ciphertext-file=system_tests/secrets.tar.enc
+
+rm system_tests/secrets.tar
\ No newline at end of file
diff --git a/scripts/obtain_user_auth.py b/scripts/obtain_user_auth.py
deleted file mode 100644
index ae86466..0000000
--- a/scripts/obtain_user_auth.py
+++ /dev/null
@@ -1,65 +0,0 @@
-# Copyright 2016 Google Inc.
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-"""This program obtains a set of user credentials.
-
-These credentials are needed to run the system test for OAuth2 credentials.
-It's expected that a developer will run this program manually once to obtain
-a refresh token. It's highly recommended to use a Google account created
-specifically for testing.
-"""
-
-import json
-import os
-
-from oauth2client import client
-from oauth2client import tools
-
-HERE = os.path.dirname(__file__)
-CLIENT_SECRETS_PATH = os.path.abspath(os.path.join(
- HERE, '..', 'system_tests', 'data', 'client_secret.json'))
-AUTHORIZED_USER_PATH = os.path.abspath(os.path.join(
- HERE, '..', 'system_tests', 'data', 'authorized_user.json'))
-SCOPES = ['email', 'profile']
-
-
-class NullStorage(client.Storage):
- """Null storage implementation to prevent oauth2client from failing
- on storage.put."""
- def locked_put(self, credentials):
- pass
-
-
-def main():
- flow = client.flow_from_clientsecrets(CLIENT_SECRETS_PATH, SCOPES)
-
- print('Starting credentials flow...')
- credentials = tools.run_flow(flow, NullStorage())
-
- # Save the credentials in the same format as the Cloud SDK's authorized
- # user file.
- data = {
- 'type': 'authorized_user',
- 'client_id': flow.client_id,
- 'client_secret': flow.client_secret,
- 'refresh_token': credentials.refresh_token
- }
-
- with open(AUTHORIZED_USER_PATH, 'w') as fh:
- json.dump(data, fh, indent=4)
-
- print('Created {}.'.format(AUTHORIZED_USER_PATH))
-
-if __name__ == '__main__':
- main()
diff --git a/scripts/travis.sh b/scripts/travis.sh
index 28bf5fa..2c34091 100755
--- a/scripts/travis.sh
+++ b/scripts/travis.sh
@@ -37,6 +37,6 @@
fi
fi
-# Run tox.
-echo "Running tox..."
-tox
+# Run nox.
+echo "Running nox..."
+nox
\ No newline at end of file