diff --git a/.bazelci/presubmit.yml b/.bazelci/presubmit.yml index 3de2198724..9e9665befa 100644 --- a/.bazelci/presubmit.yml +++ b/.bazelci/presubmit.yml @@ -58,6 +58,8 @@ tasks: - sed -i 's/^# rbe_preconfig/rbe_preconfig/' WORKSPACE.bazel build_targets: *default_linux_targets test_targets: *default_linux_targets + coverage_targets: *default_linux_targets + post_shell_commands: *coverage_validation_post_shell_commands macos: build_targets: *default_macos_targets test_targets: *default_macos_targets @@ -122,6 +124,8 @@ tasks: build_flags: *aspects_flags build_targets: *default_linux_targets test_targets: *default_linux_targets + coverage_targets: *default_linux_targets + post_shell_commands: *coverage_validation_post_shell_commands rbe_ubuntu2004_rolling_with_aspects: name: RBE Rolling Bazel Version With Aspects platform: rbe_ubuntu2004 @@ -130,6 +134,8 @@ tasks: - sed -i 's/^# rbe_preconfig/rbe_preconfig/' WORKSPACE.bazel build_targets: *default_linux_targets test_targets: *default_linux_targets + coverage_targets: *default_linux_targets + post_shell_commands: *coverage_validation_post_shell_commands build_flags: *aspects_flags soft_fail: yes bazel: "rolling" diff --git a/.bazelrc b/.bazelrc index 00e698c685..0e44097c15 100644 --- a/.bazelrc +++ b/.bazelrc @@ -19,6 +19,11 @@ coverage --combined_report=lcov # Avoid fully cached builds reporting no coverage and failing CI # https://bazel.build/reference/command-line-reference#flag--experimental_fetch_all_coverage_outputs coverage --experimental_fetch_all_coverage_outputs +coverage --experimental_split_coverage_postprocessing +coverage --remote_download_toplevel +coverage --test_env=VERBOSE_COVERAGE=1 +coverage --test_env=RUST_BACKTRACE=1 +coverage --test_output=errors ############################################################################### ## Unique configuration groups diff --git a/rust/settings/BUILD.bazel b/rust/settings/BUILD.bazel index f1ba202552..317a30e3fb 100644 --- a/rust/settings/BUILD.bazel +++ b/rust/settings/BUILD.bazel @@ -62,7 +62,7 @@ bool_flag( # reporting tools like `llvm-cov` and `llvm-profdata` as runfiles to each test. bool_flag( name = "experimental_use_coverage_metadata_files", - build_setting_default = False, + build_setting_default = True, ) # A flag to set rustc --sysroot flag to the sysroot generated by rust_toolchain