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

Side by Side Diff: typ/json_results.py

Issue 2363773008: Add better logging when failing to load a test. (Closed)
Patch Set: patch for review Created 4 years, 2 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 unified diff | Download patch
« no previous file with comments | « pylintrc ('k') | typ/runner.py » ('j') | typ/tests/main_test.py » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # Copyright 2014 Google Inc. All rights reserved. 1 # Copyright 2014 Google Inc. All rights reserved.
2 # 2 #
3 # Licensed under the Apache License, Version 2.0 (the "License"); 3 # Licensed under the Apache License, Version 2.0 (the "License");
4 # you may not use this file except in compliance with the License. 4 # you may not use this file except in compliance with the License.
5 # You may obtain a copy of the License at 5 # You may obtain a copy of the License at
6 # 6 #
7 # http://www.apache.org/licenses/LICENSE-2.0 7 # http://www.apache.org/licenses/LICENSE-2.0
8 # 8 #
9 # Unless required by applicable law or agreed to in writing, software 9 # Unless required by applicable law or agreed to in writing, software
10 # distributed under the License is distributed on an "AS IS" BASIS, 10 # distributed under the License is distributed on an "AS IS" BASIS,
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after
144 def _actual_results_for_test(test_name, results): 144 def _actual_results_for_test(test_name, results):
145 actuals = [] 145 actuals = []
146 for r in results.results: 146 for r in results.results:
147 if r.name == test_name: 147 if r.name == test_name:
148 if r.actual == ResultType.Failure: 148 if r.actual == ResultType.Failure:
149 actuals.append('FAIL') 149 actuals.append('FAIL')
150 elif r.actual == ResultType.Pass: 150 elif r.actual == ResultType.Pass:
151 actuals.append('PASS') 151 actuals.append('PASS')
152 elif r.actual == ResultType.Skip: 152 elif r.actual == ResultType.Skip:
153 actuals.append('SKIP') 153 actuals.append('SKIP')
154 if not actuals: 154 if not actuals: # pragma: untested
155 actuals.append('SKIP') 155 actuals.append('SKIP')
156 return ' '.join(actuals) 156 return ' '.join(actuals)
157 157
158 158
159 def _add_path_to_trie(trie, path, value): 159 def _add_path_to_trie(trie, path, value):
160 if TEST_SEPARATOR not in path: 160 if TEST_SEPARATOR not in path:
161 trie[path] = value 161 trie[path] = value
162 return 162 return
163 directory, rest = path.split(TEST_SEPARATOR, 1) 163 directory, rest = path.split(TEST_SEPARATOR, 1)
164 if directory not in trie: 164 if directory not in trie:
(...skipping 18 matching lines...) Expand all
183 'filename="full_results.json"') 183 'filename="full_results.json"')
184 lines.append('Content-Type: application/json') 184 lines.append('Content-Type: application/json')
185 lines.append('') 185 lines.append('')
186 lines.append(json.dumps(test_results)) 186 lines.append(json.dumps(test_results))
187 187
188 lines.append('--' + BOUNDARY + '--') 188 lines.append('--' + BOUNDARY + '--')
189 lines.append('') 189 lines.append('')
190 body = CRLF.join(lines) 190 body = CRLF.join(lines)
191 content_type = 'multipart/form-data; boundary=%s' % BOUNDARY 191 content_type = 'multipart/form-data; boundary=%s' % BOUNDARY
192 return content_type, body 192 return content_type, body
OLDNEW
« no previous file with comments | « pylintrc ('k') | typ/runner.py » ('j') | typ/tests/main_test.py » ('J')

Powered by Google App Engine
This is Rietveld 408576698