Repository navigation
tests, build: fix the coverage report of the nightly runs - #4220
Merged
Merged
Conversation
Since the device fuzz target builds libmock_nvme.c with MOCK_FUZZ, ipc_call() and connect_ipc_socket() each have two definitions, one per build and at different lines. A coverage build has data from both, and gcovr fails to merge a function it finds on two lines: GcovrMergeAssertionError: tests/cli/libmock_nvme.c:737 Got function ipc_call on multiple lines: 604, 737. This breaks the coverage report of all nightly test runs. Define each function once and move the MOCK_FUZZ condition into the body. The fuzz variant of ipc_call() becomes fuzz_ipc_call(). Fixes: c60974b ("tests/cli: answer the commands from a fuzz input") Signed-off-by: Daniel Wagner <dwagner@suse.de>
gcovr drops all functions starting with '__' as compiler internal. In libnvme these are the internal helpers, so their coverage is missing from the report. And gcovr 8.7 fails on any such C function: KeyError: 1083 Keep them with include-internal-functions. A gcovr.cfg in the root directory applies it to all callers, the nightly runs as well as scripts/build.sh. Link: gcovr/gcovr#1319 Signed-off-by: Daniel Wagner <dwagner@suse.de>
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.
The nightly runs fail since 2026-10-18 in the coverage step, after all tests passed. gcovr aborts in all three jobs (blktests, nvme-cli tests, daemon tests):
Since c60974b ("tests/cli: answer the commands from a fuzz input"), libmock_nvme.c is built twice, as
libmock_nvme.soand with-DMOCK_FUZZintofuzz-device.ipc_call()andconnect_ipc_socket()each have a definition per build, at different lines, and gcovr refuses to merge a function it finds on two lines.MOCK_FUZZinside the body; the fuzz variant becomesfuzz_ipc_call().__as compiler internal, which are libnvme's internal helpers (72 of them in a local run). gcovr 8.7 also crashes on such C functions (gcovr 8.7: KeyError 320 gcovr/gcovr#1319, root cause and reproducer posted there). The nightly uses Fedora's 8.6 for now. Agcovr.cfgin the root setsinclude-internal-functionsfor all callers, the nightly jobs as well asscripts/build.sh.Tested locally with a
-Db_coverage=truebuild: before the fix, gcovr 8.6 fails with the CI error; after it, gcovr 8.6 and 8.7 both succeed and the report includes the__functions. The full test suite passes.