Skip to content
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
6 changes: 6 additions & 0 deletions .kokoro/python3.6/common.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,12 @@ env_vars: {
value: "python-docs-samples-tests-py36"
}

# Number of test workers.
env_vars: {
key: "NUM_TEST_WORKERS"
value: "10"
}

env_vars: {
key: "TRAMPOLINE_DOCKERFILE"
value: ".kokoro/docker/Dockerfile"
Expand Down
6 changes: 6 additions & 0 deletions .kokoro/python3.7/common.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,12 @@ env_vars: {
value: "python-docs-samples-tests-py37"
}

# Number of test workers.
env_vars: {
key: "NUM_TEST_WORKERS"
value: "10"
}

env_vars: {
key: "TRAMPOLINE_DOCKERFILE"
value: ".kokoro/docker/Dockerfile"
Expand Down
6 changes: 6 additions & 0 deletions .kokoro/python3.8/common.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,12 @@ env_vars: {
value: "python-docs-samples-tests-py38"
}

# Number of test workers.
env_vars: {
key: "NUM_TEST_WORKERS"
value: "10"
}

env_vars: {
key: "TRAMPOLINE_DOCKERFILE"
value: ".kokoro/docker/Dockerfile"
Expand Down
22 changes: 20 additions & 2 deletions .kokoro/tests/run_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,19 @@ if [[ $* == *--only-diff-head* ]]; then
fi
fi

# Because Kokoro runs presubmit builds simalteneously, we often see
# quota related errors. I think we can avoid this by changing the
# order of tests to execute (e.g. reverse order for py-3.8
# build). Currently there's no easy way to do that with btlr, so we
# temporarily wait few minutes to avoid quota issue for py-3.8
# presubmit build.
if [[ "${RUN_TESTS_SESSION}" == "py-3.8" ]] \
&& [[ "${KOKORO_JOB_NAME}" == *presubmit ]]; then
echo -n "Detected py-3.8 presubmit build,"
echo "Wait few minutes to avoid quota issues."
sleep 5m
fi

if [[ -z "${PROJECT_ROOT:-}" ]]; then
PROJECT_ROOT="github/python-docs-samples"
fi
Expand Down Expand Up @@ -108,10 +121,15 @@ test_prog="${PROJECT_ROOT}/.kokoro/tests/run_single_test.sh"
btlr_args=(
"run"
"**/requirements.txt"
"--max-concurrency"
"30"
)

if [[ -n "${NUM_TEST_WORKERS:-}" ]]; then
btlr_args+=(
"--max-concurrency"
"${NUM_TEST_WORKERS}"
)
fi

if [[ -n "${DIFF_FROM:-}" ]]; then
btlr_args+=(
"--git-diff"
Expand Down