OLD | NEW |
---|---|
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 Loading... | |
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 + 'expectations/skp') | |
rmistry
2014/08/14 12:44:56
Use posixpath.join instead?
epoger
2014/08/14 14:12:02
Good idea. You never know when Unix might change
| |
119 _SKP_PLATFORMS = [ | 121 _SKP_PLATFORMS = [ |
120 'Test-Mac10.8-MacMini4.1-GeForce320M-x86_64-Debug', | 122 'Test-Mac10.8-MacMini4.1-GeForce320M-x86_64-Debug', |
121 'Test-Ubuntu12-ShuttleA-GTX660-x86-Release', | 123 'Test-Ubuntu12-ShuttleA-GTX660-x86-Release', |
122 ] | 124 ] |
123 | 125 |
124 _HTTP_HEADER_CONTENT_LENGTH = 'Content-Length' | 126 _HTTP_HEADER_CONTENT_LENGTH = 'Content-Length' |
125 _HTTP_HEADER_CONTENT_TYPE = 'Content-Type' | 127 _HTTP_HEADER_CONTENT_TYPE = 'Content-Type' |
126 | 128 |
127 _SERVER = None # This gets filled in by main() | 129 _SERVER = None # This gets filled in by main() |
128 | 130 |
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
215 | 217 |
216 if _SKP_PLATFORMS: | 218 if _SKP_PLATFORMS: |
217 file_handle.write('\n<li>Rendered SKPs:<ul>') | 219 file_handle.write('\n<li>Rendered SKPs:<ul>') |
218 for builder in _SKP_PLATFORMS: | 220 for builder in _SKP_PLATFORMS: |
219 file_handle.write( | 221 file_handle.write( |
220 '\n<li><a href="../live-view.html#live-view.html?%s">' % | 222 '\n<li><a href="../live-view.html#live-view.html?%s">' % |
221 urllib.urlencode({ | 223 urllib.urlencode({ |
222 LIVE_PARAM__SET_A_SECTION: | 224 LIVE_PARAM__SET_A_SECTION: |
223 gm_json.JSONKEY_EXPECTEDRESULTS, | 225 gm_json.JSONKEY_EXPECTEDRESULTS, |
224 LIVE_PARAM__SET_A_DIR: | 226 LIVE_PARAM__SET_A_DIR: |
225 posixpath.join(_SKP_BASE_GS_URL, builder), | 227 posixpath.join(_SKP_BASE_REPO_URL, builder), |
226 LIVE_PARAM__SET_B_SECTION: | 228 LIVE_PARAM__SET_B_SECTION: |
227 gm_json.JSONKEY_ACTUALRESULTS, | 229 gm_json.JSONKEY_ACTUALRESULTS, |
228 LIVE_PARAM__SET_B_DIR: | 230 LIVE_PARAM__SET_B_DIR: |
229 posixpath.join(_SKP_BASE_GS_URL, builder), | 231 posixpath.join(_SKP_BASE_GS_URL, builder), |
230 })) | 232 })) |
231 file_handle.write('expected vs actuals on %s</a></li>' % builder) | 233 file_handle.write('expected vs actuals on %s</a></li>' % builder) |
232 file_handle.write( | 234 file_handle.write( |
233 '\n<li><a href="../live-view.html#live-view.html?%s">' % | 235 '\n<li><a href="../live-view.html#live-view.html?%s">' % |
234 urllib.urlencode({ | 236 urllib.urlencode({ |
235 LIVE_PARAM__SET_A_SECTION: | 237 LIVE_PARAM__SET_A_SECTION: |
(...skipping 345 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
581 """ Handle a GET request for live-generated image diff data. | 583 """ Handle a GET request for live-generated image diff data. |
582 | 584 |
583 Args: | 585 Args: |
584 url_remainder: string indicating which image diffs to generate | 586 url_remainder: string indicating which image diffs to generate |
585 prefetch_only: if True, the user isn't waiting around for results | 587 prefetch_only: if True, the user isn't waiting around for results |
586 """ | 588 """ |
587 param_dict = urlparse.parse_qs(url_remainder) | 589 param_dict = urlparse.parse_qs(url_remainder) |
588 download_all_images = ( | 590 download_all_images = ( |
589 param_dict.get(LIVE_PARAM__DOWNLOAD_ONLY_DIFFERING, [''])[0].lower() | 591 param_dict.get(LIVE_PARAM__DOWNLOAD_ONLY_DIFFERING, [''])[0].lower() |
590 not in ['1', 'true']) | 592 not in ['1', 'true']) |
593 setA_dirs = param_dict[LIVE_PARAM__SET_A_DIR] | |
594 setB_dirs = param_dict[LIVE_PARAM__SET_B_DIR] | |
591 setA_section = self._validate_summary_section( | 595 setA_section = self._validate_summary_section( |
592 param_dict.get(LIVE_PARAM__SET_A_SECTION, [None])[0]) | 596 param_dict.get(LIVE_PARAM__SET_A_SECTION, [None])[0]) |
593 setB_section = self._validate_summary_section( | 597 setB_section = self._validate_summary_section( |
594 param_dict.get(LIVE_PARAM__SET_B_SECTION, [None])[0]) | 598 param_dict.get(LIVE_PARAM__SET_B_SECTION, [None])[0]) |
595 results_obj = compare_rendered_pictures.RenderedPicturesComparisons( | 599 results_obj = compare_rendered_pictures.RenderedPicturesComparisons( |
596 setA_dirs=param_dict[LIVE_PARAM__SET_A_DIR], | 600 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, | 601 setA_section=setA_section, setB_section=setB_section, |
599 image_diff_db=_SERVER.image_diff_db, | 602 image_diff_db=_SERVER.image_diff_db, |
600 diff_base_url='/static/generated-images', | 603 diff_base_url='/static/generated-images', |
601 gs=_SERVER.gs, truncate_results=_SERVER.truncate_results, | 604 gs=_SERVER.gs, truncate_results=_SERVER.truncate_results, |
602 prefetch_only=prefetch_only, download_all_images=download_all_images) | 605 prefetch_only=prefetch_only, download_all_images=download_all_images) |
603 if prefetch_only: | 606 if prefetch_only: |
604 self.send_response(200) | 607 self.send_response(200) |
605 else: | 608 else: |
606 self.send_json_dict(results_obj.get_packaged_results_of_type( | 609 self.send_json_dict(results_obj.get_packaged_results_of_type( |
607 results_mod.KEY__HEADER__RESULTS_ALL)) | 610 results_type=results_mod.KEY__HEADER__RESULTS_ALL)) |
608 | 611 |
609 def do_GET_live_results(self, url_remainder): | 612 def do_GET_live_results(self, url_remainder): |
610 """ Handle a GET request for live-generated image diff data. | 613 """ Handle a GET request for live-generated image diff data. |
611 | 614 |
612 Args: | 615 Args: |
613 url_remainder: string indicating which image diffs to generate | 616 url_remainder: string indicating which image diffs to generate |
614 """ | 617 """ |
615 logging.debug('do_GET_live_results: url_remainder="%s"' % url_remainder) | 618 logging.debug('do_GET_live_results: url_remainder="%s"' % url_remainder) |
616 self._get_live_results_or_prefetch( | 619 self._get_live_results_or_prefetch( |
617 url_remainder=url_remainder, prefetch_only=False) | 620 url_remainder=url_remainder, prefetch_only=False) |
(...skipping 252 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
870 reload_seconds=args.reload, config_pairs=config_pairs, | 873 reload_seconds=args.reload, config_pairs=config_pairs, |
871 builder_regex_list=args.builders, boto_file_path=args.boto, | 874 builder_regex_list=args.builders, boto_file_path=args.boto, |
872 imagediffdb_threads=args.threads) | 875 imagediffdb_threads=args.threads) |
873 if args.truncate: | 876 if args.truncate: |
874 _SERVER.truncate_results = True | 877 _SERVER.truncate_results = True |
875 _SERVER.run() | 878 _SERVER.run() |
876 | 879 |
877 | 880 |
878 if __name__ == '__main__': | 881 if __name__ == '__main__': |
879 main() | 882 main() |
OLD | NEW |