Skip to content

Commit dc36dc0

Browse files
fix: drop ref_int-specific --config flags when running bazel coverage
1 parent 95943f3 commit dc36dc0

1 file changed

Lines changed: 19 additions & 2 deletions

File tree

scripts/quality_runners.py

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,14 +54,31 @@ def run_unit_test_with_coverage(module: Module, workspace: Path | None = None) -
5454
in_module = workspace is not None
5555
repo = "" if in_module else f"@{module.name}"
5656

57+
# --config=unit-tests is defined as "test:unit-tests" in ref_int's .bazelrc,
58+
# so Bazel ignores it for the "coverage" command and the module's .bazelrc has no
59+
# such entry at all. --config=ferrocene-coverage references @score_tooling which
60+
# is not in the module's own dep graph. Both are ref_int-specific; expand them to
61+
# their individual flags when running inside a module checkout.
62+
if in_module:
63+
config_flags = [
64+
"--build_tests_only",
65+
"--test_tag_filters=-manual",
66+
]
67+
else:
68+
config_flags = [
69+
"--config=unit-tests",
70+
"--config=ferrocene-coverage",
71+
]
72+
5773
call = (
5874
[
5975
"bazel",
6076
"coverage", # Call coverage instead of test to get .dat files already
6177
"--test_verbose_timeout_warnings",
6278
"--test_timeout=1200",
63-
"--config=unit-tests",
64-
"--config=ferrocene-coverage",
79+
]
80+
+ config_flags
81+
+ [
6582
"--test_summary=testcase",
6683
"--test_output=errors",
6784
"--nocache_test_results",

0 commit comments

Comments
 (0)