Skip to content

Commit 9860b0e

Browse files
committed
ci: adjust presubmit config to run on Kokoro instance
1 parent d4070ca commit 9860b0e

File tree

9 files changed

+51
-49
lines changed

9 files changed

+51
-49
lines changed

.kokoro/build.sh

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,13 @@
1515

1616
set -eo pipefail
1717

18+
CURRENT_DIR=$(dirname "${BASH_SOURCE[0]}")
19+
1820
if [[ -z "${PROJECT_ROOT:-}" ]]; then
19-
PROJECT_ROOT="github/python-bigquery"
21+
PROJECT_ROOT=$(realpath "${CURRENT_DIR}/..")
2022
fi
2123

22-
cd "${PROJECT_ROOT}"
24+
pushd "${PROJECT_ROOT}"
2325

2426
# Disable buffering, so that the logs stream through.
2527
export PYTHONUNBUFFERED=1
@@ -28,10 +30,16 @@ export PYTHONUNBUFFERED=1
2830
env | grep KOKORO
2931

3032
# Setup service account credentials.
31-
export GOOGLE_APPLICATION_CREDENTIALS=${KOKORO_GFILE_DIR}/service-account.json
33+
if [[ -f "${KOKORO_GFILE_DIR}/service-account.json" ]]
34+
then
35+
export GOOGLE_APPLICATION_CREDENTIALS=${KOKORO_GFILE_DIR}/service-account.json
36+
fi
3237

3338
# Setup project id.
34-
export PROJECT_ID=$(cat "${KOKORO_GFILE_DIR}/project-id.json")
39+
if [[ -f "${KOKORO_GFILE_DIR}/project-id.json" ]]
40+
then
41+
export PROJECT_ID=$(cat "${KOKORO_GFILE_DIR}/project-id.json")
42+
fi
3543

3644
# If this is a continuous build, send the test log to the FlakyBot.
3745
# See https://github.com/googleapis/repo-automation-bots/tree/main/packages/flakybot.
@@ -46,7 +54,7 @@ fi
4654
# If NOX_SESSION is set, it only runs the specified session,
4755
# otherwise run all the sessions.
4856
if [[ -n "${NOX_SESSION:-}" ]]; then
49-
python3 -m nox -s ${NOX_SESSION:-}
57+
python3 -m nox -s ${NOX_SESSION:-}
5058
else
51-
python3 -m nox
59+
python3 -m nox
5260
fi

.kokoro/presubmit/common.cfg

Lines changed: 9 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,14 @@
11
# Format: //devtools/kokoro/config/proto/build.proto
22

33
# Build logs will be here
4-
action {
5-
define_artifacts {
6-
regex: "**/*sponge_log.xml"
7-
}
4+
# action {
5+
# define_artifacts {
6+
# regex: "**/*sponge_log.xml"
7+
# }
8+
# }
9+
10+
container_properties {
11+
docker_image: "us-central1-docker.pkg.dev/chingor-test/testing-images/python-multi@sha256:c6e49e2dabfb0a892f30fea57045575860f8804d8c838505341bb8e92f443705"
812
}
913

10-
# Download trampoline resources.
11-
gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/trampoline"
12-
13-
# Download resources for system tests (service account key, etc.)
14-
gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/google-cloud-python"
15-
16-
# Use the trampoline script to run in docker.
17-
build_file: "python-bigquery/.kokoro/trampoline.sh"
18-
19-
# Configure the docker image for kokoro-trampoline.
20-
env_vars: {
21-
key: "TRAMPOLINE_IMAGE"
22-
value: "gcr.io/cloud-devrel-kokoro-resources/python-multi"
23-
}
24-
env_vars: {
25-
key: "TRAMPOLINE_BUILD_FILE"
26-
value: "github/python-bigquery/.kokoro/build.sh"
27-
}
14+
build_file: "python-bigquery/.kokoro/build.sh"

.kokoro/presubmit/linting-typing.cfg

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1-
# Format: //devtools/kokoro/config/proto/build.proto
1+
# proto-file: //devtools/kokoro/config/proto/build.proto
2+
# proto-message: BuildConfig
23

34
# Only run these nox sessions.
45
env_vars: {
5-
key: "NOX_SESSION"
6-
value: "lint lint_setup_py blacken mypy mypy_samples pytype"
6+
key: "NOX_SESSION"
7+
value: "lint lint_setup_py blacken mypy mypy_samples pytype"
78
}

.kokoro/presubmit/prerelease-deps.cfg

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1-
# Format: //devtools/kokoro/config/proto/build.proto
1+
# proto-file: //devtools/kokoro/config/proto/build.proto
2+
# proto-message: BuildConfig
23

34
# Only run this nox session.
45
env_vars: {
5-
key: "NOX_SESSION"
6-
value: "prerelease_deps"
6+
key: "NOX_SESSION"
7+
value: "prerelease_deps"
78
}

.kokoro/presubmit/presubmit.cfg

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1-
# Format: //devtools/kokoro/config/proto/build.proto
1+
# proto-file: //devtools/kokoro/config/proto/build.proto
2+
# proto-message: BuildConfig
23

34
# Disable system tests.
45
env_vars: {
5-
key: "NOX_SESSION"
6-
value: "unit_noextras unit cover docs docfx"
6+
key: "NOX_SESSION"
7+
value: "unit_noextras unit cover docs docfx"
78
}

.kokoro/presubmit/snippets-3.12.cfg

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1-
# Format: //devtools/kokoro/config/proto/build.proto
1+
# proto-file: //devtools/kokoro/config/proto/build.proto
2+
# proto-message: BuildConfig
23

34
# Only run this nox session.
45
env_vars: {
5-
key: "NOX_SESSION"
6-
value: "snippets-3.12"
6+
key: "NOX_SESSION"
7+
value: "snippets-3.12"
78
}

.kokoro/presubmit/snippets-3.8.cfg

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1-
# Format: //devtools/kokoro/config/proto/build.proto
1+
# proto-file: //devtools/kokoro/config/proto/build.proto
2+
# proto-message: BuildConfig
23

34
# Only run this nox session.
45
env_vars: {
5-
key: "NOX_SESSION"
6-
value: "snippets-3.8"
6+
key: "NOX_SESSION"
7+
value: "snippets-3.8"
78
}

.kokoro/presubmit/system-3.12.cfg

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1-
# Format: //devtools/kokoro/config/proto/build.proto
1+
# proto-file: //devtools/kokoro/config/proto/build.proto
2+
# proto-message: BuildConfig
23

34
# Only run this nox session.
45
env_vars: {
5-
key: "NOX_SESSION"
6-
value: "system-3.12"
6+
key: "NOX_SESSION"
7+
value: "system-3.12"
78
}

.kokoro/presubmit/system-3.8.cfg

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1-
# Format: //devtools/kokoro/config/proto/build.proto
1+
# proto-file: //devtools/kokoro/config/proto/build.proto
2+
# proto-message: BuildConfig
23

34
# Only run this nox session.
45
env_vars: {
5-
key: "NOX_SESSION"
6-
value: "system-3.8"
6+
key: "NOX_SESSION"
7+
value: "system-3.8"
78
}

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy