diff options
author | Richard Purdie <richard.purdie@linuxfoundation.org> | 2018-07-11 11:46:01 +0000 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2018-07-16 13:21:34 +0100 |
commit | 75d5d0e87310d1e7571c3ac0046fe0310eeef707 (patch) | |
tree | 59682f78e0d64bcca85c6c157d38a5f2d148f285 /meta/lib/oeqa | |
parent | 66b034800072da893c643f8ed7a645dd269e0fc4 (diff) | |
download | poky-75d5d0e87310d1e7571c3ac0046fe0310eeef707.tar.gz |
oeqa/runner: Ensure we don't print misleading results output
The current code assumes if something isn't a failure of some
kind, it was a pass. When test case IDs weren't matching, this lead
to very confusing output where things would fail, then be listed as
passing.
This adds code to track successes, ensuring we don't end up in this
position again with unmatched entries being listed as UNKNOWN.
(From OE-Core rev: 4374c296d8963e4f6a1aa7bef7983ad0a1c2fcff)
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/lib/oeqa')
-rw-r--r-- | meta/lib/oeqa/core/runner.py | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/meta/lib/oeqa/core/runner.py b/meta/lib/oeqa/core/runner.py index 16345fab2e..374d30cc38 100644 --- a/meta/lib/oeqa/core/runner.py +++ b/meta/lib/oeqa/core/runner.py | |||
@@ -42,6 +42,8 @@ class OETestResult(_TestResult): | |||
42 | def __init__(self, tc, *args, **kwargs): | 42 | def __init__(self, tc, *args, **kwargs): |
43 | super(OETestResult, self).__init__(*args, **kwargs) | 43 | super(OETestResult, self).__init__(*args, **kwargs) |
44 | 44 | ||
45 | self.successes = [] | ||
46 | |||
45 | self.tc = tc | 47 | self.tc = tc |
46 | self._tc_map_results() | 48 | self._tc_map_results() |
47 | 49 | ||
@@ -58,6 +60,7 @@ class OETestResult(_TestResult): | |||
58 | self.tc._results['errors'] = self.errors | 60 | self.tc._results['errors'] = self.errors |
59 | self.tc._results['skipped'] = self.skipped | 61 | self.tc._results['skipped'] = self.skipped |
60 | self.tc._results['expectedFailures'] = self.expectedFailures | 62 | self.tc._results['expectedFailures'] = self.expectedFailures |
63 | self.tc._results['successes'] = self.successes | ||
61 | 64 | ||
62 | def logSummary(self, component, context_msg=''): | 65 | def logSummary(self, component, context_msg=''): |
63 | elapsed_time = self.tc._run_end_time - self.tc._run_start_time | 66 | elapsed_time = self.tc._run_end_time - self.tc._run_start_time |
@@ -115,13 +118,18 @@ class OETestResult(_TestResult): | |||
115 | 118 | ||
116 | return (found, None) | 119 | return (found, None) |
117 | 120 | ||
121 | def addSuccess(self, test): | ||
122 | #Added so we can keep track of successes too | ||
123 | self.successes.append((test, None)) | ||
124 | super(OETestResult, self).addSuccess(test) | ||
125 | |||
118 | def logDetails(self): | 126 | def logDetails(self): |
119 | self.tc.logger.info("RESULTS:") | 127 | self.tc.logger.info("RESULTS:") |
120 | for case_name in self.tc._registry['cases']: | 128 | for case_name in self.tc._registry['cases']: |
121 | case = self.tc._registry['cases'][case_name] | 129 | case = self.tc._registry['cases'][case_name] |
122 | 130 | ||
123 | result_types = ['failures', 'errors', 'skipped', 'expectedFailures'] | 131 | result_types = ['failures', 'errors', 'skipped', 'expectedFailures', 'successes'] |
124 | result_desc = ['FAILED', 'ERROR', 'SKIPPED', 'EXPECTEDFAIL'] | 132 | result_desc = ['FAILED', 'ERROR', 'SKIPPED', 'EXPECTEDFAIL', 'PASSED'] |
125 | 133 | ||
126 | fail = False | 134 | fail = False |
127 | desc = None | 135 | desc = None |
@@ -143,7 +151,7 @@ class OETestResult(_TestResult): | |||
143 | oeid, desc)) | 151 | oeid, desc)) |
144 | else: | 152 | else: |
145 | self.tc.logger.info("RESULTS - %s - Testcase %s: %s" % (case.id(), | 153 | self.tc.logger.info("RESULTS - %s - Testcase %s: %s" % (case.id(), |
146 | oeid, 'PASSED')) | 154 | oeid, 'UNKNOWN')) |
147 | 155 | ||
148 | class OEListTestsResult(object): | 156 | class OEListTestsResult(object): |
149 | def wasSuccessful(self): | 157 | def wasSuccessful(self): |