Changeset 90086 in webkit


Ignore:
Timestamp:
Jun 29, 2011, 9:16:18 PM (14 years ago)
Author:
dpranke@chromium.org
Message:

2011-06-29 Dirk Pranke <dpranke@chromium.org>

Reviewed by Adam Barth.

test-webkitpy is spamming lots of messages about updating test expectations
https://bugs.webkit.org/show_bug.cgi?id=63680

This patch changes the passing_run() function to capture the
output to stdout and stderr and assert that it is empty, and
also specifies --no-new-test-results by default to avoid getting
"generating baseline" messages for the expected-missing results.

Also check that we are logging messages when we generate new
baselines.

Also fix a minor bug in the way test_tolerance() was
checking for whether the tests were passing or not.

  • Scripts/webkitpy/layout_tests/run_webkit_tests_integrationtest.py:
Location:
trunk/Tools
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Tools/ChangeLog

    r90085 r90086  
     12011-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
    1212011-06-29  Yuta Kitamura  <yutak@chromium.org>
    222
  • trunk/Tools/Scripts/webkitpy/layout_tests/run_webkit_tests_integrationtest.py

    r90055 r90086  
    6565
    6666def parse_args(extra_args=None, record_results=False, tests_included=False,
    67                print_nothing=True):
     67               new_results=False, print_nothing=True):
    6868    extra_args = extra_args or []
    6969    if print_nothing:
     
    7575    if not record_results:
    7676        args.append('--no-record-results')
     77    if not new_results:
     78        args.append('--no-new-test-results')
     79
    7780    if not '--child-processes' in extra_args and not '--worker-model' in extra_args:
    7881        args.extend(['--worker-model', 'inline'])
     
    9497        port_obj = port.get(port_name=options.platform, options=options,
    9598                            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
     106def logging_run(extra_args=None, port_obj=None, record_results=False, tests_included=False, filesystem=None, new_results=False):
    101107    options, parsed_args = parse_args(extra_args=extra_args,
    102108                                      record_results=record_results,
    103109                                      tests_included=tests_included,
    104                                       print_nothing=False)
     110                                      print_nothing=False, new_results=new_results)
    105111    user = mocktool.MockUser()
    106112    if not port_obj:
     
    562568            options, parsed_args = run_webkit_tests.parse_args(args)
    563569            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)
    565572            return test_port
    566573
    567         base_args = ['--pixel-tests', 'failures/expected/*']
     574        base_args = ['--pixel-tests', '--no-new-test-results', 'failures/expected/*']
    568575
    569576        # If we pass in an explicit tolerance argument, then that will be used.
     
    642649
    643650class RebaselineTest(unittest.TestCase):
    644     def assertBaselines(self, file_list, file, extensions):
     651    def assertBaselines(self, file_list, file, extensions, err):
    645652        "assert that the file_list contains the baselines."""
    646653        for ext in extensions:
    647654            baseline = file + "-expected" + ext
     655            baseline_msg = 'Writing new expected result "%s"\n' % baseline[1:]
    648656            self.assertTrue(any(f.find(baseline) != -1 for f in file_list))
     657            self.assertTrue(baseline_msg in err.get())
    649658
    650659    # FIXME: Add tests to ensure that we're *not* writing baselines when we're not
     
    655664        # is missing, update the expected generic location.
    656665        fs = port.unit_test_filesystem()
    657         passing_run(['--pixel-tests',
     666        res, out, err, _ = logging_run(['--pixel-tests',
    658667                        '--reset-results',
    659668                        'passes/image.html',
    660669                        'failures/expected/missing_image.html'],
    661                         tests_included=True, filesystem=fs)
     670                        tests_included=True, filesystem=fs, new_results=True)
    662671        file_list = fs.written_files.keys()
    663672        file_list.remove('/tmp/layout-test-results/tests_run0.txt')
     673        self.assertEquals(res, 0)
     674        self.assertTrue(out.empty())
    664675        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)
    667678
    668679    def test_missing_results(self):
     
    670681        # is missing, update the expected generic location.
    671682        fs = port.unit_test_filesystem()
    672         passing_run(['--no-show-results',
     683        res, out, err, _ = logging_run(['--no-show-results',
    673684                     'failures/unexpected/missing_text.html',
    674685                     'failures/unexpected/missing_image.html',
    675686                     'failures/unexpected/missing_audio.html'],
    676                      tests_included=True, filesystem=fs)
     687                     tests_included=True, filesystem=fs, new_results=True)
    677688        file_list = fs.written_files.keys()
    678689        file_list.remove('/tmp/layout-test-results/tests_run0.txt')
     690        self.assertEquals(res, 2)
     691        self.assertFalse(out.empty())
    679692        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)
    682695
    683696    def test_new_baseline(self):
     
    685698        # is mssing, then create a new expectation in the platform dir.
    686699        fs = port.unit_test_filesystem()
    687         passing_run(['--pixel-tests',
     700        res, out, err, _ = logging_run(['--pixel-tests',
    688701                        '--new-baseline',
    689702                        'passes/image.html',
    690703                        'failures/expected/missing_image.html'],
    691                     tests_included=True, filesystem=fs)
     704                    tests_included=True, filesystem=fs, new_results=True)
    692705        file_list = fs.written_files.keys()
    693706        file_list.remove('/tmp/layout-test-results/tests_run0.txt')
     707        self.assertEquals(res, 0)
     708        self.assertTrue(out.empty())
    694709        self.assertEqual(len(file_list), 4)
    695710        self.assertBaselines(file_list,
    696             "/platform/test-mac-leopard/passes/image", [".txt", ".png"])
     711            "/platform/test-mac-leopard/passes/image", [".txt", ".png"], err)
    697712        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)
    699714
    700715
Note: See TracChangeset for help on using the changeset viewer.