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

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

Issue 2410613002: Change SwarmingIsolatedScriptTest to upload json format results (Closed)
Patch Set: 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 2015 The Chromium Authors. All rights reserved. 1 # Copyright 2015 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 6
7 7
8 class TestResultsApi(recipe_api.RecipeApi): 8 class TestResultsApi(recipe_api.RecipeApi):
9 """Recipe module to upload gtest json results to test-results server.""" 9 """Recipe module to upload gtest json results to test-results server."""
10 10
11 def upload(self, gtest_results_file, test_type, chrome_revision, 11 def upload(self, results_file, test_type, chrome_revision,
12 test_results_server=None, downgrade_error_to_warning=True): 12 test_results_server=None, downgrade_error_to_warning=True):
13 """Upload gtest results json to test-results. 13 """Upload gtest results json to test-results.
14 14
15 Args: 15 Args:
16 gtest_results_file: Path to file containing gtest json. 16 results_file: Path to file containing test json (could be gtest format or
17 full json result format).
17 test_type: Test type string, e.g. webkit_tests. 18 test_type: Test type string, e.g. webkit_tests.
18 test_results_server: Server where results should be uploaded. 19 test_results_server: Server where results should be uploaded.
19 downgrade_error_to_warning: If True, treat a failure to upload as a 20 downgrade_error_to_warning: If True, treat a failure to upload as a
20 warning. 21 warning.
21 22
22 Returns: 23 Returns:
23 The step result. 24 The step result.
24 """ 25 """
25 try: 26 try:
26 return self.m.python( 27 return self.m.python(
27 name='Upload to test-results [%s]' % test_type, 28 name='Upload to test-results [%s]' % test_type,
28 script=self.resource('upload_gtest_test_results.py'), 29 script=self.resource('upload_test_results.py'),
29 args=['--input-gtest-json', gtest_results_file, 30 args=['--input-json', results_file,
30 '--master-name', self.m.properties['mastername'], 31 '--master-name', self.m.properties['mastername'],
31 '--builder-name', self.m.properties['buildername'], 32 '--builder-name', self.m.properties['buildername'],
32 '--build-number', self.m.properties['buildnumber'], 33 '--build-number', self.m.properties['buildnumber'],
33 '--test-type', test_type, 34 '--test-type', test_type,
34 '--test-results-server', 35 '--test-results-server',
35 test_results_server or self.c.test_results_server, 36 test_results_server or self.c.test_results_server,
36 '--chrome-revision', chrome_revision]) 37 '--chrome-revision', chrome_revision])
37 except self.m.step.StepFailure as f: 38 except self.m.step.StepFailure as f:
38 if downgrade_error_to_warning: 39 if downgrade_error_to_warning:
39 f.result.presentation.status = self.m.step.WARNING 40 f.result.presentation.status = self.m.step.WARNING
40 return f.result 41 return f.result
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698