Changeset 85905 in webkit
- Timestamp:
- May 5, 2011 5:28:21 PM (13 years ago)
- Location:
- trunk/Tools
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Tools/ChangeLog
r85898 r85905 1 2011-05-05 Steve Lacey <sjl@chromium.org> 2 3 Reviewed by Ojan Vafai. 4 5 Fix generation of results html file by passing relative path to scm 6 methods. 7 Generate diff images for results html file. 8 9 https://bugs.webkit.org/show_bug.cgi?id=60086 10 11 * Scripts/webkitpy/layout_tests/rebaseline_chromium_webkit_tests.py: 12 * Scripts/webkitpy/layout_tests/rebaseline_chromium_webkit_tests_unittest.py: 13 1 14 2011-05-05 Andy Estes <aestes@apple.com> 2 15 -
trunk/Tools/Scripts/webkitpy/layout_tests/rebaseline_chromium_webkit_tests.py
r84730 r85905 406 406 self._filesystem.move(temp_name, expected_fullpath) 407 407 408 # FIXME: SCM module doesn't handle paths that aren't relative to the checkout_root consistently. 409 self._filesystem.chdir(self._scm.checkout_root) 410 path_from_base = self._filesystem.relpath(expected_fullpath, self._filesystem.getcwd()) 408 path_from_base = self._filesystem.relpath(expected_fullpath) 411 409 if self._scm.exists(path_from_base): 412 410 _log.info(' Updating %s' % relpath) … … 544 542 """ 545 543 544 baseline_relpath = self._filesystem.relpath(baseline_fullpath) 545 _log.debug(' Html: create baselines for "%s"', baseline_relpath) 546 546 547 if (not baseline_fullpath 547 548 or not self._filesystem.exists(baseline_fullpath)): 549 _log.debug(' Html: Does not exist: "%s"', baseline_fullpath) 548 550 return 549 551 550 if not self._scm.exists(baseline_fullpath): 552 if not self._scm.exists(baseline_relpath): 553 _log.debug(' Html: Does not exist in scm: "%s"', baseline_relpath) 551 554 return 552 555 … … 561 564 # Get the old baseline from the repository and save to the html directory. 562 565 try: 563 output = self._scm.show_head(baseline_ fullpath)566 output = self._scm.show_head(baseline_relpath) 564 567 except ScriptError, e: 565 568 _log.warning(e) … … 578 581 579 582 # Get the diff between old and new baselines and save to the html dir. 583 diff_file = get_result_file_fullpath(self._filesystem, 584 self._options.html_directory, 585 baseline_filename, 586 self._platform, 'diff') 587 has_diff = False 580 588 if baseline_filename.upper().endswith('.TXT'): 581 output = self._scm.diff_for_file(baseline_ fullpath, log=_log)589 output = self._scm.diff_for_file(baseline_relpath, log=_log) 582 590 if output: 583 diff_file = get_result_file_fullpath(self._filesystem,584 self._options.html_directory, baseline_filename,585 self._platform, 'diff')586 591 self._filesystem.write_text_file(diff_file, output) 587 _log.debug(' Html: created baseline diff file: "%s".', diff_file) 592 has_diff = True 593 elif baseline_filename.upper().endswith('.PNG'): 594 old_file = get_result_file_fullpath(self._filesystem, 595 self._options.html_directory, 596 baseline_filename, 597 self._platform, 'old') 598 new_file = get_result_file_fullpath(self._filesystem, 599 self._options.html_directory, 600 baseline_filename, 601 self._platform, 'new') 602 _log.debug(' Html: diffing "%s" and "%s"', old_file, new_file) 603 old_output = self._filesystem.read_binary_file(old_file) 604 new_output = self._filesystem.read_binary_file(new_file) 605 has_diff = self._port.diff_image(old_output, new_output, diff_file) 606 607 if has_diff: 608 _log.debug(' Html: created baseline diff file: "%s".', diff_file) 588 609 589 610 … … 932 953 zip_factory = None 933 954 955 # FIXME: SCM module doesn't handle paths that aren't relative to the checkout_root consistently. 956 host_port_obj._filesystem.chdir(scm_obj.checkout_root) 957 934 958 ret_code = real_main(options, target_options, host_port_obj, target_port_obj, url_fetcher, 935 959 zip_factory, scm_obj) -
trunk/Tools/Scripts/webkitpy/layout_tests/rebaseline_chromium_webkit_tests_unittest.py
r84730 r85905 204 204 mock_scm = mocktool.MockSCM(filesystem) 205 205 filesystem.maybe_make_directory(mock_scm.checkout_root) 206 207 # FIXME: SCM module doesn't handle paths that aren't relative to the checkout_root consistently. 208 filesystem.chdir("/test.checkout") 209 206 210 rebaseliner = rebaseline_chromium_webkit_tests.Rebaseliner(host_port_obj, 207 211 target_port_obj, platform, options, url_fetcher, zip_factory, mock_scm) … … 232 236 rebaseliner, filesystem = self.make_rebaseliner( 233 237 "BUGX REBASELINE MAC : failures/expected/image.html = IMAGE") 234 rebaseliner.run() 235 # We expect to have written 12 files over the course of this rebaseline: 238 239 rebaseliner.run() 240 # We expect to have written 13 files over the course of this rebaseline: 236 241 # *) 3 files in /__im_tmp for the extracted archive members 237 242 # *) 3 new baselines under '/test.checkout/LayoutTests' 238 243 # *) 4 files in /tmp for the new and old baselines in the result file 239 244 # (-{old,new}.{txt,png} 240 # *) 1 text diff in /tmp for the result file (-diff.txt). We don't241 # create image diffs (FIXME?) and don't display the checksums.245 # *) 1 text diff in /tmp for the result file (-diff.txt). 246 # *) 1 image diff in /tmp for the result file (-diff.png). 242 247 # *) 1 updated test_expectations file 243 self.assertEqual(len(filesystem.written_files), 1 2)248 self.assertEqual(len(filesystem.written_files), 13) 244 249 self.assertEqual(filesystem.files['/test.checkout/LayoutTests/platform/test-mac-leopard/failures/expected/image-expected.checksum'], 'new-image-checksum') 245 250 self.assertEqual(filesystem.files['/test.checkout/LayoutTests/platform/test-mac-leopard/failures/expected/image-expected.png'], 'new-image-png') … … 250 255 "BUGX REBASELINE : failures/expected/image.html = IMAGE") 251 256 rebaseliner.run() 252 # See comment in test_one_platform for an explanation of the 1 2written tests.257 # See comment in test_one_platform for an explanation of the 13 written tests. 253 258 # Note that even though the rebaseline is marked for all platforms, each 254 259 # rebaseliner only ever does one. 255 self.assertEqual(len(filesystem.written_files), 1 2)260 self.assertEqual(len(filesystem.written_files), 13) 256 261 self.assertEqual(filesystem.files['/test.checkout/LayoutTests/platform/test-mac-leopard/failures/expected/image-expected.checksum'], 'new-image-checksum') 257 262 self.assertEqual(filesystem.files['/test.checkout/LayoutTests/platform/test-mac-leopard/failures/expected/image-expected.png'], 'new-image-png') … … 267 272 # There is one less file written than |test_one_platform| because we only 268 273 # write 2 expectations (the png and the txt file). 269 self.assertEqual(len(filesystem.written_files), 1 1)274 self.assertEqual(len(filesystem.written_files), 12) 270 275 self.assertEqual(filesystem.files['/test.checkout/LayoutTests/platform/test-mac-leopard/failures/expected/image_checksum-expected.png'], 'tEXtchecksum\x000123456789') 271 276 self.assertEqual(filesystem.files['/test.checkout/LayoutTests/platform/test-mac-leopard/failures/expected/image_checksum-expected.txt'], 'png-comment-txt') … … 285 290 # There is one more file written than |test_png_file_with_comment_remove_old_checksum| 286 291 # because we also delete the old checksum. 287 self.assertEqual(len(filesystem.written_files), 1 2)292 self.assertEqual(len(filesystem.written_files), 13) 288 293 self.assertEqual(filesystem.files['/test.checkout/LayoutTests/platform/test-mac-leopard/failures/expected/image_checksum-expected.png'], 'tEXtchecksum\x000123456789') 289 294 self.assertEqual(filesystem.files['/test.checkout/LayoutTests/platform/test-mac-leopard/failures/expected/image_checksum-expected.txt'], 'png-comment-txt') … … 339 344 mock_scm = mocktool.MockSCM() 340 345 filesystem.maybe_make_directory(mock_scm.checkout_root) 346 347 # FIXME: SCM module doesn't handle paths that aren't relative to the checkout_root consistently. 348 filesystem.chdir("/test.checkout") 349 341 350 oc = outputcapture.OutputCapture() 342 351 oc.capture_output() … … 345 354 oc.restore_output() 346 355 347 # We expect to have written 3 6files over the course of this rebaseline:356 # We expect to have written 38 files over the course of this rebaseline: 348 357 # *) 6*3 files in /__im_tmp/ for the archived members of the 6 ports 349 358 # *) 2*3 files in /test.checkout for actually differing baselines … … 351 360 # *) 2*4 files in /tmp for the old/new baselines for the two actual ports 352 361 # *) 2 files in /tmp for the text diffs for the two ports 362 # *) 2 files in /tmp for the image diffs for the two ports 353 363 # *) 1 file in /tmp for the rebaseline results html file 354 364 self.assertEqual(res, 0) 355 self.assertEqual(len(filesystem.written_files), 3 6)365 self.assertEqual(len(filesystem.written_files), 38) 356 366 357 367
Note: See TracChangeset
for help on using the changeset viewer.