Skip to content

Commit d4b324c

Browse files
committed
fix wd-test test coverage reporting
1 parent 87abde7 commit d4b324c

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

.github/workflows/_bazel.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,8 @@ jobs:
125125
run: |
126126
bazel --nowindows_enable_symlinks build ${{ inputs.extra_bazel_args }} --config=ci --profile build-win-workaround.bazel-profile.gz --remote_cache=https://bazel:${{ secrets.BAZEL_CACHE_KEY }}@bazel-remote-cache.devprod.cloudflare.dev //src/wpt:wpt-all@tsproject //src/node:node@tsproject //src/pyodide:pyodide_static@tsproject
127127
- name: Bazel build
128+
# Skip build step when running coverage - bazel coverage will build with instrumentation
129+
if: ${{ !inputs.run_coverage }}
128130
# timestamps are no longer being added here, the GitHub logs include timestamps (Use
129131
# 'Show timestamps' on the web interface)
130132
run: |

build/wd_test.bzl

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -282,11 +282,14 @@ _wd_test = rule(
282282
),
283283
# Source file
284284
"src": attr.label(allow_single_file = True),
285-
# The workerd executable is used to run all tests
285+
# The workerd executable is used to run all tests.
286+
# IMPORTANT: cfg must be "target" (not "exec") for coverage instrumentation to work.
287+
# When cfg="exec", the binary is built for the execution platform without coverage
288+
# instrumentation. Coverage instrumentation is only applied to target platform builds.
286289
"workerd": attr.label(
287290
allow_single_file = True,
288291
executable = True,
289-
cfg = "exec",
292+
cfg = "target",
290293
default = "//src/workerd/server:workerd_cross",
291294
),
292295
# A list of files that this test requires to be present in order to run.

0 commit comments

Comments
 (0)