<?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>7865</bug_id>
          
          <creation_ts>2015-06-09 07:16:35 +0000</creation_ts>
          <short_desc>oe-selftest to detect test cases in other layers else than OE-Core</short_desc>
          <delta_ts>2016-02-29 10:27:20 +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>enhancement</bug_severity>
          <target_milestone>2.1</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter>sharron.liu</reporter>
          <assigned_to name="Costin">costin.c.constantin</assigned_to>
          <cc>alexandru.c.georgescu</cc>
    
    <cc>anibal.limon</cc>
    
    <cc>benjamin.esquivel</cc>
    
    <cc>cathy.shen</cc>
    
    <cc>francisco.j.pedraza.gonzalez</cc>
    
    <cc>jing.j.wang</cc>
    
    <cc>richard.purdie</cc>
    
    <cc>sharron.liu</cc>
          
          <qa_contact>sharron.liu</qa_contact>
          <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>51568</commentid>
    <comment_count>0</comment_count>
    <who name="">sharron.liu</who>
    <bug_when>2015-06-09 07:16:35 +0000</bug_when>
    <thetext>Hi Alex, and Yocto team,

I&apos;m working on a project using Yocto as build tool. I developed my own build-time test cases, and I wanted to use oe-selftest to run my tests. 

I have my test cases locating in my own layer. And I found oe-selftest failed to detect my test cases, when typing the command &quot;--list-modules&quot;.

I don&apos;t want to put them under &quot;poky/meta/&quot; since they&apos;re not for Yocto testing and they&apos;re for my project specific build testing. Any other project that use Yocto tool may face this issue, also. Could I expect oe-selftest to detect and launch test cases locating in other layers? 

For more details, here&apos;s my folder structure:
poky
  meta/lib/oeqa/
  meta-selftest
  scripts/oe-selftest
meta-mylayer (added to &quot;BBPATH&quot;)
  lib/oeqa/selftest (I want test cases here detected by oe-selftest)

I tried to add minor changes in oe-selftest, and that patch will detect any cases under &quot;lib/oeqa/selftest&quot; from all layers that are added to &quot;BBPATH&quot;. I would share that to you.

Thanks,
Sharron</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>51569</commentid>
    <comment_count>1</comment_count>
    <who name="">sharron.liu</who>
    <bug_when>2015-06-09 08:11:31 +0000</bug_when>
    <thetext>Alex, 
My test cases need to be organized into sub folders indeed, each sub folder represents a single test suite. 

meta-mylayer (added to &quot;BBPATH&quot;)
  lib/oeqa/selftest (I want test cases here detected by oe-selftest)
  lib/oeqa/selftest/cfg/mytest.py ==&gt; expect &quot;--list-modules&quot; list it as &quot;cfg.mytest&quot;
  lib/oeqa/selftest/cfg/files/mytest_data.json, mytest_dependency.py ==&gt; These are test data and dependency, don&apos;t expect &quot;--list-modules&quot; list it is as test case. 

I also modify the oe-selftest a few lines for this purpose. Let me know what do you think :)

Thanks,
Sharron</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>51578</commentid>
    <comment_count>2</comment_count>
    <who name="Costin">costin.c.constantin</who>
    <bug_when>2015-06-09 14:52:19 +0000</bug_when>
    <thetext>Hello Liu,

Please have a look on 7833 and let me know if it suffices your needs.

Costin</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>51610</commentid>
    <comment_count>3</comment_count>
    <who name="Costin">costin.c.constantin</who>
    <bug_when>2015-06-10 11:49:35 +0000</bug_when>
    <thetext>Hi Liu,

I think i did a mistake in my last comment. 7833 is not referring to something similar to this feature. However, i posted a comment with some steps to perform in order to achieve multi layer test inclusions. I will come back shortly with a patch for this request

Costin</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>51628</commentid>
    <comment_count>4</comment_count>
    <who name="">sharron.liu</who>
    <bug_when>2015-06-11 08:40:32 +0000</bug_when>
    <thetext>Costin,

Thanks for your prompt reply! You&apos;re right, 7833 is related to runtime test, while this 7865 is for build-time test. Here I would provide more detail steps for how-to-reproduce my issue :)

1. follow step 1~3 (of 7833) to add my test layer. 
meta-mylayer (added to &quot;BBLAYERS&quot;, added to &quot;BBPATH&quot;)
  lib/oeqa/selftest 
  lib/oeqa/selftest/__init__.py 
  lib/oeqa/selftest/cfg/__init__.py 
  lib/oeqa/selftest/cfg/mytest.py
  lib/oeqa/selftest/cfg/files/mytest_data.json

2. from poky, setup build env, and from &quot;BUILDDIR&quot; type
  oe-selftest --list-modules

3. expect mytest being listed:
&lt;here&apos;s test modules from &quot;meta/lib/oeqa/selftest/*.py&quot;, like buildhistory etc.&gt;
cfg.mytest

4. run mytest from oe-selftest
   oe-selftest --run-tests cfg.mytest

5. expect tests in &quot;cfg.mytest&quot; being run.

Thanks,
Sharron</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>51680</commentid>
    <comment_count>5</comment_count>
    <who name="Costin">costin.c.constantin</who>
    <bug_when>2015-06-13 20:19:34 +0000</bug_when>
    <thetext>Hi Sharron,

I managed to add few features to oe-selftest, allowing it to support tests from any meta*/lib/oeqa/selftest directories plus subdirectories to them.

Still left to do:
 - considering an external cfg.mytest file for tests. Will be done shortly. 

I will upload the patch upstream.
 
