<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugzilla.yoctoproject.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.6"
          urlbase="https://bugzilla.yoctoproject.org/"
          
          maintainer="it-coreprojects-helpdesk@linuxfoundation.org"
>

    <bug>
          <bug_id>10015</bug_id>
          
          <creation_ts>2016-07-25 08:24:36 +0000</creation_ts>
          <short_desc>oe-selftest --coverage produces empty coverage report on OpenSUSE</short_desc>
          <delta_ts>2016-09-01 19:35:01 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>7</classification_id>
          <classification>Build System, Metadata &amp; Runtime</classification>
          <product>OE-Core</product>
          <component>Scripts and Tools</component>
          <version>2.2</version>
          <rep_platform>x86</rep_platform>
          <op_sys>Multiple</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>NOTABUG</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>Medium+</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>2.2 M3</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Ed Bartosh">eduard.bartosh</reporter>
          <assigned_to name="Humberto Ibarra">humberto.ibarra.lopez</assigned_to>
          <cc>joshuagloe</cc>
    
    <cc>leonardo.sandoval.gonzalez</cc>
    
    <cc>ross.burton</cc>
    
    <cc>sgw</cc>
          
          
          <cf_os>---</cf_os>
          <cf_regression_type>---</cf_regression_type>
          
          <cf_docchange>No (bug/feature does not impact docs)</cf_docchange>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>64407</commentid>
    <comment_count>0</comment_count>
    <who name="Ed Bartosh">eduard.bartosh</who>
    <bug_when>2016-07-25 08:24:36 +0000</bug_when>
    <thetext>oe-selftest --coverage -a on OpenSUSE 13.2 and OpenSUSE Leap 42.1 produced empty coverage report:

# Generated with command &apos;/home/ed/git/yocto/poky/scripts/oe-selftest --coverage -a&apos;
# 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: &quot;include selftest.inc&quot; in local.conf
2016-07-21 18:55:49,314 - selftest - INFO - Adding: &quot;include bblayers.inc&quot; 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 &apos;/home/ed/git/yocto/poky/scripts/oe-selftest --coverage -r wic.Wic.test_build_image_name&apos;
# 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&apos;s interesting that files mentioned in the report are the .py files from scripts/ directory:

&gt; 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</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>65590</commentid>
    <comment_count>1</comment_count>
    <who name="Humberto Ibarra">humberto.ibarra.lopez</who>
    <bug_when>2016-08-29 21:43:39 +0000</bug_when>
    <thetext>Hi Ed,

Tried this and was able to reproduce it, however this is an old version of python-coverage and I didn&apos;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?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>65603</commentid>
    <comment_count>2</comment_count>
    <who name="Ed Bartosh">eduard.bartosh</who>
    <bug_when>2016-08-30 07:40:48 +0000</bug_when>
    <thetext>I was using version 3.7.1 because it&apos;s what&apos;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?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>65695</commentid>
    <comment_count>3</comment_count>
    <who name="Humberto Ibarra">humberto.ibarra.lopez</who>
    <bug_when>2016-09-01 15:53:23 +0000</bug_when>
    <thetext>Can&apos;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.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>65718</commentid>
    <comment_count>4</comment_count>
    <who name="Humberto Ibarra">humberto.ibarra.lopez</who>
    <bug_when>2016-09-01 19:35:01 +0000</bug_when>
    <thetext>Opened documentation bug.

https://bugzilla.yoctoproject.org/show_bug.cgi?id=10207

I&apos;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.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>