Allow using a shared repository cache and install base for our integration tests.
This change doesn't do anything (besides printing a message) unless you run Bazel's tests with the new environment variables.
The environment variables will be set to appropriate platform-specific values by the CI scripts.
@@ -286,6 +286,21 @@ common --color=no --curses=no
${EXTRA_BAZELRC:-}
EOF
+
+ if [[ -d ${REPOSITORY_CACHE:-} ]]; then
+ echo "testenv.sh: Using repository cache at $REPOSITORY_CACHE."
+ cat >>$TEST_TMPDIR <<EOF
+sync --repository_cache=$REPOSITORY_CACHE --experimental_repository_cache_hardlinks
+fetch --repository_cache=$REPOSITORY_CACHE --experimental_repository_cache_hardlinks
+build --repository_cache=$REPOSITORY_CACHE --experimental_repository_cache_hardlinks
+query --repository_cache=$REPOSITORY_CACHE --experimental_repository_cache_hardlinks
+EOF
+ fi
+
+ if [[ -d ${INSTALL_BASE:-} ]]; then
+ echo "testenv.sh: Using shared install base at $INSTALL_BASE."
+ echo "startup --install_base=$INSTALL_BASE" >> $TEST_TMPDIR/bazelrc
+ fi
}
function setup_android_sdk_support() {
