]> code.ossystems Code Review - openembedded-core.git/commitdiff
oeqa/utils/decorators: Append the testname without the full path
authorLeonardo Sandoval <leonardo.sandoval.gonzalez@linux.intel.com>
Tue, 29 Sep 2015 06:27:07 +0000 (06:27 +0000)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Thu, 1 Oct 2015 06:40:23 +0000 (07:40 +0100)
When getting the failures/errors/skipped lists, include the
unit test without the full path.

This issue was found on this scenario

    | test_1_logrotate_setup (oeqa.runtime.logrotate.LogrotateTest) ... FAIL
    | test_2_logrotate (oeqa.runtime.logrotate.LogrotateTest) ... ok

Where test_1_logrotate failed and test_2_logrotate should not have
run because

    @skipUnlessPassed("test_1_logrotate_setup")
    def test_2_logrotate(self):

Signed-off-by: Leonardo Sandoval <leonardo.sandoval.gonzalez@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/lib/oeqa/utils/decorators.py

index 7a86970873515ae6bf2b7a53765503a3c671d799..2169a20884b1ab45347b7d31c0d74fd004ee0528 100644 (file)
@@ -33,6 +33,10 @@ class getResults(object):
                     ret.append(s.replace("setUpModule (", "").replace(")",""))
                 else:
                     ret.append(s)
+                # Append also the test without the full path
+                testname = s.split('.')[-1]
+                if testname:
+                    ret.append(testname)
             return ret
         self.faillist = handleList(upperf.f_locals['result'].failures)
         self.errorlist = handleList(upperf.f_locals['result'].errors)