[harness-automation] save case failure times (#4261)

Save failure times for each case for judging if case passes randomly.
This commit is contained in:
Jing
2019-11-06 07:03:16 -08:00
committed by Jonathan Hui
parent 56354634b9
commit 082c1c79f5
@@ -106,10 +106,14 @@ class SimpleTestResult(unittest.TestResult):
test (TestCase): The test just run
passed (bool): Whether the case is passed
"""
fails = self.result.get(test.__class__.__name__, {}).get('fails', 0)
if passed is False:
fails += 1
self.result[str(test.__class__.__name__)] = {
'started': self.started,
'stopped': time.strftime('%Y-%m-%dT%H:%M:%S'),
'passed': passed,
'fails': fails,
'error': error,
'executions': SimpleTestResult.executions,
}