<?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>11357</bug_id>
          
          <creation_ts>2017-04-13 12:41:07 +0000</creation_ts>
          <short_desc>oe-selftest: devtool tests don&apos;t preserve command output for showing on failure</short_desc>
          <delta_ts>2020-04-09 04:07:51 +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>Medium</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>4.99</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Paul Eggleton">bluelightning</reporter>
          <assigned_to name="yeoh ee peng">ee.peng.yeoh</assigned_to>
          <cc>benjamin.esquivel</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>72455</commentid>
    <comment_count>0</comment_count>
    <who name="Paul Eggleton">bluelightning</who>
    <bug_when>2017-04-13 12:41:07 +0000</bug_when>
    <thetext>If a test fails, e.g. devtool.DevtoolTests.test_devtool_modify because the expected source file wasn&apos;t extracted, then we never see the actual devtool command output which might have been useful:

======================================================================
FAIL [33.107s]: test_devtool_modify
(oeqa.selftest.devtool.DevtoolTests)
----------------------------------------------------------------------
Traceback (most recent call last):
  File &quot;/media/build1/poky/meta/lib/oeqa/utils/decorators.py&quot;, line
109, in wrapped_f
    return func(*args, **kwargs)
  File &quot;/media/build1/poky/meta/lib/oeqa/selftest/devtool.py&quot;, line
446, in test_devtool_modify
    self.assertTrue(os.path.exists(os.path.join(tempdir, &apos;Makefile&apos;)),
&apos;Extracted source could not be found&apos;)
AssertionError: False is not true : Extracted source could not be found
======================================================================

We should change the devtool tests to be printing out the output from the last run command when the assertion fails.

(I&apos;ve filed bug 11356 for the &quot;false is not true&quot; nonsense, so ignore that for now).</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>86945</commentid>
    <comment_count>1</comment_count>
    <who name="yeoh ee peng">ee.peng.yeoh</who>
    <bug_when>2020-04-09 04:03:07 +0000</bug_when>
    <thetext>DevtoolTests had been enhanced, it was no longer using assertTrue and the last run command output had been used in the assertion fails. 

result = runCmd(&apos;devtool modify mdadm -x %s&apos; % tempdir)
        self.assertExists(os.path.join(tempdir, &apos;Makefile&apos;), &apos;Extracted source could not be found&apos;)
        self.assertExists(os.path.join(self.workspacedir, &apos;conf&apos;, &apos;layer.conf&apos;), &apos;Workspace directory not created&apos;)
        matches = glob.glob(os.path.join(self.workspacedir, &apos;appends&apos;, &apos;mdadm_*.bbappend&apos;))
        self.assertTrue(matches, &apos;bbappend not created %s&apos; % result.output)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>86946</commentid>
    <comment_count>2</comment_count>
    <who name="yeoh ee peng">ee.peng.yeoh</who>
    <bug_when>2020-04-09 04:07:51 +0000</bug_when>
    <thetext>DevtoolTests.test_devtool_modify had been enhanced by community, it was no longer using assertTrue and the last run command output had been used in the assertion fails. 

result = runCmd(&apos;devtool modify mdadm -x %s&apos; % tempdir)
        self.assertExists(os.path.join(tempdir, &apos;Makefile&apos;), &apos;Extracted source could not be found&apos;)
        self.assertExists(os.path.join(self.workspacedir, &apos;conf&apos;, &apos;layer.conf&apos;), &apos;Workspace directory not created&apos;)
        matches = glob.glob(os.path.join(self.workspacedir, &apos;appends&apos;, &apos;mdadm_*.bbappend&apos;))
        self.assertTrue(matches, &apos;bbappend not created %s&apos; % result.output)</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>