Costin</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>51681</commentid>
    <comment_count>6</comment_count>
    <who name="Costin">costin.c.constantin</who>
    <bug_when>2015-06-14 20:07:33 +0000</bug_when>
    <thetext>Hi Sharron,

For whatever reason, i misunderstood your needs, so please disregard comment #5. 
I&apos;ll come back with a solution shortly.

Costin</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>51736</commentid>
    <comment_count>7</comment_count>
    <who name="Costin">costin.c.constantin</who>
    <bug_when>2015-06-16 12:49:52 +0000</bug_when>
    <thetext>Hello,

Patch submitted to be merged. This is Sharron&apos;s contribution.

Costin</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>52160</commentid>
    <comment_count>8</comment_count>
    <who name="Cathy Shen">cathy.shen</who>
    <bug_when>2015-07-07 08:21:07 +0000</bug_when>
    <thetext>Costin, is it merged?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>52695</commentid>
    <comment_count>9</comment_count>
    <who name="Costin">costin.c.constantin</who>
    <bug_when>2015-07-29 08:15:00 +0000</bug_when>
    <thetext>Hi Cathy,

Just had a chat with Sharron and she proposed a better formatted version of the patch. I will update you after having a look on it</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>52743</commentid>
    <comment_count>10</comment_count>
    <who name="Costin">costin.c.constantin</who>
    <bug_when>2015-07-31 11:24:20 +0000</bug_when>
    <thetext>Hello,

As with the http://git.yoctoproject.org/cgit/cgit.cgi/poky/commit/?id=d2023c34e4c3735d919c35d80daf991aab579500
and 
http://git.yoctoproject.org/cgit/cgit.cgi/poky/commit/?id=51d760e2a7e22f1b07608fc925da343e56a9ae74

oe-selftest considers test files in other layers present in bblayers.conf having lib/oeqa/selftest directory structure.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>53863</commentid>
    <comment_count>11</comment_count>
    <who name="Cathy Shen">cathy.shen</who>
    <bug_when>2015-09-09 08:10:21 +0000</bug_when>
    <thetext>Thanks for the information, Costin. I&apos;d like to close this ticket considering it&apos;s already supported in Yocto.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>54346</commentid>
    <comment_count>12</comment_count>
    <who name="Costin">costin.c.constantin</who>
    <bug_when>2015-09-21 06:43:26 +0000</bug_when>
    <thetext>Thank you Cathy for the update. I delayed this comment because i wanted to clarify few things with Sharron. I will not close this feature until she will update it with her comment if the patches solve her needs. 
Until then marking it as resolved.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>54717</commentid>
    <comment_count>13</comment_count>
    <who name="Alexandru Georgescu">alexandru.c.georgescu</who>
    <bug_when>2015-09-28 11:58:48 +0000</bug_when>
    <thetext>(In reply to comment #12)
&gt; Thank you Cathy for the update. I delayed this comment because i wanted to
&gt; clarify few things with Sharron. I will not close this feature until she
&gt; will update it with her comment if the patches solve her needs. 
&gt; Until then marking it as resolved.

Hi Sharron, can you update with the info Costin needs to close the enhancement?

Thanks,
AlexG</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>54718</commentid>
    <comment_count>14</comment_count>
    <who name="Alexandru Georgescu">alexandru.c.georgescu</who>
    <bug_when>2015-09-28 11:59:17 +0000</bug_when>
    <thetext>Changed the status to NEEDINFO</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>54802</commentid>
    <comment_count>15</comment_count>
    <who name="">sharron.liu</who>
    <bug_when>2015-09-30 06:18:13 +0000</bug_when>
    <thetext>Verified in latest poky (commit 4bc3f09 Sep 23 2015)

meta-mylayer (added to &quot;BBLAYERS&quot;, added to &quot;BBPATH&quot;)
  lib/oeqa/selftest 
  lib/oeqa/selftest/__init__.py 
  lib/oeqa/selftest/cfg/__init__.py 
  lib/oeqa/selftest/cfg/mytest.py
  lib/oeqa/selftest/cfg/files/mytest_data.json

oe-selftest --list-modules
   &gt;&gt; here &quot;cfg.mytest&quot; is not listed  ===&gt; failed

oe-selftest --run-tests cfg.mytest
   &gt;&gt; here &quot;cfg.mytest&quot; run as expected  ==&gt; passed.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>54803</commentid>
    <comment_count>16</comment_count>
    <who name="">sharron.liu</who>
    <bug_when>2015-09-30 06:19:42 +0000</bug_when>
    <thetext>https://bugzilla.yoctoproject.org/show_bug.cgi?id=7865#c15</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>56643</commentid>
    <comment_count>17</comment_count>
    <who name="Stephen K Jolley">sjolley.yp.pm</who>
    <bug_when>2015-11-19 15:57:35 +0000</bug_when>
    <thetext>This was REOPENED</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>57791</commentid>
    <comment_count>18</comment_count>
    <who name="Benjamin Esquivel">benjamin.esquivel</who>
    <bug_when>2016-01-13 16:09:49 +0000</bug_when>
    <thetext>CCing Anibal and Paco</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>58784</commentid>
    <comment_count>19</comment_count>
    <who name="Costin">costin.c.constantin</who>
    <bug_when>2016-02-09 13:36:50 +0000</bug_when>
    <thetext>Hello,

Patch submitted for review</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>59513</commentid>
    <comment_count>20</comment_count>
    <who name="Costin">costin.c.constantin</who>
    <bug_when>2016-02-29 10:07:17 +0000</bug_when>
    <thetext>merged into master: 
http://git.yoctoproject.org/cgit/cgit.cgi/poky/commit/?id=d2a563c32c62908a8c8eb9618f86a3fc9e5fe5bc

Marking as resolved</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>