Skip to content

Commit

Permalink
Verify that the compact execlog supports bazel coverage
Browse files Browse the repository at this point in the history
Related to bazelbuild#24061, which doesn't affect Bazel 8

Closes bazelbuild#24083.

PiperOrigin-RevId: 690535547
Change-Id: I25644d798a33ff0d6c90510fbcebf1bbbc332d40
  • Loading branch information
fmeum authored and bazel-io committed Oct 28, 2024
1 parent 57ce6a4 commit f6544a7
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions src/test/shell/bazel/bazel_execlog_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down

0 comments on commit f6544a7

Please sign in to comment.