diff --git a/src/test/shell/bazel/bazel_coverage_cc_test_llvm.sh b/src/test/shell/bazel/bazel_coverage_cc_test_llvm.sh index 7664558bb60cb4..eeaa248dbe5f6b 100755 --- a/src/test/shell/bazel/bazel_coverage_cc_test_llvm.sh +++ b/src/test/shell/bazel/bazel_coverage_cc_test_llvm.sh @@ -138,7 +138,10 @@ function test_cc_test_llvm_coverage_produces_lcov_report() { setup_llvm_coverage_tools_for_lcov || return 0 setup_a_cc_lib_and_t_cc_test - bazel coverage --test_output=all //:t &>$TEST_log || fail "Coverage for //:t failed" + # Ensure that coverage succeeds even with lazily built runfiles trees for the + # merger tool. + bazel coverage --nobuild_runfile_links \ + --test_output=all //:t &>$TEST_log || fail "Coverage for //:t failed" local expected_result="SF:a.cc FN:3,_Z1ab @@ -163,7 +166,10 @@ function test_cc_test_llvm_coverage_produces_lcov_report_with_split_postprocessi setup_llvm_coverage_tools_for_lcov || return 0 setup_a_cc_lib_and_t_cc_test + # Ensure that coverage succeeds even with lazily built runfiles trees for the + # merger tool. bazel coverage \ + --nobuild_runfile_links \ --experimental_split_coverage_postprocessing --experimental_fetch_all_coverage_outputs \ --test_env=VERBOSE_COVERAGE=1 --test_output=all //:t &>$TEST_log || fail "Coverage for //:t failed" diff --git a/src/test/shell/bazel/bazel_coverage_java_test.sh b/src/test/shell/bazel/bazel_coverage_java_test.sh index b1a98947eb2e11..1f94464552eeff 100755 --- a/src/test/shell/bazel/bazel_coverage_java_test.sh +++ b/src/test/shell/bazel/bazel_coverage_java_test.sh @@ -192,7 +192,11 @@ public class TestCollatz { } EOF - bazel coverage --test_output=all //:test --coverage_report_generator=@bazel_tools//tools/test:coverage_report_generator --combined_report=lcov &>$TEST_log \ + # Ensure that coverage succeeds even with lazily built runfiles trees for the + # merger tool. + bazel coverage \ + --nobuild_runfile_links \ + --test_output=all //:test --coverage_report_generator=@bazel_tools//tools/test:coverage_report_generator --combined_report=lcov &>$TEST_log \ || echo "Coverage for //:test failed" local expected_result="SF:src/main/com/example/Collatz.java