| OLD | NEW |
| 1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
| 2 # Copyright (c) 2013 The Chromium Authors. All rights reserved. | 2 # Copyright (c) 2013 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 """Compares the GM images from archived webpages to the baselines. | 6 """Compares the GM images from archived webpages to the baselines. |
| 7 | 7 |
| 8 This module can be run from the command-line like this: | 8 This module can be run from the command-line like this: |
| 9 | 9 |
| 10 cd buildbot/third_party/chromium_buildbot/slave/\ | 10 cd buildbot/third_party/chromium_buildbot/slave/\ |
| 11 Skia_Shuttle_Ubuntu12_ATI5770_Float_Release_64/build/trunk | 11 Test-Ubuntu12-ShuttleA-ATI5770-x86_64-Release/build/trunk |
| 12 | 12 |
| 13 PYTHONPATH=../../../../site_config:\ | 13 PYTHONPATH=../../../../site_config:\ |
| 14 ../../../../scripts \ | 14 ../../../../scripts \ |
| 15 python ../../../../../../slave/skia_slave_scripts/\ | 15 python ../../../../../../slave/skia_slave_scripts/\ |
| 16 compare_and_upload_webpage_gms.py \ | 16 compare_and_upload_webpage_gms.py \ |
| 17 --configuration "Debug" --target_platform "" --revision 0 \ | 17 --configuration "Debug" --target_platform "" --revision 0 \ |
| 18 --autogen_svn_baseurl "" --make_flags "" --test_args "" --gm_args "" \ | 18 --autogen_svn_baseurl "" --make_flags "" --test_args "" --gm_args "" \ |
| 19 --bench_args "" --num_cores 8 --perf_output_basedir "" \ | 19 --bench_args "" --num_cores 8 --perf_output_basedir "" \ |
| 20 --builder_name Skia_Shuttle_Ubuntu12_ATI5770_Float_Release_64 \ | 20 --builder_name Test-Ubuntu12-ShuttleA-ATI5770-x86_64-Release \ |
| 21 --got_revision 0 --gm_image_subdir base-shuttle_ubuntu12_ati5770 \ | 21 --got_revision 0 --gm_image_subdir base-shuttle_ubuntu12_ati5770 \ |
| 22 --is_try False --do_upload_results True --dest_gsbase gs://rmistry | 22 --is_try False --do_upload_results True --dest_gsbase gs://rmistry |
| 23 | 23 |
| 24 """ | 24 """ |
| 25 | 25 |
| 26 import os | 26 import os |
| 27 import posixpath | 27 import posixpath |
| 28 import shutil | 28 import shutil |
| 29 import sys | 29 import sys |
| 30 import tempfile | 30 import tempfile |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 92 self._storage_playback_dirs.PlaybackGmExpectedDir(), | 92 self._storage_playback_dirs.PlaybackGmExpectedDir(), |
| 93 gs_utils.TIMESTAMP_COMPLETED_FILENAME)) | 93 gs_utils.TIMESTAMP_COMPLETED_FILENAME)) |
| 94 # Check if gm-actual exists on Google Storage. | 94 # Check if gm-actual exists on Google Storage. |
| 95 self._gm_actual_exists_on_storage = gs_utils.DoesStorageObjectExist( | 95 self._gm_actual_exists_on_storage = gs_utils.DoesStorageObjectExist( |
| 96 posixpath.join(self._dest_gsbase, | 96 posixpath.join(self._dest_gsbase, |
| 97 self._storage_playback_dirs.PlaybackGmActualDir(), | 97 self._storage_playback_dirs.PlaybackGmActualDir(), |
| 98 gs_utils.TIMESTAMP_COMPLETED_FILENAME)) | 98 gs_utils.TIMESTAMP_COMPLETED_FILENAME)) |
| 99 | 99 |
| 100 def _Run(self): | 100 def _Run(self): |
| 101 # Right now, we only write images on one builder, since it takes too long. | 101 # Right now, we only write images on one builder, since it takes too long. |
| 102 if self._builder_name != 'Skia_Shuttle_Ubuntu12_ATI5770_Float_Debug_64': | 102 if self._builder_name != 'Test-Ubuntu12-ShuttleA-ATI5770-x86_64-Debug': |
| 103 return | 103 return |
| 104 | 104 |
| 105 cmd = [self._PathToBinary('skdiff'), | 105 cmd = [self._PathToBinary('skdiff'), |
| 106 '--listfilenames', | 106 '--listfilenames', |
| 107 '--nodiffs', | 107 '--nodiffs', |
| 108 '--nomatch', gs_utils.TIMESTAMP_STARTED_FILENAME, | 108 '--nomatch', gs_utils.TIMESTAMP_STARTED_FILENAME, |
| 109 '--nomatch', gs_utils.TIMESTAMP_COMPLETED_FILENAME, | 109 '--nomatch', gs_utils.TIMESTAMP_COMPLETED_FILENAME, |
| 110 '--nomatch', gs_utils.LAST_REBASELINED_BY_FILENAME, | 110 '--nomatch', gs_utils.LAST_REBASELINED_BY_FILENAME, |
| 111 '--nomatch', LAST_COMPARISON_FILENAME, | 111 '--nomatch', LAST_COMPARISON_FILENAME, |
| 112 '--failonresult', 'DifferentPixels', | 112 '--failonresult', 'DifferentPixels', |
| 113 '--failonresult', 'DifferentSizes', | 113 '--failonresult', 'DifferentSizes', |
| 114 '--failonresult', 'DifferentOther', | 114 '--failonresult', 'DifferentOther', |
| 115 '--failonresult', 'CouldNotCompare', | 115 '--failonresult', 'CouldNotCompare', |
| 116 '--failonresult', 'Unknown', | 116 '--failonresult', 'Unknown', |
| 117 self._local_playback_dirs.PlaybackGmExpectedDir(), | 117 self._local_playback_dirs.PlaybackGmExpectedDir(), |
| 118 self._local_playback_dirs.PlaybackGmActualDir(), | 118 self._local_playback_dirs.PlaybackGmActualDir(), |
| 119 ] | 119 ] |
| 120 | 120 |
| 121 # Temporary list of builders who are allowed to fail this step without the | 121 # Temporary list of builders who are allowed to fail this step without the |
| 122 # bot turning red. | 122 # bot turning red. |
| 123 may_fail_with_warning = [ | 123 may_fail_with_warning = [ |
| 124 'Skia_Shuttle_Ubuntu12_ATI5770_Float_Debug_32', | 124 'Test-Ubuntu12-ShuttleA-ATI5770-x86-Debug', |
| 125 'Skia_Shuttle_Ubuntu12_ATI5770_Float_Debug_32_Trybot', | 125 'Test-Ubuntu12-ShuttleA-ATI5770-x86-Debug-Trybot', |
| 126 'Skia_Shuttle_Ubuntu12_ATI5770_Float_Release_32', | 126 'Test-Ubuntu12-ShuttleA-ATI5770-x86-Release', |
| 127 'Skia_Shuttle_Ubuntu12_ATI5770_Float_Release_32_Trybot', | 127 'Test-Ubuntu12-ShuttleA-ATI5770-x86-Release-Trybot', |
| 128 'Skia_Shuttle_Win7_Intel_Float_Debug_64', | 128 'Test-Win7-ShuttleA-HD2000-x86_64-Debug', |
| 129 'Skia_Shuttle_Win7_Intel_Float_Debug_64_Trybot', | 129 'Test-Win7-ShuttleA-HD2000-x86_64-Debug-Trybot', |
| 130 'Skia_Shuttle_Win7_Intel_Float_Release_64', | 130 'Test-Win7-ShuttleA-HD2000-x86_64-Release', |
| 131 'Skia_Shuttle_Win7_Intel_Float_Release_64_Trybot', | 131 'Test-Win7-ShuttleA-HD2000-x86_64-Release-Trybot', |
| 132 'Skia_Mac_Float_Debug_64', | 132 'Test-Mac10.6-MacMini4.1-GeForce320M-x86_64-Debug', |
| 133 'Skia_Mac_Float_Debug_64_Trybot', | 133 'Test-Mac10.6-MacMini4.1-GeForce320M-x86_64-Debug-Trybot', |
| 134 'Skia_Mac_Float_Release_64', | 134 'Test-Mac10.6-MacMini4.1-GeForce320M-x86_64-Release', |
| 135 'Skia_Mac_Float_Release_64_Trybot', | 135 'Test-Mac10.6-MacMini4.1-GeForce320M-x86_64-Release-Trybot', |
| 136 'Skia_MacMiniLion_Float_Debug_64', | 136 'Test-Mac10.7-MacMini4.1-GeForce320M-x86_64-Debug', |
| 137 'Skia_MacMiniLion_Float_Debug_64_Trybot', | 137 'Test-Mac10.7-MacMini4.1-GeForce320M-x86_64-Debug-Trybot', |
| 138 'Skia_MacMiniLion_Float_Release_64', | 138 'Test-Mac10.7-MacMini4.1-GeForce320M-x86_64-Release', |
| 139 'Skia_MacMiniLion_Float_Release_64_Trybot', | 139 'Test-Mac10.7-MacMini4.1-GeForce320M-x86_64-Release-Trybot', |
| 140 ] | 140 ] |
| 141 | 141 |
| 142 # Fail with a warning if the gm_actual directory on Google Storage is | 142 # Fail with a warning if the gm_actual directory on Google Storage is |
| 143 # currently being rebaselined else running this Build step will result in | 143 # currently being rebaselined else running this Build step will result in |
| 144 # data being in an inconsistent state. | 144 # data being in an inconsistent state. |
| 145 if gs_utils.DoesStorageObjectExist( | 145 if gs_utils.DoesStorageObjectExist( |
| 146 posixpath.join(self._dest_gsbase, | 146 posixpath.join(self._dest_gsbase, |
| 147 self._storage_playback_dirs.PlaybackGmActualDir(), | 147 self._storage_playback_dirs.PlaybackGmActualDir(), |
| 148 REBASELINE_IN_PROGRESS_FILENAME)): | 148 REBASELINE_IN_PROGRESS_FILENAME)): |
| 149 raise Exception( | 149 raise Exception( |
| (...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 314 f = open(comparison_file, 'r') | 314 f = open(comparison_file, 'r') |
| 315 try: | 315 try: |
| 316 value = f.read() | 316 value = f.read() |
| 317 return value.strip() | 317 return value.strip() |
| 318 finally: | 318 finally: |
| 319 f.close() | 319 f.close() |
| 320 | 320 |
| 321 | 321 |
| 322 if '__main__' == __name__: | 322 if '__main__' == __name__: |
| 323 sys.exit(BuildStep.RunBuildStep(CompareAndUploadWebpageGMs)) | 323 sys.exit(BuildStep.RunBuildStep(CompareAndUploadWebpageGMs)) |
| OLD | NEW |