Repository navigation
fix(coverage): filter non-project sources from coverage report - #489
Merged
Merged
Conversation
SteNicholas
reviewed
Nov 2, 2026
Member
There was a problem hiding this comment.
@lucasfang, I left two comments for the coverage filtering step, reproduced with synthetic coverage traces using LCOV 2.0.
SteNicholas
reviewed
Nov 3, 2026
Member
There was a problem hiding this comment.
@lucasfang, the two earlier findings are addressed. I left only one related path-filtering comment which has been reproduced with synthetic coverage traces using LCOV 2.0.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Purpose
Linked issue: close #488
The coverage report generated by
test/generate_coverage.shcurrently includes system headers (/usr/include/c++/...), third-party headers installed into the build tree (arrow_ep-install/,boost_ep-install/, etc.),third_party/sources, and test sources (*_test.cpp, test helpers, mocks). This floods the directory view with tens of thousands of irrelevant files and dilutes the overall coverage numbers.Add an
lcov --removestep to focus the report on project implementation code, and enable AVRO, ORC, MOSAIC, LANCE, and VORTEX in the coverage build so optional formats are measured too.Restrict build-tree exclusion to the actual build directory (
$PWD/*). The previous*/build*/*pattern also matched checkout ancestors such as/builds/, which could remove project implementation sources from the report. Pass--ignore-errors unusedso overlapping or unmatched exclusion patterns do not abort filtering.Anchor all remaining project exclusions to the repository root as well. Checkouts beneath
test,testing,third_party, ormock-buildmust retain implementation sources. Exclude the knownsrc/paimon/testing/directory and explicit REST mock server files instead of matchingmockanywhere in a path. Quote the initial directory change to support checkout paths containing spaces.Tests
Validation for the latest follow-up commit
8208bd8c:bash -n test/generate_coverage.sh,pre-commit run --files test/generate_coverage.sh, andgit diff --check— passed.normal,builds,test,testing,mock-build,third_party, andpath with spaces. All seven scenarios retained implementation source/header records, including a production source within amock-builddirectory, and removed build dependencies, system headers, third-party sources, tests, helpers, and known mocks. Implementation-only traces also passed with unmatched exclusions.genhtml --no-sourcegenerated HTML in all 14 cases.test,testing,mock-build, andthird_partyancestors.Validation for follow-up commit
dbb2278b:bash -n test/generate_coverage.sh— passed.pre-commit run --files test/generate_coverage.sh— passed; hooks not applicable to shell files were skipped.git diff --cached --check— passed before committing.lcov --removeblock against synthetic tracefiles using the installed lcov (reports version 1.0.0). In a checkout under/builds/, implementation source/header records were retained while system, build dependency, third-party, test, helper, and mock records were removed. A tracefile containing only implementation records also completed successfully with unmatched exclusion patterns.The original patch's previously reported internal-fork validation was a full build and 44/44 CTest targets passing, with filtered coverage of 93.1% lines and 92.3% functions. Those figures predate this follow-up; the complete coverage build and CTest suite were not rerun for this script-only change. Other lcov versions were not tested.
API and Format
No changes to public API, storage format, or protocol.
Documentation
Script comments explain the exclusions, build-directory scope, and handling of unused patterns. No new user-facing feature.
Generative AI tooling
Generated-by: Qoder
Generated-by: OpenAI Codex (GPT-6)