Skip to content

Commit 32e35fe

Browse files
jskeetchalmerlowe
authored andcommitted
chore: redirect git clones to use local files in CI conditional tests (#16652)
Redirects git clones for core dependencies to the local repository for both performance (avoiding unnecessary cloning) and correctness (testing HEAD of everything).
1 parent a2556e8 commit 32e35fe

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

ci/run_conditional_tests.sh

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,14 @@ set -eo pipefail
3636
export PROJECT_ROOT=$(realpath $(dirname "${BASH_SOURCE[0]}")/..)
3737
TARGET_BRANCH="${TARGET_BRANCH:-main}"
3838

39+
# Redirect git clones for core dependencies to the local repository.
40+
# This serves two purposes:
41+
# 1. Performance: Avoids repeated 100MB+ downloads of the monorepo for each dependency.
42+
# 2. Correctness: Ensures that changes in core packages (like google-api-core) are
43+
# tested against downstream packages in the same Pull Request.
44+
git config --global url."${PROJECT_ROOT}".insteadOf "https://github.com/googleapis/google-cloud-python"
45+
git config --global url."${PROJECT_ROOT}".insteadOf "https://github.com/googleapis/google-cloud-python.git"
46+
3947
# A script file for running the test in a sub project.
4048
test_script="${PROJECT_ROOT}/ci/run_single_test.sh"
4149

0 commit comments

Comments
 (0)