runners: lava_runner: Return only the specific test short name

The id() method returns a string identifying the specific test case. This
is usually the full name of the test method, including the module and
class name. For now it is not really useful have this information
printed on this runner, so strip the module and the class name and only
print the specific test name.
Signed-off-by: default avatarEnric Balletbo i Serra <enric.balletbo@collabora.com>
parent f71bb4ca
......@@ -21,25 +21,29 @@ class LavaTextTestResult(unittest.TestResult):
def addSuccess(self, test):
unittest.TestResult.addSuccess(self, test)
self.runner.writeUpdate(
"<LAVA_SIGNAL_TESTCASE TEST_CASE_ID=%s RESULT=pass>\n" % test.id()
"<LAVA_SIGNAL_TESTCASE TEST_CASE_ID=%s RESULT=pass>\n"
% test.id().rsplit(".")[-1]
)
def addError(self, test, err):
unittest.TestResult.addError(self, test, err)
self.runner.writeUpdate(
"<LAVA_SIGNAL_TESTCASE TEST_CASE_ID=%s RESULT=unknown>\n" % test.id()
"<LAVA_SIGNAL_TESTCASE TEST_CASE_ID=%s RESULT=unknown>\n"
% test.id().rsplit(".")[-1]
)
def addFailure(self, test, err):
unittest.TestResult.addFailure(self, test, err)
self.runner.writeUpdate(
"<LAVA_SIGNAL_TESTCASE TEST_CASE_ID=%s RESULT=fail>\n" % test.id()
"<LAVA_SIGNAL_TESTCASE TEST_CASE_ID=%s RESULT=fail>\n"
% test.id().rsplit(".")[-1]
)
def addSkip(self, test, reason):
unittest.TestResult.addSkip(self, test, reason)
self.runner.writeUpdate(
"<LAVA_SIGNAL_TESTCASE TEST_CASE_ID=%s RESULT=skip>\n" % test.id()
"<LAVA_SIGNAL_TESTCASE TEST_CASE_ID=%s RESULT=skip>\n"
% test.id().rsplit(".")[-1]
)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment