Skip to contentSkip to conversation

oeqa/utils/decorators: Append the testname without the full path

PATCH New [email protected] 1 participant 1 message Sep 29, 2015

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 oeqa/utils/decorators: Append the testname without the full path

From: Leonardo Sandoval <[email protected]>

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):

---
 meta/lib/oeqa/utils/decorators.py | 4 ++++
 1 file changed, 4 insertions(+)
meta/lib/oeqa/utils/decorators.py +4 -0
index 7116208..f55e3d8 100644
@@ -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)
Signature · 1 line
1.8.4.5