1#!/bin/bash 2# Copyright 2018 Google LLC 3# 4# Licensed under the Apache License, Version 2.0 (the "License"); 5# you may not use this file except in compliance with the License. 6# You may obtain a copy of the License at 7# 8# https://www.apache.org/licenses/LICENSE-2.0 9# 10# Unless required by applicable law or agreed to in writing, software 11# distributed under the License is distributed on an "AS IS" BASIS, 12# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13# See the License for the specific language governing permissions and 14# limitations under the License. 15 16set -eo pipefail 17 18if [[ -z "${PROJECT_ROOT:-}" ]]; then 19 PROJECT_ROOT="github/google-auth-library-python" 20fi 21 22cd "${PROJECT_ROOT}" 23 24# Disable buffering, so that the logs stream through. 25export PYTHONUNBUFFERED=1 26 27# Remove old nox 28python3 -m pip uninstall --yes --quiet nox-automation 29 30# Install nox 31python3 -m pip install --upgrade --quiet nox 32python3 -m nox --version 33 34# Setup service account credentials. 35export GOOGLE_APPLICATION_CREDENTIALS=${KOKORO_GFILE_DIR}/service-account.json 36 37# Setup project id. 38export PROJECT_ID=$(cat "${KOKORO_GFILE_DIR}/project-id.txt") 39 40# Activate gcloud with service account credentials 41gcloud auth activate-service-account --key-file=$GOOGLE_APPLICATION_CREDENTIALS 42gcloud config set project ${PROJECT_ID} 43 44# Decrypt system test secrets 45./scripts/decrypt-secrets.sh 46 47# Run system tests which use a different noxfile 48python3 -m nox -f system_tests/noxfile.py 49