@@ -3296,7 +3296,7 @@ EOF
32963296 //a:consumer >& $TEST_log || fail " Failed to build without remote cache"
32973297}
32983298
3299- function test_uploader_respsect_no_cache () {
3299+ function test_uploader_respect_no_cache () {
33003300 mkdir -p a
33013301 cat > a/BUILD << EOF
33023302genrule(
@@ -3318,7 +3318,7 @@ EOF
33183318 expect_log " command.profile.gz.*bytestream://" || fail " should upload profile data"
33193319}
33203320
3321- function test_uploader_respsect_no_cache_trees () {
3321+ function test_uploader_respect_no_cache_trees () {
33223322 mkdir -p a
33233323 cat > a/output_dir.bzl << 'EOF '
33243324def _gen_output_dir_impl(ctx):
@@ -3365,7 +3365,7 @@ EOF
33653365 expect_log " command.profile.gz.*bytestream://" || fail " should upload profile data"
33663366}
33673367
3368- function test_uploader_respsect_no_upload_results () {
3368+ function test_uploader_respect_no_upload_results () {
33693369 mkdir -p a
33703370 cat > a/BUILD << EOF
33713371genrule(
@@ -3387,7 +3387,7 @@ EOF
33873387 expect_log " command.profile.gz.*bytestream://" || fail " should upload profile data"
33883388}
33893389
3390- function test_uploader_respsect_no_upload_results_combined_cache () {
3390+ function test_uploader_respect_no_upload_results_combined_cache () {
33913391 mkdir -p a
33923392 cat > a/BUILD << EOF
33933393genrule(
@@ -3397,9 +3397,11 @@ genrule(
33973397)
33983398EOF
33993399
3400+ cache_dir=$( mktemp -d)
3401+
34003402 bazel build \
34013403 --remote_cache=grpc://localhost:${worker_port} \
3402- --disk_cache=" ${TEST_TMPDIR} /disk_cache " \
3404+ --disk_cache=$cache_dir \
34033405 --remote_upload_local_results=false \
34043406 --incompatible_remote_build_event_upload_respect_no_cache \
34053407 --build_event_json_file=bep.json \
@@ -3409,7 +3411,35 @@ EOF
34093411 expect_not_log " a:foo.*bytestream://" || fail " local files are converted"
34103412 expect_log " command.profile.gz.*bytestream://" || fail " should upload profile data"
34113413 remote_cas_files=" $( count_remote_cas_files) "
3412- [[ " $remote_cas_files " == 1 ]] || fail " Expected 1 remote action cache entries, not $remote_cas_files "
3414+ [[ " $remote_cas_files " == 1 ]] || fail " Expected 1 remote cas entries, not $remote_cas_files "
3415+ }
3416+
3417+ function test_uploader_ignore_disk_cache_of_combined_cache() {
3418+ mkdir -p a
3419+ cat > a/BUILD << EOF
3420+ genrule(
3421+ name = 'foo',
3422+ outs = ["foo.txt"],
3423+ cmd = "echo \"foo bar\" > \$ @",
3424+ tags = ["no-cache"],
3425+ )
3426+ EOF
3427+
3428+ cache_dir=$( mktemp -d)
3429+
3430+ bazel build \
3431+ --remote_cache=grpc://localhost:${worker_port} \
3432+ --disk_cache=$cache_dir \
3433+ --incompatible_remote_build_event_upload_respect_no_cache \
3434+ --build_event_json_file=bep.json \
3435+ //a:foo >& $TEST_log || fail " Failed to build"
3436+
3437+ cat bep.json > $TEST_log
3438+ expect_not_log " a:foo.*bytestream://" || fail " local files are converted"
3439+ expect_log " command.profile.gz.*bytestream://" || fail " should upload profile data"
3440+
3441+ disk_cas_files=" $( count_disk_cas_files $cache_dir ) "
3442+ [[ " $disk_cas_files " == 0 ]] || fail " Expected 0 disk cas entries, not $disk_cas_files "
34133443}
34143444
34153445run_suite " Remote execution and remote cache tests"
0 commit comments