Bug 11358

Summary: oe-selftest: coverage report shows incorrect info
Product: [QA/Testing] Build Testing Reporter: Ed Bartosh <eduard.bartosh>
Component: generalAssignee: Unassigned <unassigned>
Status: RESOLVED OBSOLETE QA Contact:
Severity: normal    
Priority: Low CC: benjamin.esquivel, bluelightning, leonardo.sandoval.gonzalez, richard.purdie
Version: 2.4   
Target Milestone: Future   
Hardware: x86   
OS: Multiple   
Whiteboard:
OS type for building Yocto: --- Type of Regression: New (Never tested)
Verified: Documentation change: Don't know

Description Ed Bartosh 2017-04-13 13:59:30 UTC
Coverage report shows some of the covered lines of wic code as uncovered.

Here is an example:

$ oe-selftest -r wic --coverage
$ coverage3 report -m |grep filemap.py
/home/ed/git/yocto/poky/scripts/lib/wic/filemap.py                               248     99     52     11    55%   79-80, 87-88, 93-94, 102-103, 108-109, 125-126, 138, 147, 160, 169, 183-194, 207-210, 226-249, 253-261, 265, 274-293, 297-299, 303-305, 376, 390-403, 422, 470, 502-516, 530-531, 543, 547-550, 553, 557, 73->76, 78->79, 118->exit, 375->376, 469->470, 542->543, 542->562, 546->547, 546->549, 556->542, 556->557

lines 207-210 belong to FilemapSeek.__init__, which is definitely called in  test_sparse_copy test case. The same happens with a lot of other lines of code from this module.

It looks like coverage doesn't work properly for direct API calls. It works only for indirect calls, i.e. when the API is called from the tool/program that's executed in test cases.
Comment 1 Richard Purdie 2020-04-30 08:35:14 UTC
Coverage support was dropped from oe-selftest and we don't have the time/plans to implement now.