<?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>9334</bug_id>
          
          <creation_ts>2016-03-23 16:07:48 +0000</creation_ts>
          <short_desc>oe-selftest: error output shown with --coverage when coverage module not installed</short_desc>
          <delta_ts>2016-04-06 15:40:43 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>10</classification_id>
          <classification>QA/Testing</classification>
          <product>Build Testing</product>
          <component>general</component>
          <version>2.1</version>
          <rep_platform>x86</rep_platform>
          <op_sys>Multiple</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>Medium</priority>
          <bug_severity>minor</bug_severity>
          <target_milestone>2.1</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Humberto Ibarra">humberto.ibarra.lopez</reporter>
          <assigned_to name="Humberto Ibarra">humberto.ibarra.lopez</assigned_to>
          <cc>richard.purdie</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>60349</commentid>
    <comment_count>0</comment_count>
    <who name="Humberto Ibarra">humberto.ibarra.lopez</who>
    <bug_when>2016-03-23 16:07:48 +0000</bug_when>
    <thetext>Bug 8930 automated the coverage sub-process initialization process, but it did not clean warning and error messages properly.

build $ oe-selftest --run-tests-by module bblay* --coverage
Error processing line 1 of /home/humberto/.local/lib/python2.7/site-packages/coverage.pth:

  Traceback (most recent call last):
    File &quot;/usr/lib/python2.7/site.py&quot;, line 158, in addpackage
      exec line
    File &quot;&lt;string&gt;&quot;, line 1, in &lt;module&gt;
  ImportError: No module named coverage

Remainder of file ignored
2016-03-23 18:02:04,115 - selftest - INFO - Running bitbake -e to get BBPATH
DEBUG: tc id missing for test_sanity_unsafe_binary_references
DEBUG: tc id missing for test_read_only_image
DEBUG: tc id missing for test_devtool_add_git_local
DEBUG: tc id missing for test_devtool_upgrade_git
DEBUG: tc id missing for test_recipetool_create_cmake
DEBUG: tc id missing for test_qemu
2016-03-23 18:02:04,958 - selftest - INFO - Checking that everything is in order before running the tests
2016-03-23 18:02:05,802 - selftest - INFO - Running bitbake -p
2016-03-23 18:02:08,114 - selftest - INFO - Loading tests from: oeqa.selftest.bblayers.BitbakeLayers.test_bitbakelayers_add_remove
2016-03-23 18:02:08,114 - selftest - INFO - Loading tests from: oeqa.selftest.bblayers.BitbakeLayers.test_bitbakelayers_flatten
2016-03-23 18:02:08,114 - selftest - INFO - Loading tests from: oeqa.selftest.bblayers.BitbakeLayers.test_bitbakelayers_showappends
2016-03-23 18:02:08,114 - selftest - INFO - Loading tests from: oeqa.selftest.bblayers.BitbakeLayers.test_bitbakelayers_showcrossdepends
2016-03-23 18:02:08,114 - selftest - INFO - Loading tests from: oeqa.selftest.bblayers.BitbakeLayers.test_bitbakelayers_showlayers
2016-03-23 18:02:08,114 - selftest - INFO - Loading tests from: oeqa.selftest.bblayers.BitbakeLayers.test_bitbakelayers_showoverlayed
2016-03-23 18:02:08,114 - selftest - INFO - Loading tests from: oeqa.selftest.bblayers.BitbakeLayers.test_bitbakelayers_showrecipes
2016-03-23 18:02:08,114 - selftest - INFO - Adding: &quot;include selftest.inc&quot; in local.conf
2016-03-23 18:02:08,115 - selftest - INFO - Adding: &quot;include bblayers.inc&quot; in bblayers.conf
2016-03-23 18:02:08,115 - selftest - WARNING - python coverage is not installed
Make sure your coverage takes into account sub-process
More info on https://pypi.python.org/pypi/coverage
2016-03-23 18:02:08 - test_bitbakelayers_add_remove (oeqa.selftest.bblayers.BitbakeLayers) ... ok
2016-03-23 18:02:13 - test_bitbakelayers_flatten (oeqa.selftest.bblayers.BitbakeLayers) ... ok
2016-03-23 18:02:16 - test_bitbakelayers_showappends (oeqa.selftest.bblayers.BitbakeLayers) ... ok
2016-03-23 18:02:19 - test_bitbakelayers_showcrossdepends (oeqa.selftest.bblayers.BitbakeLayers) ... ok
2016-03-23 18:02:23 - test_bitbakelayers_showlayers (oeqa.selftest.bblayers.BitbakeLayers) ... ok
2016-03-23 18:02:23 - test_bitbakelayers_showoverlayed (oeqa.selftest.bblayers.BitbakeLayers) ... ok
2016-03-23 18:02:24 - test_bitbakelayers_showrecipes (oeqa.selftest.bblayers.BitbakeLayers) ... ok

----------------------------------------------------------------------
Ran 7 tests in 25.207s

OK
2016-03-23 18:02:33,322 - selftest - INFO - Finished
2016-03-23 18:02:33,322 - selftest - INFO - Removing the include from local.conf
2016-03-23 18:02:33,322 - selftest - INFO - Removing the include from bblayers.conf


There are 2 issues here:


1) The exception at the start of the command occurs because oe-selftest is creating a temporal coverage file for coverage subprocessing and coverage is not even installed. The file shouldn&apos;t have been created.

2) The warning message:

2016-03-23 18:02:08,115 - selftest - WARNING - python coverage is not installed
Make sure your coverage takes into account sub-process
More info on https://pypi.python.org/pypi/coverage

should be changed. The &quot;Make sure your coverage takes into account sub-process&quot; does no longer apply since this is now done automatically by the script.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>60397</commentid>
    <comment_count>1</comment_count>
    <who name="Richard Purdie">richard.purdie</who>
    <bug_when>2016-03-24 15:13:28 +0000</bug_when>
    <thetext>The thing which worries me more is that the system doesn&apos;t stop after the failure or set an error exit code?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>60441</commentid>
    <comment_count>2</comment_count>
    <who name="Humberto Ibarra">humberto.ibarra.lopez</who>
    <bug_when>2016-03-28 15:48:21 +0000</bug_when>
    <thetext>The script doesn&apos;t stop after the coverage module isn&apos;t found because the script is not trying to find the coverage module. A different file is trying to do the import.

The coverage module is imported by a temporary file saved under the user site directory. Python tries to import it every time it runs.

The problem is that oe-selftest creates this file when given the --coverage option, even if coverage is not installed.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>60818</commentid>
    <comment_count>3</comment_count>
    <who name="Humberto Ibarra">humberto.ibarra.lopez</who>
    <bug_when>2016-04-05 19:11:10 +0000</bug_when>
    <thetext>Sent patches

http://lists.openembedded.org/pipermail/openembedded-core/2016-April/119900.html
http://lists.openembedded.org/pipermail/openembedded-core/2016-April/119901.html
http://lists.openembedded.org/pipermail/openembedded-core/2016-April/119902.html
http://lists.openembedded.org/pipermail/openembedded-core/2016-April/119903.html</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>