<?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>11620</bug_id>
          
          <creation_ts>2017-06-07 08:37:58 +0000</creation_ts>
          <short_desc>oe-selftest: fails with a traceback if python git module not installed</short_desc>
          <delta_ts>2017-06-08 13:54:22 +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>unspecified</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>High</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>2.4 M1</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Paul Eggleton">bluelightning</reporter>
          <assigned_to name="Leonardo Sandoval Gonzalez">leonardo.sandoval.gonzalez</assigned_to>
          <cc>anibal.limon</cc>
    
    <cc>jose.perez.carranza</cc>
    
    <cc>mikko.ylinen</cc>
    
    <cc>richard.purdie</cc>
          
          
          <cf_os>---</cf_os>
          <cf_regression_type>Regression (Used to work)</cf_regression_type>
          
          <cf_docchange>Don&apos;t know</cf_docchange>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>73787</commentid>
    <comment_count>0</comment_count>
    <who name="Paul Eggleton">bluelightning</who>
    <bug_when>2017-06-07 08:37:58 +0000</bug_when>
    <thetext>If you run oe-selftest on a machine where python3-git (or python3-GitPython on some distributions) is not installed you get the following traceback:

----------------------- snip -----------------------
$ oe-selftest --run-tests bblayers devtool recipetool
Traceback (most recent call last):
  File &quot;/usr/lib/python3.4/unittest/loader.py&quot;, line 312, in _find_tests
    module = self._get_module_from_name(name)
  File &quot;/usr/lib/python3.4/unittest/loader.py&quot;, line 290, in _get_module_from_name
    __import__(name)
  File &quot;/home/paul/poky/poky/meta/lib/oeqa/selftest/cases/oelib/buildhistory.py&quot;, line 4, in &lt;module&gt;
    from git import Repo
ImportError: No module named &apos;git&apos;

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File &quot;/home/paul/poky/poky/scripts/oe-selftest&quot;, line 70, in &lt;module&gt;
    ret = main()
  File &quot;/home/paul/poky/poky/scripts/oe-selftest&quot;, line 57, in main
    results = args.func(logger, args)
  File &quot;/home/paul/poky/poky/meta/lib/oeqa/selftest/context.py&quot;, line 214, in run
    rc = self._internal_run(logger, args)
  File &quot;/home/paul/poky/poky/meta/lib/oeqa/selftest/context.py&quot;, line 175, in _internal_run
    self.tc.loadTests(self.module_paths, **self.tc_kwargs[&apos;load&apos;])
  File &quot;/home/paul/poky/poky/meta/lib/oeqa/core/context.py&quot;, line 51, in loadTests
    self.suites = self.loader.discover()
  File &quot;/home/paul/poky/poky/meta/lib/oeqa/core/loader.py&quot;, line 270, in discover
    pattern=&apos;*.py&apos;, top_level_dir=path)
  File &quot;/usr/lib/python3.4/unittest/loader.py&quot;, line 264, in discover
    tests = list(self._find_tests(start_dir, pattern))
  File &quot;/usr/lib/python3.4/unittest/loader.py&quot;, line 349, in _find_tests
    namespace=namespace)
  File &quot;/usr/lib/python3.4/unittest/loader.py&quot;, line 316, in _find_tests
    yield _make_failed_import_test(name, self.suiteClass)
  File &quot;/usr/lib/python3.4/unittest/loader.py&quot;, line 25, in _make_failed_import_test
    suiteClass)
  File &quot;/home/paul/poky/poky/meta/lib/oeqa/core/loader.py&quot;, line 23, in _make_failed_test
    raise exception
ImportError: Failed to import test module: oelib.buildhistory
Traceback (most recent call last):
  File &quot;/usr/lib/python3.4/unittest/loader.py&quot;, line 312, in _find_tests
    module = self._get_module_from_name(name)
  File &quot;/usr/lib/python3.4/unittest/loader.py&quot;, line 290, in _get_module_from_name
    __import__(name)
  File &quot;/home/paul/poky/poky/meta/lib/oeqa/selftest/cases/oelib/buildhistory.py&quot;, line 4, in &lt;module&gt;
    from git import Repo
ImportError: No module named &apos;git&apos;
----------------------- snip -----------------------

Test modules that fail due to ImportError should generate a warning during startup rather than causing oe-selftest to error out with an ugly traceback.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>73805</commentid>
    <comment_count>1</comment_count>
    <who name="Leonardo Sandoval Gonzalez">leonardo.sandoval.gonzalez</who>
    <bug_when>2017-06-07 14:43:04 +0000</bug_when>
    <thetext>Patch sent for review: http://lists.openembedded.org/pipermail/openembedded-core/2017-June/137665.html</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>73885</commentid>
    <comment_count>2</comment_count>
    <who name="Leonardo Sandoval Gonzalez">leonardo.sandoval.gonzalez</who>
    <bug_when>2017-06-08 13:54:22 +0000</bug_when>
    <thetext>Merge in poky with hash: 4a7612c7a12b9a381fb8343ba9586272b889fc15</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>