OLD | NEW |
---|---|
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, |
Paweł Hajdan Jr.
2016/10/11 16:36:26
It seems useful to have explicit way of knowing ty
estaab
2016/10/13 15:46:39
I agree with Paweł, this should have been explicit
nednguyen
2016/10/13 15:54:35
I don't find how splitting the uploader into 2 scr
estaab
2016/10/20 04:56:41
Sorry, I didn't mean that we need multiple scripts
| |
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 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 result json. Supported format are: |
17 ttest format & full json results format ( | |
18 http://www.chromium.org/developers/the-json-test-results-format). | |
17 test_type: Test type string, e.g. webkit_tests. | 19 test_type: Test type string, e.g. webkit_tests. |
18 test_results_server: Server where results should be uploaded. | 20 test_results_server: Server where results should be uploaded. |
19 downgrade_error_to_warning: If True, treat a failure to upload as a | 21 downgrade_error_to_warning: If True, treat a failure to upload as a |
20 warning. | 22 warning. |
21 | 23 |
22 Returns: | 24 Returns: |
23 The step result. | 25 The step result. |
24 """ | 26 """ |
25 try: | 27 try: |
26 return self.m.python( | 28 return self.m.python( |
27 name='Upload to test-results [%s]' % test_type, | 29 name='Upload to test-results [%s]' % test_type, |
28 script=self.resource('upload_gtest_test_results.py'), | 30 script=self.resource('upload_test_results.py'), |
29 args=['--input-gtest-json', gtest_results_file, | 31 args=['--input-json', results_file, |
ghost stip (do not use)
2016/10/13 07:49:20
this broke test uploading for android. should we r
| |
30 '--master-name', self.m.properties['mastername'], | 32 '--master-name', self.m.properties['mastername'], |
31 '--builder-name', self.m.properties['buildername'], | 33 '--builder-name', self.m.properties['buildername'], |
32 '--build-number', self.m.properties['buildnumber'], | 34 '--build-number', self.m.properties['buildnumber'], |
33 '--test-type', test_type, | 35 '--test-type', test_type, |
34 '--test-results-server', | 36 '--test-results-server', |
35 test_results_server or self.c.test_results_server, | 37 test_results_server or self.c.test_results_server, |
36 '--chrome-revision', chrome_revision]) | 38 '--chrome-revision', chrome_revision]) |
37 except self.m.step.StepFailure as f: | 39 except self.m.step.StepFailure as f: |
38 if downgrade_error_to_warning: | 40 if downgrade_error_to_warning: |
39 f.result.presentation.status = self.m.step.WARNING | 41 f.result.presentation.status = self.m.step.WARNING |
40 return f.result | 42 return f.result |
OLD | NEW |