Changeset 90086 in webkit
- Timestamp:
- Jun 29, 2011, 9:16:18 PM (14 years ago)
- Location:
- trunk/Tools
- Files:
-
- 2 edited
-
ChangeLog (modified) (1 diff)
-
Scripts/webkitpy/layout_tests/run_webkit_tests_integrationtest.py (modified) (8 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Tools/ChangeLog
r90085 r90086 1 2011-06-29 Dirk Pranke <dpranke@chromium.org> 2 3 Reviewed by Adam Barth. 4 5 test-webkitpy is spamming lots of messages about updating test expectations 6 https://bugs.webkit.org/show_bug.cgi?id=63680 7 8 This patch changes the passing_run() function to capture the 9 output to stdout and stderr and assert that it is empty, and 10 also specifies --no-new-test-results by default to avoid getting 11 "generating baseline" messages for the expected-missing results. 12 13 Also check that we are logging messages when we generate new 14 baselines. 15 16 Also fix a minor bug in the way test_tolerance() was 17 checking for whether the tests were passing or not. 18 19 * Scripts/webkitpy/layout_tests/run_webkit_tests_integrationtest.py: 20 1 21 2011-06-29 Yuta Kitamura <yutak@chromium.org> 2 22 -
trunk/Tools/Scripts/webkitpy/layout_tests/run_webkit_tests_integrationtest.py
r90055 r90086 65 65 66 66 def parse_args(extra_args=None, record_results=False, tests_included=False, 67 print_nothing=True):67 new_results=False, print_nothing=True): 68 68 extra_args = extra_args or [] 69 69 if print_nothing: … … 75 75 if not record_results: 76 76 args.append('--no-record-results') 77 if not new_results: 78 args.append('--no-new-test-results') 79 77 80 if not '--child-processes' in extra_args and not '--worker-model' in extra_args: 78 81 args.extend(['--worker-model', 'inline']) … … 94 97 port_obj = port.get(port_name=options.platform, options=options, 95 98 user=mocktool.MockUser(), filesystem=filesystem) 96 res = run_webkit_tests.run(port_obj, options, parsed_args) 97 return res == 0 98 99 100 def logging_run(extra_args=None, port_obj=None, record_results=False, tests_included=False, filesystem=None): 99 buildbot_output = array_stream.ArrayStream() 100 regular_output = array_stream.ArrayStream() 101 res = run_webkit_tests.run(port_obj, options, parsed_args, buildbot_output=buildbot_output, 102 regular_output=regular_output) 103 return res == 0 and regular_output.empty() and buildbot_output.empty() 104 105 106 def logging_run(extra_args=None, port_obj=None, record_results=False, tests_included=False, filesystem=None, new_results=False): 101 107 options, parsed_args = parse_args(extra_args=extra_args, 102 108 record_results=record_results, 103 109 tests_included=tests_included, 104 print_nothing=False )110 print_nothing=False, new_results=new_results) 105 111 user = mocktool.MockUser() 106 112 if not port_obj: … … 562 568 options, parsed_args = run_webkit_tests.parse_args(args) 563 569 test_port = ImageDiffTestPort(options=options, user=mocktool.MockUser()) 564 passing_run(args, port_obj=test_port, tests_included=True) 570 res = passing_run(args, port_obj=test_port, tests_included=True) 571 self.assertTrue(res) 565 572 return test_port 566 573 567 base_args = ['--pixel-tests', ' failures/expected/*']574 base_args = ['--pixel-tests', '--no-new-test-results', 'failures/expected/*'] 568 575 569 576 # If we pass in an explicit tolerance argument, then that will be used. … … 642 649 643 650 class RebaselineTest(unittest.TestCase): 644 def assertBaselines(self, file_list, file, extensions ):651 def assertBaselines(self, file_list, file, extensions, err): 645 652 "assert that the file_list contains the baselines.""" 646 653 for ext in extensions: 647 654 baseline = file + "-expected" + ext 655 baseline_msg = 'Writing new expected result "%s"\n' % baseline[1:] 648 656 self.assertTrue(any(f.find(baseline) != -1 for f in file_list)) 657 self.assertTrue(baseline_msg in err.get()) 649 658 650 659 # FIXME: Add tests to ensure that we're *not* writing baselines when we're not … … 655 664 # is missing, update the expected generic location. 656 665 fs = port.unit_test_filesystem() 657 passing_run(['--pixel-tests',666 res, out, err, _ = logging_run(['--pixel-tests', 658 667 '--reset-results', 659 668 'passes/image.html', 660 669 'failures/expected/missing_image.html'], 661 tests_included=True, filesystem=fs )670 tests_included=True, filesystem=fs, new_results=True) 662 671 file_list = fs.written_files.keys() 663 672 file_list.remove('/tmp/layout-test-results/tests_run0.txt') 673 self.assertEquals(res, 0) 674 self.assertTrue(out.empty()) 664 675 self.assertEqual(len(file_list), 4) 665 self.assertBaselines(file_list, "/passes/image", [".txt", ".png"] )666 self.assertBaselines(file_list, "/failures/expected/missing_image", [".txt", ".png"] )676 self.assertBaselines(file_list, "/passes/image", [".txt", ".png"], err) 677 self.assertBaselines(file_list, "/failures/expected/missing_image", [".txt", ".png"], err) 667 678 668 679 def test_missing_results(self): … … 670 681 # is missing, update the expected generic location. 671 682 fs = port.unit_test_filesystem() 672 passing_run(['--no-show-results',683 res, out, err, _ = logging_run(['--no-show-results', 673 684 'failures/unexpected/missing_text.html', 674 685 'failures/unexpected/missing_image.html', 675 686 'failures/unexpected/missing_audio.html'], 676 tests_included=True, filesystem=fs )687 tests_included=True, filesystem=fs, new_results=True) 677 688 file_list = fs.written_files.keys() 678 689 file_list.remove('/tmp/layout-test-results/tests_run0.txt') 690 self.assertEquals(res, 2) 691 self.assertFalse(out.empty()) 679 692 self.assertEqual(len(file_list), 4) 680 self.assertBaselines(file_list, "/failures/unexpected/missing_text", [".txt"] )681 self.assertBaselines(file_list, "/failures/unexpected/missing_image", [".png"] )693 self.assertBaselines(file_list, "/failures/unexpected/missing_text", [".txt"], err) 694 self.assertBaselines(file_list, "/failures/unexpected/missing_image", [".png"], err) 682 695 683 696 def test_new_baseline(self): … … 685 698 # is mssing, then create a new expectation in the platform dir. 686 699 fs = port.unit_test_filesystem() 687 passing_run(['--pixel-tests',700 res, out, err, _ = logging_run(['--pixel-tests', 688 701 '--new-baseline', 689 702 'passes/image.html', 690 703 'failures/expected/missing_image.html'], 691 tests_included=True, filesystem=fs )704 tests_included=True, filesystem=fs, new_results=True) 692 705 file_list = fs.written_files.keys() 693 706 file_list.remove('/tmp/layout-test-results/tests_run0.txt') 707 self.assertEquals(res, 0) 708 self.assertTrue(out.empty()) 694 709 self.assertEqual(len(file_list), 4) 695 710 self.assertBaselines(file_list, 696 "/platform/test-mac-leopard/passes/image", [".txt", ".png"] )711 "/platform/test-mac-leopard/passes/image", [".txt", ".png"], err) 697 712 self.assertBaselines(file_list, 698 "/platform/test-mac-leopard/failures/expected/missing_image", [".txt", ".png"] )713 "/platform/test-mac-leopard/failures/expected/missing_image", [".txt", ".png"], err) 699 714 700 715
Note:
See TracChangeset
for help on using the changeset viewer.