| Summary: | oe-selftest --coverage produces empty coverage report on OpenSUSE | ||
|---|---|---|---|
| Product: | [Build System, Metadata & Runtime] OE-Core | Reporter: | Ed Bartosh <eduard.bartosh> |
| Component: | Scripts and Tools | Assignee: | Humberto Ibarra <humberto.ibarra.lopez> |
| Status: | RESOLVED NOTABUG | QA Contact: | |
| Severity: | normal | ||
| Priority: | Medium+ | CC: | joshuagloe, leonardo.sandoval.gonzalez, ross.burton, sgw |
| Version: | 2.2 | ||
| Target Milestone: | 2.2 M3 | ||
| Hardware: | x86 | ||
| OS: | Multiple | ||
| Whiteboard: | |||
| OS type for building Yocto: | --- | Type of Regression: | --- |
| Verified: | Documentation change: | No (bug/feature does not impact docs) | |
Hi Ed, Tried this and was able to reproduce it, however this is an old version of python-coverage and I didn't see the failure with the most recent ones. Could you try this with coverage 4.0 or greater and let us know what results you got? I was using version 3.7.1 because it's what's included into the distro. Even if everything works with fresher versions of coverage how would that fix this bug? Btw, where should I take coverage 4.0 or newer for openSUSE Leap 42.1? Can't make this work on 3.7.1 without modifying python-coverage code since this was a bug from their side. It is already fixed in 4.x versions and pursuing a work around for this to work in 3.7.1 would require to change to not ideal design in coverage oe-selftest implementation. So my suggestion is still to move to coverage 4.x. We will move towards improving documentation in this regard to make it clear that coverage 4.x is needed in cases like this. About getting the right version for this distro, I believe pip can provide this. Opened documentation bug. https://bugzilla.yoctoproject.org/show_bug.cgi?id=10207 I'm closing this one, since we are pushing for the use of python-coverage 4.x If this happens again using coverage 4.x or higher, feel free to reopen. |
oe-selftest --coverage -a on OpenSUSE 13.2 and OpenSUSE Leap 42.1 produced empty coverage report: # Generated with command '/home/ed/git/yocto/poky/scripts/oe-selftest --coverage -a' # HEAD commit 5c11e365e19357f721c49d076971567e7b64b61b [run] data_file = /home/ed/git/yocto/poky/build/.coverage.20160706T183956 branch = True source = /home/ed/git/yocto/poky/meta /home/ed/git/yocto/poky/meta-yocto /home/ed/git/yocto/poky/meta-yocto-bsp /home/ed/git/yocto/poky/meta-selftest /home/ed/git/yocto/poky/scripts /home/ed/git/yocto/poky/bitbake 2016-07-07 00:49:16,878 - selftest - INFO - Coverage Report 2016-07-07 00:49:16,879 - selftest - INFO - =============== 2016-07-07 00:49:16,938 - selftest - INFO - Name Stmts Miss Cover --------------------------------------------------------------------------- /home/ed/git/yocto/poky/scripts/oepydevshell-internal 73 73 0% /home/ed/git/yocto/poky/scripts/opkg-query-helper 52 52 0% /home/ed/git/yocto/poky/scripts/relocate_sdk 153 153 0% /home/ed/git/yocto/poky/scripts/sysroot-relativelinks 21 21 0% --------------------------------------------------------------------------- TOTAL 299 299 0% ---------------------------------------------------------------------- Ran 187 tests in 22160.353s OK (skipped=1) The same report is produced by running just one test case: $ oe-selftest --coverage -r wic.Wic.test_build_image_name 2016-07-21 18:55:43,753 - selftest - INFO - Running bitbake -e to get BBPATH 2016-07-21 18:55:45,054 - selftest - INFO - Checking that everything is in order before running the tests 2016-07-21 18:55:46,218 - selftest - INFO - Running bitbake -p 2016-07-21 18:55:49,307 - selftest - INFO - Loading tests from: oeqa.selftest.wic.Wic.test_build_image_name 2016-07-21 18:55:49,314 - selftest - INFO - Adding: "include selftest.inc" in local.conf 2016-07-21 18:55:49,314 - selftest - INFO - Adding: "include bblayers.inc" in bblayers.conf 2016-07-21 18:55:49,343 - selftest - INFO - Coverage is enabled 2016-07-21 18:55:50 - test_build_image_name (oeqa.selftest.wic.Wic) Test wic create directdisk --image-name core-image-minimal ... ok 2016-07-21 19:00:01,120 - selftest - INFO - Coverage configuration file (/home/ed/git/yocto/poky/build/.coveragerc) 2016-07-21 19:00:01,121 - selftest - INFO - =========================== 2016-07-21 19:00:01,121 - selftest - INFO - # Generated with command '/home/ed/git/yocto/poky/scripts/oe-selftest --coverage -r wic.Wic.test_build_image_name' # HEAD commit 36feb38045b7a2af86ece147fec54b0db3bf491f [run] data_file = /home/ed/git/yocto/poky/build/.coverage.20160721T185549 branch = True source = /home/ed/git/yocto/poky/meta /home/ed/git/yocto/poky/meta-yocto /home/ed/git/yocto/poky/meta-yocto-bsp /home/ed/git/yocto/poky/meta-selftest /home/ed/git/yocto/poky/scripts /home/ed/git/yocto/poky/bitbake 2016-07-21 19:00:01,122 - selftest - INFO - Coverage Report 2016-07-21 19:00:01,122 - selftest - INFO - =============== 2016-07-21 19:00:01,176 - selftest - INFO - Name Stmts Miss Cover --------------------------------------------------------------------------- /home/ed/git/yocto/poky/scripts/oepydevshell-internal 72 72 0% /home/ed/git/yocto/poky/scripts/opkg-query-helper 52 52 0% /home/ed/git/yocto/poky/scripts/relocate_sdk 153 153 0% /home/ed/git/yocto/poky/scripts/sysroot-relativelinks 21 21 0% --------------------------------------------------------------------------- TOTAL 298 298 0% ---------------------------------------------------------------------- Ran 1 test in 251.862s OK 2016-07-21 19:00:01,177 - selftest - INFO - Finished 2016-07-21 19:00:01,178 - selftest - INFO - Removing the include from local.conf 2016-07-21 19:00:01,179 - selftest - INFO - Removing the include from bblayers.conf It's interesting that files mentioned in the report are the .py files from scripts/ directory: > ls -la ../scripts/*.py -rwxr-xr-x 1 ed users 2512 Jul 21 18:42 ../scripts/oepydevshell-internal.py -rwxr-xr-x 1 ed users 2767 Jul 21 18:42 ../scripts/opkg-query-helper.py -rwxr-xr-x 1 ed users 9071 Jul 21 18:42 ../scripts/relocate_sdk.py -rwxr-xr-x 1 ed users 960 Jul 21 18:42 ../scripts/sysroot-relativelinks.py [reply] [-] Comment 12 Here is the list of coverage packages installed: $ rpm -qa |grep coverage python3-coverage-3.7.1-2.1.3.x86_64 python-coverage-3.7.1-2.1.4.x86_64