From 18467702ae0dc361337322d4d73af638aae027f4 Mon Sep 17 00:00:00 2001 From: Dan Calavrezo <195309321+dcalavrezo-qorix@users.noreply.github.com> Date: Tue, 29 Sep 2026 14:22:39 +0300 Subject: [PATCH 1/4] Migrate coverage pipeline to score_coverage 0.3.0 The LLVM coverage pipeline under @score_tooling//coverage moved to its own qualified module, score_coverage (eclipse-score/coverage_tool, TCL LOW). Switch the labels one-to-one, add the module as a dev dependency and bump rules_rust to 0.68.2-score, which the module requires. Scope, config and workflow are otherwise unchanged; the report archive keeps its name for docs.yml. Local comparison, //score/... (37 tests), old pipeline vs this commit, LCOV compared record by record: files in report 99 -> 117 (18 headers added, see below) identical status 98 of 99 common files raw line coverage 85.58 % -> 84.63 % raw branch coverage 78.65 % -> 78.70 % The 18 added files are datarouter headers under include/ and the score_log_bridge_cpp_init ffi.rs, which the old pipeline dropped (headers reached through include directories); each has one row in the HTML index and its link resolves. The lower line percentage comes from those headers. The one status difference, message_passing_server.cpp lines 293-313, is the peer-closed-while- ticking path between LCOV_EXCL markers, which depends on thread timing and was hit in the second run only. Tracking: eclipse-score/score#3258 Signed-off-by: Dan Calavrezo <195309321+dcalavrezo-qorix@users.noreply.github.com> --- .bazelrc | 2 +- .github/workflows/coverage_report.yml | 4 ++-- MODULE.bazel | 10 +++++++--- MODULE.bazel.lock | 2 ++ quality/coverage/BUILD | 4 ++-- quality/coverage/coverage.bazelrc | 5 +++-- 6 files changed, 17 insertions(+), 10 deletions(-) diff --git a/.bazelrc b/.bazelrc index c80d8457..35e263b5 100644 --- a/.bazelrc +++ b/.bazelrc @@ -160,5 +160,5 @@ test:clang-tidy --extra_toolchains=@llvm_toolchain//:cc-toolchain-x86_64-linux test:clang-tidy --copt=-Wno-unused-command-line-argument # Unified LLVM source-based coverage (C++ + Rust), see quality/coverage/ and -# @score_tooling//coverage. Use: bazel coverage --config=llvm_cov //score/... --build_tests_only +# @score_coverage. Use: bazel coverage --config=llvm_cov //score/... --build_tests_only import %workspace%/quality/coverage/coverage.bazelrc diff --git a/.github/workflows/coverage_report.yml b/.github/workflows/coverage_report.yml index 60bd7b23..5d46971c 100644 --- a/.github/workflows/coverage_report.yml +++ b/.github/workflows/coverage_report.yml @@ -46,7 +46,7 @@ jobs: repository-cache: true cache-save: ${{ github.event_name == 'push' }} - # Unified LLVM source-based coverage (C++ + Rust) from @score_tooling//coverage, + # Unified LLVM source-based coverage (C++ + Rust) from @score_coverage, # see quality/coverage/. Integration tests need docker/QNX and are excluded via # the llvm_cov config's test tag filter. - name: Run coverage @@ -63,7 +63,7 @@ jobs: COVERAGE_THRESHOLD: "0" run: | set -euo pipefail - bazel run --lockfile_mode=error @score_tooling//coverage:generate_coverage_html -- \ + bazel run --lockfile_mode=error @score_coverage//:generate_coverage_html -- \ --testlogs-subdir score \ --archive-dir coverage_artifact diff --git a/MODULE.bazel b/MODULE.bazel index 6922526b..1c19a351 100644 --- a/MODULE.bazel +++ b/MODULE.bazel @@ -18,7 +18,7 @@ module( # Bazel global rules bazel_dep(name = "rules_python", version = "1.8.5") bazel_dep(name = "bazel_skylib", version = "1.9.0") -bazel_dep(name = "rules_rust", version = "0.68.1-score") +bazel_dep(name = "rules_rust", version = "0.68.2-score") bazel_dep(name = "rules_cc", version = "0.2.17") bazel_dep(name = "aspect_rules_lint", version = "2.5.0") @@ -38,6 +38,10 @@ bazel_dep(name = "platforms", version = "1.1.0") bazel_dep(name = "score_bazel_platforms", version = "1.1.0") bazel_dep(name = "score_docs_as_code", version = "8.2.0") bazel_dep(name = "score_tooling", version = "2.2.0") + +# LLVM source-based coverage pipeline (C++ + Rust): the qualified S-CORE +# coverage tool, successor of @score_tooling//coverage. See quality/coverage/. +bazel_dep(name = "score_coverage", version = "0.3.0", dev_dependency = True) bazel_dep(name = "score_rust_policies", version = "0.0.5") bazel_dep(name = "score_process_description", version = "2.1.2") bazel_dep(name = "score_platform", version = "0.7.2") @@ -151,13 +155,13 @@ llvm.toolchain( ) # Coverage-only Clang instance (covmap instrumentation for the LLVM coverage -# pipeline from @score_tooling//coverage; active only under --config=llvm_cov). +# pipeline from @score_coverage; active only under --config=llvm_cov). # Separate from the 19.1.7 instance above so clang-tidy behavior is untouched. llvm.toolchain( name = "llvm_toolchain_coverage", cxx_standard = {"": "c++17"}, extra_known_features = [ - "@score_tooling//coverage:enable_llvm_coverage_for_death_tests", + "@score_coverage//:enable_llvm_coverage_for_death_tests", ], link_libs = {"": [ "-lrt", diff --git a/MODULE.bazel.lock b/MODULE.bazel.lock index e00fc1bb..c04dbbcf 100644 --- a/MODULE.bazel.lock +++ b/MODULE.bazel.lock @@ -1030,6 +1030,8 @@ "https://raw.githubusercontent.com/eclipse-score/bazel_registry/main/modules/score_bazel_platforms/1.1.0/source.json": "9797d56e9dd68e9d3e8b674402df2d6d5e2174f84184ca4cbee78fc07dc117d9", "https://raw.githubusercontent.com/eclipse-score/bazel_registry/main/modules/score_communication/0.4.0/MODULE.bazel": "19e98105c4b1ca674027dfa4c5010eebbdf74d7cbd9524cb84a8fad63a8bcebe", "https://raw.githubusercontent.com/eclipse-score/bazel_registry/main/modules/score_communication/0.4.0/source.json": "a3378155debe445305828cfa94464ad5f53d5b7e27488b3c053b02e49801aaeb", + "https://raw.githubusercontent.com/eclipse-score/bazel_registry/main/modules/score_coverage/0.3.0/MODULE.bazel": "6c64ebf6d6bba825ac8c51222436218e25f9e6ec3095fa89e66afc52d3eda8fd", + "https://raw.githubusercontent.com/eclipse-score/bazel_registry/main/modules/score_coverage/0.3.0/source.json": "c0a23ae5848f4dab64b1220fa1b2487f6f965f7e8605dbee5ff5e76aa4e4bdd8", "https://raw.githubusercontent.com/eclipse-score/bazel_registry/main/modules/score_cr_checker/0.2.2/MODULE.bazel": "dc36d9c35543db918c3fb5b93a8e684431f56c7c784cf2a1b90f35802a373c98", "https://raw.githubusercontent.com/eclipse-score/bazel_registry/main/modules/score_cr_checker/0.3.1/MODULE.bazel": "f49e037d7fbc0b2a8b2734fc6b47334e8cc8589ca7a5aa0f3ccca85cc5f79fac", "https://raw.githubusercontent.com/eclipse-score/bazel_registry/main/modules/score_crates/0.0.10/MODULE.bazel": "80599c71cfc5827a189ab40fe2f320c8f52e0fca5bcc7c8bf8bfbdead7f97a74", diff --git a/quality/coverage/BUILD b/quality/coverage/BUILD index 93b5ef6d..e71e4aba 100644 --- a/quality/coverage/BUILD +++ b/quality/coverage/BUILD @@ -11,7 +11,7 @@ # SPDX-License-Identifier: Apache-2.0 # ******************************************************************************* -load("@score_tooling//coverage:defs.bzl", "score_coverage_reporter", "score_coverage_scope") +load("@score_coverage//:defs.bzl", "score_coverage_reporter", "score_coverage_scope") # The production components of this module — the same scope the previous gcov # configuration expressed as an instrumentation filter (//score/datarouter, @@ -23,7 +23,7 @@ load("@score_tooling//coverage:defs.bzl", "score_coverage_reporter", "score_cove # # KNOWN GAP: the cc_binary entry-point sources of //score/datarouter:datarouter # (main) are not collected — cc_binary provides no CcInfo for the scope aspect; -# its library deps are. Tracked as a scope-aspect enhancement in score_tooling. +# its library deps are. Tracked as a scope-aspect enhancement in score_coverage. score_coverage_scope( name = "coverage_scope", testonly = True, diff --git a/quality/coverage/coverage.bazelrc b/quality/coverage/coverage.bazelrc index 46da9ece..a140cdfb 100644 --- a/quality/coverage/coverage.bazelrc +++ b/quality/coverage/coverage.bazelrc @@ -13,7 +13,8 @@ # ============================================================================ # LLVM source-based coverage (Linux, Clang covmap + Ferrocene) — C++ and Rust -# Pipeline: @score_tooling//coverage (see its README.md for the guide). +# Pipeline: @score_coverage (the qualified S-CORE coverage tool), guide: +# https://eclipse-score.github.io/coverage_tool/main/manual/user_manual.html # Use with: bazel coverage --config=llvm_cov //score/... --build_tests_only # # Do NOT combine with --config=x86_64-linux: it registers the GCC toolchain, @@ -42,7 +43,7 @@ coverage:llvm_cov --extra_toolchains=@llvm_toolchain_coverage//:cc-toolchain-x86 # so it is registered here explicitly. coverage:llvm_cov --extra_toolchains=@score_toolchains_rust//toolchains/ferrocene:ferrocene_x86_64_unknown_linux_gnu -coverage:llvm_cov --coverage_output_generator=@score_tooling//coverage:merger +coverage:llvm_cov --coverage_output_generator=@score_coverage//:merger coverage:llvm_cov --coverage_report_generator=//quality/coverage:reporter_wrapper # Keep raw profraw files; the merger handles profraw -> profdata directly. From 506e79ed8624b0b8d777c2253112c0d133a773fd Mon Sep 17 00:00:00 2001 From: Dan Calavrezo <195309321+dcalavrezo-qorix@users.noreply.github.com> Date: Tue, 29 Sep 2026 16:30:02 +0300 Subject: [PATCH 2/4] Set the instrumentation filter explicitly Bazel guesses --instrumentation_filter from the packages of the test targets and strips only a trailing /tests; a library tested from a test/ subpackage is compiled without counters unless one of its deps is instrumented. Name the whole module, as the score_coverage manual now requires (0.3.1). Signed-off-by: Dan Calavrezo <195309321+dcalavrezo-qorix@users.noreply.github.com> --- quality/coverage/coverage.bazelrc | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/quality/coverage/coverage.bazelrc b/quality/coverage/coverage.bazelrc index a140cdfb..8ace8618 100644 --- a/quality/coverage/coverage.bazelrc +++ b/quality/coverage/coverage.bazelrc @@ -23,6 +23,11 @@ # ============================================================================ coverage:llvm_cov --nocache_test_results +# Instrument everything under //score. Left unset, Bazel guesses the filter +# from the packages of the test targets (stripping only a trailing "/tests"); +# a library tested from a "test" subpackage is then compiled without counters +# unless one of its deps happens to be instrumented (score_coverage 0.3.1). +coverage:llvm_cov --instrumentation_filter=^//score[/:] coverage:llvm_cov --cxxopt=-O0 coverage:llvm_cov --combined_report=lcov coverage:llvm_cov --experimental_fetch_all_coverage_outputs From 9b52e95a1eaa452ad33cdf85e4bc7a0851e67aeb Mon Sep 17 00:00:00 2001 From: Dan Calavrezo <195309321+dcalavrezo-qorix@users.noreply.github.com> Date: Tue, 29 Sep 2026 16:56:47 +0300 Subject: [PATCH 3/4] Bump score_coverage to 0.3.1 0.3.1 requires the explicit --instrumentation_filter this branch already sets, and warns when a report shows the pattern of a library tested from a test/ subpackage without data. Signed-off-by: Dan Calavrezo <195309321+dcalavrezo-qorix@users.noreply.github.com> --- MODULE.bazel | 2 +- MODULE.bazel.lock | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/MODULE.bazel b/MODULE.bazel index 1c19a351..0c11b597 100644 --- a/MODULE.bazel +++ b/MODULE.bazel @@ -41,7 +41,7 @@ bazel_dep(name = "score_tooling", version = "2.2.0") # LLVM source-based coverage pipeline (C++ + Rust): the qualified S-CORE # coverage tool, successor of @score_tooling//coverage. See quality/coverage/. -bazel_dep(name = "score_coverage", version = "0.3.0", dev_dependency = True) +bazel_dep(name = "score_coverage", version = "0.3.1", dev_dependency = True) bazel_dep(name = "score_rust_policies", version = "0.0.5") bazel_dep(name = "score_process_description", version = "2.1.2") bazel_dep(name = "score_platform", version = "0.7.2") diff --git a/MODULE.bazel.lock b/MODULE.bazel.lock index c04dbbcf..756342ff 100644 --- a/MODULE.bazel.lock +++ b/MODULE.bazel.lock @@ -1030,8 +1030,8 @@ "https://raw.githubusercontent.com/eclipse-score/bazel_registry/main/modules/score_bazel_platforms/1.1.0/source.json": "9797d56e9dd68e9d3e8b674402df2d6d5e2174f84184ca4cbee78fc07dc117d9", "https://raw.githubusercontent.com/eclipse-score/bazel_registry/main/modules/score_communication/0.4.0/MODULE.bazel": "19e98105c4b1ca674027dfa4c5010eebbdf74d7cbd9524cb84a8fad63a8bcebe", "https://raw.githubusercontent.com/eclipse-score/bazel_registry/main/modules/score_communication/0.4.0/source.json": "a3378155debe445305828cfa94464ad5f53d5b7e27488b3c053b02e49801aaeb", - "https://raw.githubusercontent.com/eclipse-score/bazel_registry/main/modules/score_coverage/0.3.0/MODULE.bazel": "6c64ebf6d6bba825ac8c51222436218e25f9e6ec3095fa89e66afc52d3eda8fd", - "https://raw.githubusercontent.com/eclipse-score/bazel_registry/main/modules/score_coverage/0.3.0/source.json": "c0a23ae5848f4dab64b1220fa1b2487f6f965f7e8605dbee5ff5e76aa4e4bdd8", + "https://raw.githubusercontent.com/eclipse-score/bazel_registry/main/modules/score_coverage/0.3.1/MODULE.bazel": "e11bb5c649f1c42b2e6933d0c297cb44c45d806d61d9fa71b1185830d284edac", + "https://raw.githubusercontent.com/eclipse-score/bazel_registry/main/modules/score_coverage/0.3.1/source.json": "328c3bb04ec50bb2cbd81070af41ac7247022cb006724340e251c73159e369b4", "https://raw.githubusercontent.com/eclipse-score/bazel_registry/main/modules/score_cr_checker/0.2.2/MODULE.bazel": "dc36d9c35543db918c3fb5b93a8e684431f56c7c784cf2a1b90f35802a373c98", "https://raw.githubusercontent.com/eclipse-score/bazel_registry/main/modules/score_cr_checker/0.3.1/MODULE.bazel": "f49e037d7fbc0b2a8b2734fc6b47334e8cc8589ca7a5aa0f3ccca85cc5f79fac", "https://raw.githubusercontent.com/eclipse-score/bazel_registry/main/modules/score_crates/0.0.10/MODULE.bazel": "80599c71cfc5827a189ab40fe2f320c8f52e0fca5bcc7c8bf8bfbdead7f97a74", From 0e9ff65f4fab568c942b1245a70458aac09ab5b7 Mon Sep 17 00:00:00 2001 From: Dan Calavrezo <195309321+dcalavrezo-qorix@users.noreply.github.com> Date: Tue, 29 Sep 2026 17:05:33 +0300 Subject: [PATCH 4/4] Format MODULE.bazel with bazel mod tidy Signed-off-by: Dan Calavrezo <195309321+dcalavrezo-qorix@users.noreply.github.com> --- MODULE.bazel | 1 + 1 file changed, 1 insertion(+) diff --git a/MODULE.bazel b/MODULE.bazel index 0c11b597..3cf186d7 100644 --- a/MODULE.bazel +++ b/MODULE.bazel @@ -42,6 +42,7 @@ bazel_dep(name = "score_tooling", version = "2.2.0") # LLVM source-based coverage pipeline (C++ + Rust): the qualified S-CORE # coverage tool, successor of @score_tooling//coverage. See quality/coverage/. bazel_dep(name = "score_coverage", version = "0.3.1", dev_dependency = True) + bazel_dep(name = "score_rust_policies", version = "0.0.5") bazel_dep(name = "score_process_description", version = "2.1.2") bazel_dep(name = "score_platform", version = "0.7.2")