Skip to content
This repository was archived by the owner on Mar 6, 2026. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions .kokoro/common.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Format: //devtools/kokoro/config/proto/build.proto

# Download trampoline resources. These will be in ${KOKORO_GFILE_DIR}
gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/trampoline"

# All builds use the trampoline script to run in docker.
build_file: "google-auth-library-python/.kokoro/trampoline.sh"

# Use the Python worker docker iamge.
env_vars: {
key: "TRAMPOLINE_IMAGE"
value: "gcr.io/silver-python2/python-worker"
}
16 changes: 16 additions & 0 deletions .kokoro/system_tests.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Format: //devtools/kokoro/config/proto/build.proto

# Download secrets from Cloud Storage.
gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/google-auth-library-python"

# Tell the trampoline which build file to use.
env_vars: {
key: "TRAMPOLINE_BUILD_FILE"
value: "github/google-auth-library-python/.kokoro/system_tests.sh"
}

# Tell the system tests which Google Cloud project to use.
env_vars: {
key: "TEST_PROJECT"
value: "python-docs-samples-tests"
}
33 changes: 33 additions & 0 deletions .kokoro/system_tests.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
#!/bin/bash

# Copyright 2017 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.

set -eo pipefail

export PATH=${PATH}:${HOME}/gcloud/google-cloud-sdk/bin

cd github/google-auth-library-python

# Unencrypt and extract secrets
SECRETS_PASSWORD=$(cat "${KOKORO_GFILE_DIR}/secrets-password.txt")
./scripts/decrypt-secrets.sh "${SECRETS_PASSWORD}"

# Setup gcloud, this is needed for the App Engine system test.
gcloud auth activate-service-account --key-file system_tests/data/service_account.json
gcloud config set project "${TEST_PROJECT}"

# Run tests
tox -e py27-system
tox -e py36-system
17 changes: 17 additions & 0 deletions .kokoro/trampoline.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/bin/bash

# Copyright 2017 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.

python3 "${KOKORO_GFILE_DIR}/trampoline_v1.py"
5 changes: 4 additions & 1 deletion system_tests/test_compute_engine.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,15 @@
import google.auth
from google.auth import _helpers
from google.auth import compute_engine
from google.auth import exceptions
from google.auth.compute_engine import _metadata


@pytest.fixture(autouse=True)
def check_gce_environment(http_request):
if not _metadata.ping(http_request, timeout=1):
try:
_metadata.get_service_account_info(http_request)
except exceptions.TransportError:
pytest.skip('Compute Engine metadata service is not available.')


Expand Down