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

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

Issue 474813002: rebaseline_server: include setA/setB descriptions in output JSON (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: use posixpath.join() Created 6 years, 4 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
« no previous file with comments | « gm/rebaseline_server/results.py ('k') | gm/rebaseline_server/static/constants.js » ('j') | no next file with comments »
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 """
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 HTTP server for our HTML rebaseline viewer. 9 HTTP server for our HTML rebaseline viewer.
10 """ 10 """
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after
109 CONFIG_PAIRS_TO_COMPARE = [('8888', 'gpu')] 109 CONFIG_PAIRS_TO_COMPARE = [('8888', 'gpu')]
110 110
111 # SKP results that are available to compare. 111 # SKP results that are available to compare.
112 # 112 #
113 # TODO(stephana): We don't actually want to maintain this list of platforms. 113 # TODO(stephana): We don't actually want to maintain this list of platforms.
114 # We are just putting them in here for now, as "convenience" links for testing 114 # We are just putting them in here for now, as "convenience" links for testing
115 # SKP diffs. 115 # SKP diffs.
116 # Ultimately, we will depend on buildbot steps linking to their own diffs on 116 # Ultimately, we will depend on buildbot steps linking to their own diffs on
117 # the shared rebaseline_server instance. 117 # the shared rebaseline_server instance.
118 _SKP_BASE_GS_URL = 'gs://' + buildbot_globals.Get('skp_summaries_bucket') 118 _SKP_BASE_GS_URL = 'gs://' + buildbot_globals.Get('skp_summaries_bucket')
119 _SKP_BASE_REPO_URL = (
120 compare_rendered_pictures.REPO_URL_PREFIX + posixpath.join(
121 'expectations', 'skp'))
119 _SKP_PLATFORMS = [ 122 _SKP_PLATFORMS = [
120 'Test-Mac10.8-MacMini4.1-GeForce320M-x86_64-Debug', 123 'Test-Mac10.8-MacMini4.1-GeForce320M-x86_64-Debug',
121 'Test-Ubuntu12-ShuttleA-GTX660-x86-Release', 124 'Test-Ubuntu12-ShuttleA-GTX660-x86-Release',
122 ] 125 ]
123 126
124 _HTTP_HEADER_CONTENT_LENGTH = 'Content-Length' 127 _HTTP_HEADER_CONTENT_LENGTH = 'Content-Length'
125 _HTTP_HEADER_CONTENT_TYPE = 'Content-Type' 128 _HTTP_HEADER_CONTENT_TYPE = 'Content-Type'
126 129
127 _SERVER = None # This gets filled in by main() 130 _SERVER = None # This gets filled in by main()
128 131
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
215 218
216 if _SKP_PLATFORMS: 219 if _SKP_PLATFORMS:
217 file_handle.write('\n<li>Rendered SKPs:<ul>') 220 file_handle.write('\n<li>Rendered SKPs:<ul>')
218 for builder in _SKP_PLATFORMS: 221 for builder in _SKP_PLATFORMS:
219 file_handle.write( 222 file_handle.write(
220 '\n<li><a href="../live-view.html#live-view.html?%s">' % 223 '\n<li><a href="../live-view.html#live-view.html?%s">' %
221 urllib.urlencode({ 224 urllib.urlencode({
222 LIVE_PARAM__SET_A_SECTION: 225 LIVE_PARAM__SET_A_SECTION:
223 gm_json.JSONKEY_EXPECTEDRESULTS, 226 gm_json.JSONKEY_EXPECTEDRESULTS,
224 LIVE_PARAM__SET_A_DIR: 227 LIVE_PARAM__SET_A_DIR:
225 posixpath.join(_SKP_BASE_GS_URL, builder), 228 posixpath.join(_SKP_BASE_REPO_URL, builder),
226 LIVE_PARAM__SET_B_SECTION: 229 LIVE_PARAM__SET_B_SECTION:
227 gm_json.JSONKEY_ACTUALRESULTS, 230 gm_json.JSONKEY_ACTUALRESULTS,
228 LIVE_PARAM__SET_B_DIR: 231 LIVE_PARAM__SET_B_DIR:
229 posixpath.join(_SKP_BASE_GS_URL, builder), 232 posixpath.join(_SKP_BASE_GS_URL, builder),
230 })) 233 }))
231 file_handle.write('expected vs actuals on %s</a></li>' % builder) 234 file_handle.write('expected vs actuals on %s</a></li>' % builder)
232 file_handle.write( 235 file_handle.write(
233 '\n<li><a href="../live-view.html#live-view.html?%s">' % 236 '\n<li><a href="../live-view.html#live-view.html?%s">' %
234 urllib.urlencode({ 237 urllib.urlencode({
235 LIVE_PARAM__SET_A_SECTION: 238 LIVE_PARAM__SET_A_SECTION:
(...skipping 345 matching lines...) Expand 10 before | Expand all | Expand 10 after
581 """ Handle a GET request for live-generated image diff data. 584 """ Handle a GET request for live-generated image diff data.
582 585
583 Args: 586 Args:
584 url_remainder: string indicating which image diffs to generate 587 url_remainder: string indicating which image diffs to generate
585 prefetch_only: if True, the user isn't waiting around for results 588 prefetch_only: if True, the user isn't waiting around for results
586 """ 589 """
587 param_dict = urlparse.parse_qs(url_remainder) 590 param_dict = urlparse.parse_qs(url_remainder)
588 download_all_images = ( 591 download_all_images = (
589 param_dict.get(LIVE_PARAM__DOWNLOAD_ONLY_DIFFERING, [''])[0].lower() 592 param_dict.get(LIVE_PARAM__DOWNLOAD_ONLY_DIFFERING, [''])[0].lower()
590 not in ['1', 'true']) 593 not in ['1', 'true'])
594 setA_dirs = param_dict[LIVE_PARAM__SET_A_DIR]
595 setB_dirs = param_dict[LIVE_PARAM__SET_B_DIR]
591 setA_section = self._validate_summary_section( 596 setA_section = self._validate_summary_section(
592 param_dict.get(LIVE_PARAM__SET_A_SECTION, [None])[0]) 597 param_dict.get(LIVE_PARAM__SET_A_SECTION, [None])[0])
593 setB_section = self._validate_summary_section( 598 setB_section = self._validate_summary_section(
594 param_dict.get(LIVE_PARAM__SET_B_SECTION, [None])[0]) 599 param_dict.get(LIVE_PARAM__SET_B_SECTION, [None])[0])
595 results_obj = compare_rendered_pictures.RenderedPicturesComparisons( 600 results_obj = compare_rendered_pictures.RenderedPicturesComparisons(
596 setA_dirs=param_dict[LIVE_PARAM__SET_A_DIR], 601 setA_dirs=setA_dirs, setB_dirs=setB_dirs,
597 setB_dirs=param_dict[LIVE_PARAM__SET_B_DIR],
598 setA_section=setA_section, setB_section=setB_section, 602 setA_section=setA_section, setB_section=setB_section,
599 image_diff_db=_SERVER.image_diff_db, 603 image_diff_db=_SERVER.image_diff_db,
600 diff_base_url='/static/generated-images', 604 diff_base_url='/static/generated-images',
601 gs=_SERVER.gs, truncate_results=_SERVER.truncate_results, 605 gs=_SERVER.gs, truncate_results=_SERVER.truncate_results,
602 prefetch_only=prefetch_only, download_all_images=download_all_images) 606 prefetch_only=prefetch_only, download_all_images=download_all_images)
603 if prefetch_only: 607 if prefetch_only:
604 self.send_response(200) 608 self.send_response(200)
605 else: 609 else:
606 self.send_json_dict(results_obj.get_packaged_results_of_type( 610 self.send_json_dict(results_obj.get_packaged_results_of_type(
607 results_mod.KEY__HEADER__RESULTS_ALL)) 611 results_type=results_mod.KEY__HEADER__RESULTS_ALL))
608 612
609 def do_GET_live_results(self, url_remainder): 613 def do_GET_live_results(self, url_remainder):
610 """ Handle a GET request for live-generated image diff data. 614 """ Handle a GET request for live-generated image diff data.
611 615
612 Args: 616 Args:
613 url_remainder: string indicating which image diffs to generate 617 url_remainder: string indicating which image diffs to generate
614 """ 618 """
615 logging.debug('do_GET_live_results: url_remainder="%s"' % url_remainder) 619 logging.debug('do_GET_live_results: url_remainder="%s"' % url_remainder)
616 self._get_live_results_or_prefetch( 620 self._get_live_results_or_prefetch(
617 url_remainder=url_remainder, prefetch_only=False) 621 url_remainder=url_remainder, prefetch_only=False)
(...skipping 252 matching lines...) Expand 10 before | Expand all | Expand 10 after
870 reload_seconds=args.reload, config_pairs=config_pairs, 874 reload_seconds=args.reload, config_pairs=config_pairs,
871 builder_regex_list=args.builders, boto_file_path=args.boto, 875 builder_regex_list=args.builders, boto_file_path=args.boto,
872 imagediffdb_threads=args.threads) 876 imagediffdb_threads=args.threads)
873 if args.truncate: 877 if args.truncate:
874 _SERVER.truncate_results = True 878 _SERVER.truncate_results = True
875 _SERVER.run() 879 _SERVER.run()
876 880
877 881
878 if __name__ == '__main__': 882 if __name__ == '__main__':
879 main() 883 main()
OLDNEW
« no previous file with comments | « gm/rebaseline_server/results.py ('k') | gm/rebaseline_server/static/constants.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698