From a169a4820561ae99105da26d3c54aea045e9381b Mon Sep 17 00:00:00 2001 From: Fabian Meumertzheim Date: Thu, 24 Oct 2024 18:47:55 +0200 Subject: [PATCH] Verify that the compact execlog supports `bazel coverage` --- src/test/shell/bazel/bazel_execlog_test.sh | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/src/test/shell/bazel/bazel_execlog_test.sh b/src/test/shell/bazel/bazel_execlog_test.sh index 660fb1639d2293..b2418a5fa2fd72 100755 --- a/src/test/shell/bazel/bazel_execlog_test.sh +++ b/src/test/shell/bazel/bazel_execlog_test.sh @@ -203,6 +203,27 @@ EOF [[ -e ../output.compact ]] || fail "no compact log produced" } +function test_coverage() { + cat > BUILD <<'EOF' +sh_test( + name = "test", + srcs = ["test.sh"], +) +EOF + cat > test.sh <<'EOF' +echo "hello world" +EOF + chmod +x test.sh + + bazel coverage //:test --execution_log_compact_file=output.compact >> $TEST_log 2>&1 || fail "coverage failed" + [[ -e output.compact ]] || fail "no compact log produced" + + rm output.compact + bazel coverage //:test --experimental_split_coverage_postprocessing --experimental_fetch_all_coverage_outputs \ + --execution_log_compact_file=output.compact >> $TEST_log 2>&1 || fail "coverage failed" + [[ -e output.compact ]] || fail "no compact log produced" +} + function test_no_remote_cache() { cat > BUILD <<'EOF' genrule(