Skip to content

coverage: adopt the LLVM coverage pipeline from score_tooling 2.2.0 - #282

Merged
rmaddikery merged 6 commits into
mainfrom
dcalavrezo_llvm_coverage
Aug 28, 2026
Merged

coverage: adopt the LLVM coverage pipeline from score_tooling 2.2.0#282
rmaddikery merged 6 commits into
mainfrom
dcalavrezo_llvm_coverage

Conversation

@dcalavrezo-qorix

@dcalavrezo-qorix dcalavrezo-qorix commented Aug 27, 2026

Copy link
Copy Markdown
Contributor

Summary

Adopt the unified LLVM source-based coverage pipeline from score_tooling 2.2.0 (@score_tooling//coverage), replacing the gcov-based cpp-coverage reusable. Same migration as eclipse-score/persistency#380, eclipse-score/time#186 and qorix_middleware.

  • One llvm-cov report for C++ and Rust (line and branch) — the Rust bridge crate is covered for the first time (it was outside the old C++-only flow).
  • Exact 0% entries for untested in-scope files via the --empty-profile baseline (2 surfaced immediately, incl. the 30-line score_log_bridge_init.cpp).
  • Markdown job summary on the run page (GITHUB_STEP_SUMMARY, score_tooling 2.2.0): overall/per-directory tables, least-covered and 0% file lists.
  • Report-only threshold (COVERAGE_THRESHOLD: "0") — the previous workflow had no gate either; ratchet upward as tests/justifications land.

Changes

  • quality/coverage/: score_coverage_scope over the module's components — //score/mw/log:log (facade, pulls in the backends it wires), backend:custom, the Rust bridge crate + its C++ init library, and the datarouter daemon (walks its application libraries). Same scope the old --instrumentation_filter expressed. backend:slog is QNX-only and cannot be measured on the Linux host (on-target coverage: coverage: on-target (QNX) coverage support in the shared coverage module tooling#427). Plus score_coverage_reporter and the llvm_cov bazelrc config (registers the Ferrocene toolchain explicitly, since regular builds only register it inside --config=x86_64-linux; excludes integration/manual tests).
  • MODULE.bazel: score_tooling 1.2.0 (pinned to 1.1.2) → 2.2.0; score_toolchains_rust 0.8.0 → 0.10.0 (its standard Ferrocene toolchains ship llvm-cov/llvm-profdata — that is what enables Rust coverage; same rustc revision as before); toolchains_llvm 1.7.0 → 1.8.0 with a second, coverage-only 22.1.7 instance (the 19.1.7 clang-tidy instance is untouched); trlc override → trlc-3.0.1 (score_tooling ≥ 2.x loads trlc 3.x symbols; a git_override pins graph-wide).
  • Root BUILD: use_format_targets now loaded from @score_tooling//third_party/format:macros.bzl (moved out of defs.bzl in 2.x).
  • .bazelrc: legacy gcov coverage flags removed; llvm_cov config imported.
  • coverage_report.yml: still workflow_call with the approval gate (docs.yml consumes it), inner reusable replaced by the inline job; artifact name logging_cpp_coverage kept since docs.yml downloads it as tests-report-artifact.
  • format.yml: score_tooling 2.x tags its format tests manual, which this repo's default test --test_tag_filters=-manual hides (bazel test //:format.check would find no tests) — the workflow now lifts the filter.
  • Second commit — 2.2.0 cr_checker fallout: copyright srcs switched from //:-label style to plain paths (the checker collects via git pathspecs now), Apache headers added to 53 docs/.puml/template files it now scans, and 3 pre-existing duplicated headers in score/test/component/*/BUILD deduplicated.

Known gap (documented in quality/coverage/BUILD)

cc_binary entry-point sources (datarouter main) are not collected by the scope aspect (no CcInfo); tracked as a scope-aspect enhancement in score_tooling.

Validation (local)

bazel coverage --config=llvm_cov //score/... --build_tests_only : 37/37 tests pass (2 skipped by tag)
Raw line coverage: 85.77% (5750/6704)   Branches: 79.10% (969/1225)
99 in-scope files (C++ + 2 Rust), 2 at exact 0%
Regular --config=x86_64-linux build, //:format.check (4/4), //:copyright.check, --lockfile_mode=error: all green

QNX flows untouched.

score_tooling 2.x side effects fixed on this branch (third commit)

The first CI run failed in several jobs; only the sanitizer/QNX-build/main-build failures are the PlantUML blocker above. The others were distinct 2.x-bump side effects, now fixed:

  • clang-tidy: toolchains_llvm 1.8.0 emits -stdlib=libc++ + -nostdinc++; clang reports -stdlib unused → fatal under warnings_as_errors. Tidy config suppresses -Wunused-command-line-argument (analysis unchanged; verified locally on the failing target).
  • QNX integration tests: rules_android's SDK extension now gets fetched transitively (lobster → rules_jvm_external → rules_android) and fails on GitHub runners → common --repo_env=ANDROID_HOME= (same as eclipse-score/time).
  • Component tests: the job's persisted output-base cache restored a stale pre-3.x trlc repo via restore-keys → cache key bumped.
  • Build Bazel Code (fourth commit, pre-existing on main): bazel info output_user_root is not a valid key in Bazel 8.6.0 (.bazelversion), so the workflow's path-discovery step failed on every run; the variable was unused → line removed.

@github-actions

github-actions Bot commented Aug 27, 2026

Copy link
Copy Markdown

License Check Results

🚀 The license check job ran with the Bazel command:

bazel run --lockfile_mode=error //:license-check

Status: ⚠️ Needs Review

Click to expand output
[License Check Output]
Extracting Bazel installation...
Starting local Bazel server (8.6.0) and connecting to it...
INFO: Invocation ID: e60052f8-24d6-4ce8-b964-2d6cfda7874c
Computing main repo mapping: 
Computing main repo mapping: 
Computing main repo mapping: 
Computing main repo mapping: 
Computing main repo mapping: 
Computing main repo mapping: 
Computing main repo mapping: 
Computing main repo mapping: 
Computing main repo mapping: 
Computing main repo mapping: 
Computing main repo mapping: 
Loading: 
Loading: 4 packages loaded
WARNING: Target pattern parsing failed.
ERROR: Skipping '//:license-check': no such target '//:license-check': target 'license-check' not declared in package '' defined by /home/runner/work/logging/logging/BUILD
ERROR: no such target '//:license-check': target 'license-check' not declared in package '' defined by /home/runner/work/logging/logging/BUILD
INFO: Elapsed time: 16.007s
INFO: 0 processes.
ERROR: Build did NOT complete successfully
ERROR: Build failed. Not running target

@dcalavrezo-qorix
dcalavrezo-qorix deployed to workflow-approval August 27, 2026 12:32 — with GitHub Actions Active
@github-actions

Copy link
Copy Markdown

The created documentation from the pull request is available at: docu-html

@dcalavrezo-qorix
dcalavrezo-qorix deployed to workflow-approval August 27, 2026 14:48 — with GitHub Actions Active
@dcalavrezo-qorix
dcalavrezo-qorix marked this pull request as ready for review August 27, 2026 15:13
Comment thread quality/coverage/BUILD Outdated
Comment thread score/mw/log/design/backend/BUILD
Replace the gcov-based cpp-coverage reusable with the shared LLVM
source-based coverage pipeline (@score_tooling//coverage), covering C++
AND Rust in one report:

- quality/coverage/: score_coverage_scope over the module's components
  (//score/mw/log:log facade incl. the backends it wires, backend:custom,
  the Rust bridge crate + its C++ init library, the datarouter daemon —
  the same scope the old instrumentation filter expressed; backend:slog
  is QNX-only and cannot be measured on the Linux host),
  score_coverage_reporter, and the llvm_cov bazelrc config. The config
  registers the Ferrocene toolchain explicitly (regular builds only do so
  inside --config=x86_64-linux) and excludes integration/manual tests.
  Untested in-scope files appear at exact 0% via the --empty-profile
  baseline. Known gap: cc_binary entry-point sources are not collected
  (no CcInfo); documented in the BUILD comment.
- MODULE.bazel: score_tooling 1.2.0 (pinned 1.1.2) -> 2.2.0;
  score_toolchains_rust 0.8.0 -> 0.10.0 (its standard toolchains ship
  llvm-cov/llvm-profdata, which enables Rust coverage; same rustc rev);
  toolchains_llvm 1.7.0 -> 1.8.0 with a second, coverage-only 22.1.7
  instance (19.1.7 stays for clang-tidy); trlc override -> trlc-3.0.1
  (score_tooling >= 2.x loads trlc 3.x symbols).
- Root BUILD: use_format_targets loads from
  @score_tooling//third_party/format:macros.bzl (moved out of defs.bzl).
- .bazelrc: legacy gcov coverage flags removed; llvm_cov config imported.
- coverage_report.yml: workflow_call + approval gate kept; the inner
  reusable is replaced by the inline job. Artifact name
  logging_cpp_coverage kept (docs.yml downloads it). Report-only
  threshold, as before. The markdown job summary appears on the run page
  via GITHUB_STEP_SUMMARY.

Validated: 37/37 tests under --config=llvm_cov (2 skipped by tag), raw
line coverage 85.77% (5750/6704), branches 79.10%, 99 in-scope files
incl. the Rust crate, 2 at exact 0%.
- cr_checker now collects files via git pathspecs: the //:-label style
  srcs of the copyright target become plain paths.
- 53 pre-existing docs/.puml/PR-template files the previously pinned
  checker never scanned receive their Apache-2.0 headers (copyright.fix);
  3 pre-existing duplicated headers in score/test/component/*/BUILD are
  deduplicated.
- score_tooling 2.x tags its format tests manual, which this repo's
  default test filter hides (bazel test //:format.check found no tests);
  format.yml lifts the filter.
Three CI failures unrelated to coverage, all triggered by the dependency
bumps of the previous commits:

- clang-tidy: toolchains_llvm >= 1.8.0 emits -stdlib=libc++ together with
  -nostdinc++ (explicit libc++ include paths); clang reports -stdlib as
  unused and the warnings_as_errors feature makes that fatal. The tidy
  config now passes -Wno-unused-command-line-argument; analysis output is
  unchanged (verified on the failing target).
- QNX integration tests: rules_android is now pulled in transitively
  (lobster -> rules_jvm_external -> rules_android) and its SDK repository
  extension fails on runners without Android SDK APIs. Unset ANDROID_HOME
  via --repo_env (same fix as eclipse-score/time).
- Component tests: the persisted output-base cache restored a stale
  external trlc repository (pre-3.x) via restore-keys; bump the cache key
  version so the job starts from a clean output base.
output_user_root is not a 'bazel info' key in Bazel 8.6.0 (the version
pinned in .bazelversion), so the path-discovery step failed with
'unknown key(s)' on every run; the BAZEL_USER_ROOT variable it set was
never used.
score_tooling 2.x runs the PlantUML parser on every diagram referenced by
architectural_design(). The legacy diagrams under score/mw/log/design/backend
use constructs outside the parser's supported subset (hide empty members,
!theme, state transitions, multi-line notes), so every wildcard build
(//..., //score/...) failed on this target.

Nothing depends on the target - the docs include the .puml files directly -
so exclude it from wildcard builds until the diagrams are reworked.
Tracked in eclipse-score/tooling#447.
@rmaddikery
rmaddikery force-pushed the dcalavrezo_llvm_coverage branch from 3006d18 to de54ed4 Compare August 27, 2026 15:51
Comment thread MODULE.bazel
@github-project-automation github-project-automation Bot moved this from Backlog to On Hold in LOG - Logging FT Aug 28, 2026
@rmaddikery
rmaddikery merged commit 568cb52 into main Aug 28, 2026
24 of 25 checks passed
@rmaddikery
rmaddikery deleted the dcalavrezo_llvm_coverage branch August 28, 2026 10:33
@github-project-automation github-project-automation Bot moved this from On Hold to Done in LOG - Logging FT Aug 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants