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

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

Issue 1372723002: Empty per_page_values shouldn't imply test success (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/build
Patch Set: Remove dead code Created 5 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 | Annotate | Revision Log
OLDNEW
1 import json 1 import json
2 2
3 from recipe_engine import recipe_test_api 3 from recipe_engine import recipe_test_api
4 4
5 from .util import GTestResults, TestResults 5 from .util import GTestResults, TestResults
6 6
7 class TestUtilsTestApi(recipe_test_api.RecipeTestApi): 7 class TestUtilsTestApi(recipe_test_api.RecipeTestApi):
8 @recipe_test_api.placeholder_step_data 8 @recipe_test_api.placeholder_step_data
9 def test_results(self, test_results, retcode=None): 9 def test_results(self, test_results, retcode=None):
10 return self.m.json.output(test_results.as_jsonish(), retcode) 10 return self.m.json.output(test_results.as_jsonish(), retcode)
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
105 105
106 retcode = None if passing else 1 106 retcode = None if passing else 1
107 return self.raw_gtest_output(canned_jsonish, retcode) 107 return self.raw_gtest_output(canned_jsonish, retcode)
108 108
109 def raw_gtest_output(self, jsonish, retcode): 109 def raw_gtest_output(self, jsonish, retcode):
110 t = GTestResults(jsonish) 110 t = GTestResults(jsonish)
111 ret = self.gtest_results(t) 111 ret = self.gtest_results(t)
112 ret.retcode = retcode 112 ret.retcode = retcode
113 return ret 113 return ret
114 114
115 def canned_telemetry_gpu_output(self, passing, is_win, swarming=False): 115 def canned_telemetry_gpu_output(self, passing, is_win, swarming=False,
116 empty_per_page_values=False):
116 """Produces a 'json test results' compatible object for telemetry tests.""" 117 """Produces a 'json test results' compatible object for telemetry tests."""
117 jsonish_results = { 118 if empty_per_page_values:
118 'per_page_values': [{'type': 'success' if passing else 'failure', 119 jsonish_results = {
119 'page_id': 0}, 120 'per_page_values': [],
120 {'type': 'success', 121 'pages': { },
121 'page_id': 1}], 122 }
122 'pages': {'0': {'name': 'Test.Test1'}, 123 else:
123 '1': {'name': 'Test.Test2'}}, 124 jsonish_results = {
124 } 125 'per_page_values': [{'type': 'success' if passing else 'failure',
126 'page_id': 0},
127 {'type': 'success',
128 'page_id': 1}],
129 'pages': {'0': {'name': 'Test.Test1'},
130 '1': {'name': 'Test.Test2'}},
131 }
125 132
126 jsonish_summary = { 133 jsonish_summary = {
127 'shards': [ 134 'shards': [
128 { 135 {
129 'failure': not passing, 136 'failure': not passing,
130 'internal_failure': False 137 'internal_failure': False
131 } 138 }
132 ] 139 ]
133 } 140 }
134 141
135 swarming_path = '0\\results.json' if is_win else '0/results.json' 142 swarming_path = '0\\results.json' if is_win else '0/results.json'
136 results_path = swarming_path if swarming else 'results.json' 143 results_path = swarming_path if swarming else 'results.json'
137 files_dict = { 144 files_dict = {
138 results_path: json.dumps(jsonish_results), 145 results_path: json.dumps(jsonish_results),
139 'summary.json': json.dumps(jsonish_summary) 146 'summary.json': json.dumps(jsonish_summary)
140 } 147 }
141 return self.m.raw_io.output_dir(files_dict) 148 return self.m.raw_io.output_dir(files_dict)
142 149
OLDNEW
« no previous file with comments | « scripts/slave/recipe_modules/chromium_tests/steps.py ('k') | scripts/slave/recipes/chromium_trybot.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698