Skip to content

Commit

Permalink
Use disk cache in //src/test/shell/bazel:bazel_proto_library_test
Browse files Browse the repository at this point in the history
This should reduce the amount of time spent compiling protobuf

PiperOrigin-RevId: 691577804
Change-Id: I86cf7f901b8cc68ab6b493d55c40165ee2aa0189
  • Loading branch information
meteorcloudy authored and copybara-github committed Oct 30, 2024
1 parent 6a62098 commit 652f83e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/test/shell/bazel/bazel_proto_library_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ source "${CURRENT_DIR}/../integration_test_setup.sh" \

function set_up() {
add_protobuf "MODULE.bazel"
# Enable disk cache to avoid compiling protobuf for each test.
enable_disk_cache
}

# Creates directories and files with the structure:
Expand Down
4 changes: 4 additions & 0 deletions src/test/shell/testenv.sh
Original file line number Diff line number Diff line change
Expand Up @@ -364,6 +364,10 @@ EOF
fi
}

function enable_disk_cache() {
echo "common --disk_cache=$TEST_TMPDIR/disk_cache" >> $TEST_TMPDIR/bazelrc
}

function setup_android_sdk_support() {
# Required for runfiles library on Windows, since $(rlocation) lookups
# can't do directories. We use android-28's android.jar as the anchor
Expand Down

0 comments on commit 652f83e

Please sign in to comment.