Skip to content

Commit

Permalink
[8.0.0] Verify that the compact execlog supports bazel coverage (#2…
Browse files Browse the repository at this point in the history
…4115)

Related to #24061, which doesn't affect Bazel 8

Closes #24083.

PiperOrigin-RevId: 690535547
Change-Id: I25644d798a33ff0d6c90510fbcebf1bbbc332d40

Commit
fc27990

Co-authored-by: Fabian Meumertzheim <fabian@meumertzhe.im>
  • Loading branch information
bazel-io and fmeum authored Oct 29, 2024
1 parent 6774aac commit 352b5fd
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 352b5fd

Please sign in to comment.