Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(138)

Unified Diff: third_party/typ/typ/json_results.py

Issue 2289303002: Roll typ to v0.9.7. (Closed)
Patch Set: Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/typ/run ('k') | third_party/typ/typ/runner.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/typ/typ/json_results.py
diff --git a/third_party/typ/typ/json_results.py b/third_party/typ/typ/json_results.py
index 807c7548aca3eab23e17333b4a1deaca06ff0857..b8500bf4d8cfd88e202c48dd3c22431aeab26d2b 100644
--- a/third_party/typ/typ/json_results.py
+++ b/third_party/typ/typ/json_results.py
@@ -91,12 +91,11 @@ def make_full_results(metadata, seconds_since_epoch, all_test_names, results):
for test_name in all_test_names:
value = OrderedDict()
+ value['actual'] = _actual_results_for_test(test_name, results)
if test_name in skipped_tests:
value['expected'] = 'SKIP'
- value['actual'] = 'SKIP'
else:
value['expected'] = 'PASS'
- value['actual'] = _actual_results_for_test(test_name, results)
if value['actual'].endswith('FAIL'):
value['is_unexpected'] = True
_add_path_to_trie(full_results['tests'], test_name, value)
@@ -127,7 +126,13 @@ def failed_test_names(results):
for r in results.results:
if r.actual == ResultType.Failure:
names.add(r.name)
- elif r.actual == ResultType.Pass and r.name in names:
+ elif ((r.actual == ResultType.Pass or r.actual == ResultType.Skip)
+ and r.name in names):
+ # This check indicates that a test failed, and then either passed
+ # or was skipped on a retry. It is somewhat counterintuitive
+ # that a test that failed and then skipped wouldn't be considered
+ # failed, but that's at least consistent with a test that is
+ # skipped every time.
names.remove(r.name)
return names
@@ -144,8 +149,10 @@ def _actual_results_for_test(test_name, results):
actuals.append('FAIL')
elif r.actual == ResultType.Pass:
actuals.append('PASS')
-
- assert actuals, 'We did not find any result data for %s.' % test_name
+ elif r.actual == ResultType.Skip:
+ actuals.append('SKIP')
+ if not actuals:
+ actuals.append('SKIP')
return ' '.join(actuals)
« no previous file with comments | « third_party/typ/run ('k') | third_party/typ/typ/runner.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698