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

Side by Side Diff: gm/rebaseline_server/results.py

Issue 26659002: rebaseline_server: extend returned JSON dict to allow for result-editing in coming CL (Closed) Base URL: http://skia.googlecode.com/svn/trunk/
Patch Set: tabs_to_spaces Created 7 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
« no previous file with comments | « no previous file | gm/rebaseline_server/server.py » ('j') | gm/rebaseline_server/server.py » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #!/usr/bin/python 1 #!/usr/bin/python
2 2
3 ''' 3 '''
jcgregorio 2013/10/09 16:34:25 Triple double quotes, not triple single quotes.
epoger 2013/10/09 17:49:18 Done.
4 Copyright 2013 Google Inc. 4 Copyright 2013 Google Inc.
5 5
6 Use of this source code is governed by a BSD-style license that can be 6 Use of this source code is governed by a BSD-style license that can be
7 found in the LICENSE file. 7 found in the LICENSE file.
8 ''' 8 '''
9 9
10 ''' 10 '''
jcgregorio 2013/10/09 16:34:25 Keep all in one pydoc comment.
epoger 2013/10/09 17:49:18 Done.
11 Repackage expected/actual GM results as needed by our HTML rebaseline viewer. 11 Repackage expected/actual GM results as needed by our HTML rebaseline viewer.
12 ''' 12 '''
13 13
14 # System-level imports 14 # System-level imports
15 import fnmatch 15 import fnmatch
16 import json 16 import json
17 import os 17 import os
18 import re 18 import re
19 import sys 19 import sys
20 20
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
71 "Test-Mac10.6-MacMini4.1-GeForce320M-x86-Debug": 1286, 71 "Test-Mac10.6-MacMini4.1-GeForce320M-x86-Debug": 1286,
72 "Test-Mac10.6-MacMini4.1-GeForce320M-x86-Release": 1134, 72 "Test-Mac10.6-MacMini4.1-GeForce320M-x86-Release": 1134,
73 ... 73 ...
74 }, 74 },
75 ... # other categories from CATEGORIES_TO_SUMMARIZE 75 ... # other categories from CATEGORIES_TO_SUMMARIZE
76 }, # end of "categories" dictionary 76 }, # end of "categories" dictionary
77 77
78 "testData": # list of test results, with a dictionary for each 78 "testData": # list of test results, with a dictionary for each
79 [ 79 [
80 { 80 {
81 "index": 0, # index of this result within testData list
81 "builder": "Test-Mac10.6-MacMini4.1-GeForce320M-x86-Debug", 82 "builder": "Test-Mac10.6-MacMini4.1-GeForce320M-x86-Debug",
82 "test": "bigmatrix", 83 "test": "bigmatrix",
83 "config": "8888", 84 "config": "8888",
84 "resultType": "failed", 85 "resultType": "failed",
85 "expectedHashType": "bitmap-64bitMD5", 86 "expectedHashType": "bitmap-64bitMD5",
86 "expectedHashDigest": "10894408024079689926", 87 "expectedHashDigest": "10894408024079689926",
87 "actualHashType": "bitmap-64bitMD5", 88 "actualHashType": "bitmap-64bitMD5",
88 "actualHashDigest": "2409857384569", 89 "actualHashDigest": "2409857384569",
89 }, 90 },
90 ... 91 ...
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after
195 # categories recorded within the gm_actuals AT ALL, and 196 # categories recorded within the gm_actuals AT ALL, and
196 # instead evaluate the result_type ourselves based on what 197 # instead evaluate the result_type ourselves based on what
197 # we see in expectations vs actual checksum? 198 # we see in expectations vs actual checksum?
198 if expected_image == actual_image: 199 if expected_image == actual_image:
199 updated_result_type = gm_json.JSONKEY_ACTUALRESULTS_SUCCEEDED 200 updated_result_type = gm_json.JSONKEY_ACTUALRESULTS_SUCCEEDED
200 else: 201 else:
201 updated_result_type = result_type 202 updated_result_type = result_type
202 203
203 (test, config) = IMAGE_FILENAME_RE.match(image_name).groups() 204 (test, config) = IMAGE_FILENAME_RE.match(image_name).groups()
204 results_for_this_test = { 205 results_for_this_test = {
206 "index": len(test_data),
jcgregorio 2013/10/09 16:34:25 Single quotes for strings.
epoger 2013/10/09 17:49:18 Done.
205 "builder": builder, 207 "builder": builder,
206 "test": test, 208 "test": test,
207 "config": config, 209 "config": config,
208 "resultType": updated_result_type, 210 "resultType": updated_result_type,
209 "actualHashType": actual_image[0], 211 "actualHashType": actual_image[0],
210 "actualHashDigest": str(actual_image[1]), 212 "actualHashDigest": str(actual_image[1]),
211 "expectedHashType": expected_image[0], 213 "expectedHashType": expected_image[0],
212 "expectedHashDigest": str(expected_image[1]), 214 "expectedHashDigest": str(expected_image[1]),
213 } 215 }
214 Results._AddToCategoryDict(category_dict, results_for_this_test) 216 Results._AddToCategoryDict(category_dict, results_for_this_test)
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
250 category_dict: category dict-of-dicts to modify 252 category_dict: category dict-of-dicts to modify
251 category_name: category name, as a string 253 category_name: category name, as a string
252 category_values: list of values we want to make sure are represented 254 category_values: list of values we want to make sure are represented
253 for this category 255 for this category
254 """ 256 """
255 if not category_dict.get(category_name): 257 if not category_dict.get(category_name):
256 category_dict[category_name] = {} 258 category_dict[category_name] = {}
257 for category_value in category_values: 259 for category_value in category_values:
258 if not category_dict[category_name].get(category_value): 260 if not category_dict[category_name].get(category_value):
259 category_dict[category_name][category_value] = 0 261 category_dict[category_name][category_value] = 0
OLDNEW
« no previous file with comments | « no previous file | gm/rebaseline_server/server.py » ('j') | gm/rebaseline_server/server.py » ('J')

Powered by Google App Engine
This is Rietveld 408576698