Skip to content

coverage fix - #165

Merged
MaximilianSoerenPollak merged 2 commits into
mainfrom
dcalavrezo_coverage_build_tests_only
Jul 29, 2026
Merged

MaximilianSoerenPollak merged 2 commits into
mainfrom
dcalavrezo_coverage_build_tests_only

Conversation

@dcalavrezo-qorix

Copy link
Copy Markdown
Contributor

pass --build_tests_only to bazel coverage

Test language/tag filters only control which tests RUN - with wildcard
target patterns, bazel coverage still BUILDS filtered-out test targets.
This broke consumers with Miri tests once score_toolchains_rust 0.9.2
enabled Rust coverage instrumentation: the Miri test subgraph is
compiled against the Miri sysroot, which does not ship the
profiler_builtins crate that instrumented compiles require
(error[E0463], aborting the whole coverage invocation and killing
in-flight C++ tests).

With --build_tests_only the filters apply to building as well, so
excluded tests are neither run nor built. Verified on
eclipse-score/lifecycle#369: without the flag the job fails at 16/19
tests; with it, exit 0 and 19/19 tests pass.****

Test language/tag filters only control which tests RUN - with wildcard
target patterns, bazel coverage still BUILDS filtered-out test targets.
This broke consumers with Miri tests once score_toolchains_rust 0.9.2
enabled Rust coverage instrumentation: the Miri test subgraph is
compiled against the Miri sysroot, which does not ship the
profiler_builtins crate that instrumented compiles require
(error[E0463], aborting the whole coverage invocation and killing
in-flight C++ tests).

With --build_tests_only the filters apply to building as well, so
excluded tests are neither run nor built. Verified on
eclipse-score/lifecycle#369: without the flag the job fails at 16/19
tests; with it, exit 0 and 19/19 tests pass.

Fixes #164
Same hardening as cpp-coverage (see #164): make consumers'
--test_lang_filters/--test_tag_filters apply to building as well, so
filtered-out tests (e.g. Miri targets, whose Miri-sysroot compiles
fail under coverage instrumentation) are neither run nor built.

Consumers that already pass --build_tag_filters (e.g. lifecycle's rust
job with -miri,-loom) are unaffected; this protects the ones relying
on test filters alone.

Refs #164
@MaximilianSoerenPollak
MaximilianSoerenPollak merged commit 4c20f0d into main Jul 29, 2026
4 checks passed
@MaximilianSoerenPollak
MaximilianSoerenPollak deleted the dcalavrezo_coverage_build_tests_only branch July 29, 2026 08:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Development

Successfully merging this pull request may close these issues.

2 participants