OLD | NEW |
1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
2 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | 2 # Copyright (c) 2012 The Chromium Authors. All rights reserved. |
3 # Use of this source code is governed by a BSD-style license that can be | 3 # Use of this source code is governed by a BSD-style license that can be |
4 # found in the LICENSE file. | 4 # found in the LICENSE file. |
5 | 5 |
6 """ Compare the generated GM images to the baselines """ | 6 """ Compare the generated GM images to the baselines """ |
7 | 7 |
8 # System-level imports | 8 # System-level imports |
9 import os | 9 import os |
10 import sys | 10 import sys |
11 | 11 |
12 from build_step import BuildStep, BuildStepWarning | 12 from build_step import BuildStep, BuildStepWarning |
13 from utils import misc | 13 from utils import misc |
14 import run_gm | 14 import run_gm |
| 15 import skia_vars |
| 16 |
| 17 LIVE_REBASELINE_SERVER_BASEURL = ( |
| 18 'http://skia-tree-status.appspot.com/redirect/rebaseline-server/' |
| 19 'static/view.html#/view.html') |
| 20 |
15 | 21 |
16 class CompareGMs(BuildStep): | 22 class CompareGMs(BuildStep): |
17 def _Run(self): | 23 def _Run(self): |
18 json_summary_path = misc.GetAbsPath(os.path.join( | 24 json_summary_path = misc.GetAbsPath(os.path.join( |
19 self._gm_actual_dir, run_gm.JSON_SUMMARY_FILENAME)) | 25 self._gm_actual_dir, run_gm.JSON_SUMMARY_FILENAME)) |
20 | 26 |
21 # Temporary list of builders who are allowed to fail this step without the | 27 # Temporary list of builders who are allowed to fail this step without the |
22 # bot turning red. | 28 # bot turning red. |
23 may_fail_with_warning = [] | 29 may_fail_with_warning = [] |
24 # This import must happen after BuildStep.__init__ because it requires that | 30 # This import must happen after BuildStep.__init__ because it requires that |
25 # CWD is in PYTHONPATH, and BuildStep.__init__ may change the CWD. | 31 # CWD is in PYTHONPATH, and BuildStep.__init__ may change the CWD. |
26 from gm import display_json_results | 32 from gm import display_json_results |
27 if not display_json_results.Display(json_summary_path): | 33 success = display_json_results.Display(json_summary_path) |
| 34 print ('%s<a href="%s?resultsToLoad=/results/failures&builder=%s">' |
| 35 'link</a>' % ( |
| 36 skia_vars.GetGlobalVariable('latest_gm_failures_preamble'), |
| 37 LIVE_REBASELINE_SERVER_BASEURL, self._builder_name)) |
| 38 if not success: |
28 if self._builder_name in may_fail_with_warning: | 39 if self._builder_name in may_fail_with_warning: |
29 raise BuildStepWarning('Expectations mismatch in %s!' % | 40 raise BuildStepWarning('Expectations mismatch in %s!' % |
30 json_summary_path) | 41 json_summary_path) |
31 else: | 42 else: |
32 raise Exception('Expectations mismatch in %s!' % json_summary_path) | 43 raise Exception('Expectations mismatch in %s!' % json_summary_path) |
33 | 44 |
34 | 45 |
35 if '__main__' == __name__: | 46 if '__main__' == __name__: |
36 sys.exit(BuildStep.RunBuildStep(CompareGMs)) | 47 sys.exit(BuildStep.RunBuildStep(CompareGMs)) |
OLD | NEW |