diff options
author | Enric Balletbo i Serra <enric.balletbo@collabora.com> | 2019-12-24 10:42:13 +0100 |
---|---|---|
committer | Enric Balletbo i Serra <enric.balletbo@collabora.com> | 2019-12-24 10:42:13 +0100 |
commit | b26b1ec1d67217bef91d64547164180cc0c18edd (patch) | |
tree | 5d936523e0296d143ef32215d254537a0aa29e6b | |
parent | f71bb4cacdafde42cced7c4b63af952c5ac3550c (diff) | |
download | cros-ec-tests-b26b1ec1d67217bef91d64547164180cc0c18edd.tar.gz |
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: Enric Balletbo i Serra <enric.balletbo@collabora.com>
-rwxr-xr-x | cros/runners/lava_runner.py | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/cros/runners/lava_runner.py b/cros/runners/lava_runner.py index 75a723d..8a570dd 100755 --- a/cros/runners/lava_runner.py +++ b/cros/runners/lava_runner.py @@ -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] ) |