Skip to content
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

testing: migrate to Trampoline V2 #271

Merged
merged 2 commits into from
Jul 9, 2020
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
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"
}
12 changes: 10 additions & 2 deletions .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,13 @@ 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
Expand All @@ -36,4 +44,4 @@ nox -s run_tests
if [[ $KOKORO_BUILD_ARTIFACTS_SUBDIR = *"system_tests"* ]]; then
chmod +x $KOKORO_GFILE_DIR/linux_amd64/buildcop
$KOKORO_GFILE_DIR/linux_amd64/buildcop
fi
fi
Loading