Skip to content

Commit

Permalink
Merge branch 'master' into renovate/google-cloud-translate-2.x
Browse files Browse the repository at this point in the history
  • Loading branch information
Takashi Matsuo authored Jul 10, 2020
2 parents 5ec84bb + 1421bfe commit 107d583
Show file tree
Hide file tree
Showing 15 changed files with 524 additions and 27 deletions.
10 changes: 8 additions & 2 deletions .kokoro/common.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/trampoline"
gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/getting-started-python"

# All builds use the trampoline script to run in docker.
build_file: "getting-started-python/.kokoro/trampoline.sh"
build_file: "getting-started-python/.kokoro/trampoline_v2.sh"

# Use the Python worker docker iamge.
env_vars: {
Expand All @@ -18,5 +18,11 @@ env_vars: {
# Tell the trampoline which build file to use.
env_vars: {
key: "TRAMPOLINE_BUILD_FILE"
value: "github/getting-started-python/.kokoro/system_tests.sh"
value: ".kokoro/system_tests.sh"
}

# We still rely on the legacy service account.
env_vars: {
key: "TRAMPOLINE_USE_LEGACY_SERVICE_ACCOUNT"
value: "true"
}
17 changes: 16 additions & 1 deletion .kokoro/system_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ set -eo pipefail

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

cd github/getting-started-python
cd "${PROJECT_ROOT:-github/getting-started-python}"


# Unencrypt and extract secrets
SECRETS_PASSWORD=$(cat "${KOKORO_GFILE_DIR}/secrets-password.txt")
Expand All @@ -27,6 +28,20 @@ SECRETS_PASSWORD=$(cat "${KOKORO_GFILE_DIR}/secrets-password.txt")
# Setup environment variables
export GOOGLE_APPLICATION_CREDENTIALS="$(pwd)/service-account.json"

# This block is executed only with Trampoline V2.
if [[ -n "${TRAMPOLINE_VERSION:-}" ]]; then
# Install nox as a user and add it to the PATH.
python3 -m pip install --user nox
export PATH="${PATH}:${HOME}/.local/bin"
fi

# Run tests
nox -s lint
nox -s run_tests

# If this is a nightly build, send the test log to the Build Cop Bot.
# See https://github.com/googleapis/repo-automation-bots/tree/master/packages/buildcop.
if [[ $KOKORO_BUILD_ARTIFACTS_SUBDIR = *"system_tests"* ]]; then
chmod +x $KOKORO_GFILE_DIR/linux_amd64/buildcop
$KOKORO_GFILE_DIR/linux_amd64/buildcop
fi
Loading

0 comments on commit 107d583

Please sign in to comment.