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

Side by Side Diff: scripts/slave/recipe_modules/test_utils/api.py

Issue 2421733002: Archive retry summary for layout tests along with layout test results. (Closed)
Patch Set: Change --retry-summary to --retry-summary-json and make it take a file path 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
OLDNEW
1 # Copyright 2013 The Chromium Authors. All rights reserved. 1 # Copyright 2013 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be 2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file. 3 # found in the LICENSE file.
4 4
5 from recipe_engine import recipe_api 5 from recipe_engine import recipe_api
6 from recipe_engine import util as recipe_util 6 from recipe_engine import util as recipe_util
7 7
8 from .util import GTestResults, TestResults 8 from .util import GTestResults, TestResults
9 9
10 # TODO(luqui): Destroy this DEPS hack. 10 # TODO(luqui): Destroy this DEPS hack.
(...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after
188 if new_failures: 188 if new_failures:
189 self.m.python.failing_step(step_name, step_text) 189 self.m.python.failing_step(step_name, step_text)
190 else: 190 else:
191 self.m.python.succeeding_step(step_name, step_text) 191 self.m.python.succeeding_step(step_name, step_text)
192 finally: 192 finally:
193 if new_failures: 193 if new_failures:
194 self.m.tryserver.set_test_failure_tryjob_result() 194 self.m.tryserver.set_test_failure_tryjob_result()
195 elif ignored_failures: 195 elif ignored_failures:
196 self.m.step.active_result.presentation.status = self.m.step.WARNING 196 self.m.step.active_result.presentation.status = self.m.step.WARNING
197 197
198 if test.name == 'webkit_tests':
199 self._archive_retry_summary({
200 'failures': sorted(new_failures),
201 'ignored': sorted(ignored_failures)
202 })
203
204 def _archive_retry_summary(self, retry_summary):
205 """Archives the retry summary as JSON, storing it alongside the results
206 from the first run."""
207 script = self.m.chromium.package_repo_resource(
208 'scripts', 'slave', 'chromium', 'archive_layout_test_retry_summary.py')
209 args = [
210 '--retry-summary-json', self.m.json.input(retry_summary),
211 '--build-number', self.m.properties['buildnumber'],
212 '--builder-name', self.m.properties['buildername'],
213 '--gs-bucket', 'gs://chromium-layout-test-archives',
214 ]
215 self.m.python('archive_retry_summary', script, args)
216
198 def create_results_from_json(self, data): 217 def create_results_from_json(self, data):
199 return TestResults(data) 218 return TestResults(data)
200 219
201 @recipe_util.returns_placeholder 220 @recipe_util.returns_placeholder
202 def test_results(self, add_json_log=True): 221 def test_results(self, add_json_log=True):
203 """A placeholder which will expand to '/tmp/file'. 222 """A placeholder which will expand to '/tmp/file'.
204 223
205 The recipe must provide the expected --json-test-results flag. 224 The recipe must provide the expected --json-test-results flag.
206 225
207 The test_results will be an instance of the TestResults class. 226 The test_results will be an instance of the TestResults class.
208 """ 227 """
209 return TestResultsOutputPlaceholder(self, add_json_log) 228 return TestResultsOutputPlaceholder(self, add_json_log)
210 229
211 @recipe_util.returns_placeholder 230 @recipe_util.returns_placeholder
212 def gtest_results(self, add_json_log=True): 231 def gtest_results(self, add_json_log=True):
213 """A placeholder which will expand to 232 """A placeholder which will expand to
214 '--test-launcher-summary-output=/tmp/file'. 233 '--test-launcher-summary-output=/tmp/file'.
215 234
216 Provides the --test-launcher-summary-output flag since --flag=value 235 Provides the --test-launcher-summary-output flag since --flag=value
217 (i.e. a single token in the command line) is the required format. 236 (i.e. a single token in the command line) is the required format.
218 237
219 The test_results will be an instance of the GTestResults class. 238 The test_results will be an instance of the GTestResults class.
220 """ 239 """
221 return GTestResultsOutputPlaceholder(self, add_json_log) 240 return GTestResultsOutputPlaceholder(self, add_json_log)
222
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698