-
Notifications
You must be signed in to change notification settings - Fork 309
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
build: fix system tests, move to Kokoro #372
Merged
Merged
Changes from 23 commits
Commits
Show all changes
26 commits
Select commit
Hold shift + click to select a range
b623492
Update noxfile to new format.
busunkim96 e575943
Run py27 system test session with python3 -m nox
busunkim96 5232f10
Try using nox to trigger nox.
busunkim96 ffd5b48
Fix travis.
busunkim96 70e622c
Add kokoro configs.
busunkim96 8eb1c74
Add synth file.
busunkim96 e234722
Add system test setup instructions.
busunkim96 f2cc0fc
Fix system tests.
busunkim96 8ae89bc
test: fix oauth2 test, update docs
busunkim96 d959773
chore: add encrypted secrets, use kms
busunkim96 f58d18f
build: change access to gfile resources
busunkim96 804d837
build: decrypt system test secrets
busunkim96 87d8fc2
build: change gfile resource
busunkim96 0169a5f
fix: more tweaking of gfile_resources
busunkim96 bdb54bd
build: ls what's in gfile dir
busunkim96 8a9a605
fix: set project in build script
busunkim96 bf38a67
build: use same lint standards as google-cloud-python
busunkim96 26b1232
chore: blacken
busunkim96 1383419
build: fix flake8, repo metadata
busunkim96 c4b4f77
docs: update docs
busunkim96 904c898
chore: blacken system tests
busunkim96 9a1af56
chore: add docs/conf.py to black bath
busunkim96 a9f1ffb
test: only test app engine with 2.7
busunkim96 a409423
chore: format code blocks in CONTRIBUTING.rst
busunkim96 8b9724e
test: make var for py2/3 tests
busunkim96 c6efc15
test: remove unused dependencies
busunkim96 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
#!/bin/bash | ||
|
||
# Copyright 2018 Google LLC | ||
# | ||
# 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 | ||
# | ||
# https://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. | ||
|
||
set -eo pipefail | ||
|
||
cd github/google-auth-library-python | ||
|
||
# Disable buffering, so that the logs stream through. | ||
export PYTHONUNBUFFERED=1 | ||
|
||
# Debug: show build environment | ||
env | grep KOKORO | ||
|
||
# Setup service account credentials. | ||
|
||
# add creds to gfile dir | ||
export GOOGLE_APPLICATION_CREDENTIALS=${KOKORO_GFILE_DIR}/service-account.json | ||
|
||
# Setup project id. | ||
export PROJECT_ID=$(cat "${KOKORO_GFILE_DIR}/project-id.txt") | ||
|
||
# Activate gcloud with service account credentials | ||
gcloud auth activate-service-account --key-file=$GOOGLE_APPLICATION_CREDENTIALS | ||
gcloud config set project $PROJECT_ID | ||
|
||
# Decrypt system test secrets | ||
./scripts/decrypt-secrets.sh | ||
|
||
# Remove old nox | ||
python3.6 -m pip uninstall --yes --quiet nox-automation | ||
|
||
# Install nox | ||
python3.6 -m pip install --upgrade --quiet nox | ||
python3.6 -m nox --version | ||
|
||
python3.6 -m nox | ||
python3.6 -m nox -f system_tests/noxfile.py | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
# Format: //devtools/kokoro/config/proto/build.proto | ||
|
||
# Build logs will be here | ||
action { | ||
define_artifacts { | ||
regex: "**/*sponge_log.xml" | ||
} | ||
} | ||
|
||
# Download trampoline resources. | ||
gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/trampoline" | ||
|
||
# Download resources for system tests (service account key, etc.) | ||
gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/google-auth-library-python" | ||
|
||
# Use the trampoline script to run in docker. | ||
build_file: "google-auth-library-python/.kokoro/trampoline.sh" | ||
|
||
# Configure the docker image for kokoro-trampoline. | ||
env_vars: { | ||
key: "TRAMPOLINE_IMAGE" | ||
value: "gcr.io/cloud-devrel-kokoro-resources/python-multi" | ||
} | ||
env_vars: { | ||
key: "TRAMPOLINE_BUILD_FILE" | ||
value: "github/google-auth-library-python/.kokoro/build.sh" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
# Format: //devtools/kokoro/config/proto/build.proto |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
# Format: //devtools/kokoro/config/proto/build.proto | ||
|
||
# Build logs will be here | ||
action { | ||
define_artifacts { | ||
regex: "**/*sponge_log.xml" | ||
} | ||
} | ||
|
||
# Download trampoline resources. | ||
gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/trampoline" | ||
|
||
# Use the trampoline script to run in docker. | ||
build_file: "google-auth-library-python/.kokoro/trampoline.sh" | ||
|
||
# Configure the docker image for kokoro-trampoline. | ||
env_vars: { | ||
key: "TRAMPOLINE_IMAGE" | ||
value: "gcr.io/cloud-devrel-kokoro-resources/python-multi" | ||
} | ||
env_vars: { | ||
key: "TRAMPOLINE_BUILD_FILE" | ||
value: "github/google-auth-library-python/.kokoro/publish-docs.sh" | ||
} | ||
|
||
env_vars: { | ||
key: "STAGING_BUCKET" | ||
value: "docs-staging" | ||
} | ||
|
||
# Fetch the token needed for reporting release status to GitHub | ||
before_action { | ||
fetch_keystore { | ||
keystore_resource { | ||
keystore_config_id: 73713 | ||
keyname: "yoshi-automation-github-key" | ||
} | ||
} | ||
} | ||
|
||
before_action { | ||
fetch_keystore { | ||
keystore_resource { | ||
keystore_config_id: 73713 | ||
keyname: "docuploader_service_account" | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
# Format: //devtools/kokoro/config/proto/build.proto |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
# Format: //devtools/kokoro/config/proto/build.proto | ||
|
||
# Build logs will be here | ||
action { | ||
define_artifacts { | ||
regex: "**/*sponge_log.xml" | ||
} | ||
} | ||
|
||
# Download trampoline resources. These will be in ${KOKORO_GFILE_DIR} | ||
gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/trampoline" | ||
|
||
# Download resources for tests | ||
gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/google-auth-library-python" | ||
|
||
# Use the trampoline script to run in docker. | ||
build_file: "google-auth-library-python/.kokoro/trampoline.sh" | ||
|
||
# Configure the docker image for kokoro-trampoline. | ||
env_vars: { | ||
key: "TRAMPOLINE_IMAGE" | ||
value: "gcr.io/cloud-devrel-kokoro-resources/python-multi" | ||
} | ||
env_vars: { | ||
key: "TRAMPOLINE_BUILD_FILE" | ||
value: "github/google-auth-library-python/.kokoro/build.sh" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
# Format: //devtools/kokoro/config/proto/build.proto |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
#!/bin/bash | ||
|
||
set -eo pipefail | ||
|
||
# Disable buffering, so that the logs stream through. | ||
export PYTHONUNBUFFERED=1 | ||
|
||
cd github/google-auth-library-python | ||
|
||
# Remove old nox | ||
python3.6 -m pip uninstall --yes --quiet nox-automation | ||
|
||
# Install nox | ||
python3.6 -m pip install --upgrade --quiet nox | ||
python3.6 -m nox --version | ||
|
||
# build docs | ||
nox -s docs | ||
|
||
python3 -m pip install gcp-docuploader | ||
|
||
# install a json parser | ||
sudo apt-get update | ||
sudo apt-get -y install software-properties-common | ||
sudo add-apt-repository universe | ||
sudo apt-get update | ||
sudo apt-get -y install jq | ||
|
||
# create metadata | ||
python3 -m docuploader create-metadata \ | ||
busunkim96 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
--name=$(jq --raw-output '.name // empty' .repo-metadata.json) \ | ||
--version=$(python3 setup.py --version) \ | ||
--language=$(jq --raw-output '.language // empty' .repo-metadata.json) \ | ||
--distribution-name=$(python3 setup.py --name) \ | ||
--product-page=$(jq --raw-output '.product_documentation // empty' .repo-metadata.json) \ | ||
--github-repository=$(jq --raw-output '.repo // empty' .repo-metadata.json) \ | ||
--issue-tracker=$(jq --raw-output '.issue_tracker // empty' .repo-metadata.json) | ||
|
||
cat docs.metadata | ||
|
||
# upload docs | ||
python3 -m docuploader upload docs/_build/html --metadata-file docs.metadata --staging-bucket docs-staging |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
#!/bin/bash | ||
|
||
set -eo pipefail | ||
|
||
# Start the releasetool reporter | ||
python3 -m pip install gcp-releasetool | ||
python3 -m releasetool publish-reporter-script > /tmp/publisher-script; source /tmp/publisher-script | ||
|
||
# Ensure that we have the latest versions of Twine, Wheel, and Setuptools. | ||
python3 -m pip install --upgrade twine wheel setuptools | ||
|
||
# Disable buffering, so that the logs stream through. | ||
export PYTHONUNBUFFERED=1 | ||
|
||
# Move into the package, build the distribution and upload. | ||
TWINE_PASSWORD=$(cat "${KOKORO_KEYSTORE_DIR}/73713_google_cloud_pypi_password") | ||
cd github/google-auth-library-python | ||
python3 setup.py sdist bdist_wheel | ||
twine upload --username gcloudpypi --password "${TWINE_PASSWORD}" dist/* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
# Format: //devtools/kokoro/config/proto/build.proto | ||
|
||
# Build logs will be here | ||
action { | ||
define_artifacts { | ||
regex: "**/*sponge_log.xml" | ||
} | ||
} | ||
|
||
# Download trampoline resources. | ||
gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/trampoline" | ||
|
||
# Use the trampoline script to run in docker. | ||
build_file: "google-auth-library-python/.kokoro/trampoline.sh" | ||
|
||
# Configure the docker image for kokoro-trampoline. | ||
env_vars: { | ||
key: "TRAMPOLINE_IMAGE" | ||
value: "gcr.io/cloud-devrel-kokoro-resources/python-multi" | ||
} | ||
env_vars: { | ||
key: "TRAMPOLINE_BUILD_FILE" | ||
value: "github/google-auth-library-python/.kokoro/release.sh" | ||
} | ||
|
||
# Fetch the token needed for reporting release status to GitHub | ||
before_action { | ||
fetch_keystore { | ||
keystore_resource { | ||
keystore_config_id: 73713 | ||
keyname: "yoshi-automation-github-key" | ||
} | ||
} | ||
} | ||
|
||
# Fetch PyPI password | ||
before_action { | ||
fetch_keystore { | ||
keystore_resource { | ||
keystore_config_id: 73713 | ||
keyname: "google_cloud_pypi_password" | ||
} | ||
} | ||
} | ||
|
||
# Fetch magictoken to use with Magic Github Proxy | ||
before_action { | ||
fetch_keystore { | ||
keystore_resource { | ||
keystore_config_id: 73713 | ||
keyname: "releasetool-magictoken" | ||
} | ||
} | ||
} | ||
|
||
# Fetch api key to use with Magic Github Proxy | ||
before_action { | ||
fetch_keystore { | ||
keystore_resource { | ||
keystore_config_id: 73713 | ||
keyname: "magic-github-proxy-api-key" | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
# Format: //devtools/kokoro/config/proto/build.proto |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
{ | ||
"name": "google-auth-library-python", | ||
"name_pretty": "Google Auth Python Library", | ||
"client_documentation": "https://googleapis.dev/python/google-auth-library-python/latest", | ||
"issue_tracker": "https://github.com/googleapis/google-auth-library-python/issues", | ||
"release_level": "ga", | ||
"language": "python", | ||
"repo": "googleapis/google-auth-library-python", | ||
"distribution_name": "google-auth" | ||
} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The system test noxfile seemed complicated enough that I didn't want to pull it into the top-level noxfile. I also experimented with having nox run nox, but there was some weirdness there.