Changeset 87593 in webkit


Ignore:
Timestamp:
May 27, 2011 7:11:00 PM (13 years ago)
Author:
dpranke@chromium.org
Message:

2011-05-27 Dirk Pranke <dpranke@chromium.org>

Reviewed by Adam Barth.

NRWT: remove --print detailed-progress
https://bugs.webkit.org/show_bug.cgi?id=60324

  • Scripts/webkitpy/layout_tests/layout_package/manager_worker_broker.py:
  • Scripts/webkitpy/layout_tests/layout_package/printing.py:
  • Scripts/webkitpy/layout_tests/layout_package/printing_unittest.py:
  • Scripts/webkitpy/layout_tests/run_webkit_tests.py:
Location:
trunk/Tools
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/Tools/ChangeLog

    r87592 r87593  
    88
    99        * Scripts/webkitpy/common/config/committers.py:
     10
     112011-05-27  Dirk Pranke  <dpranke@chromium.org>
     12
     13        Reviewed by Adam Barth.
     14
     15        NRWT: remove --print detailed-progress
     16        https://bugs.webkit.org/show_bug.cgi?id=60324
     17
     18        * Scripts/webkitpy/layout_tests/layout_package/manager_worker_broker.py:
     19        * Scripts/webkitpy/layout_tests/layout_package/printing.py:
     20        * Scripts/webkitpy/layout_tests/layout_package/printing_unittest.py:
     21        * Scripts/webkitpy/layout_tests/run_webkit_tests.py:
    1022
    11232011-05-27  Dirk Pranke  <dpranke@chromium.org>
  • trunk/Tools/Scripts/webkitpy/layout_tests/layout_package/manager_worker_broker.py

    r87591 r87593  
    330330            # if this will be an issue in practice.
    331331            printer = printing.Printer(port_obj, options, sys.stderr, sys.stdout,
    332                 int(options.child_processes), options.experimental_fully_parallel,
    333332                configure_logging)
    334333            self._client.run(port_obj)
  • trunk/Tools/Scripts/webkitpy/layout_tests/layout_package/printing.py

    r87591 r87593  
    5858    default             include the default options. This is useful for logging
    5959                        the default options plus additional settings.
    60     everything          print everything (except the trace-* options and the
    61                         detailed-progress option, see below for the full list )
     60    everything          print (almost) everything (except the trace-* options,
     61                        see below for the full list )
    6262    misc                print miscellaneous things like blank lines
    6363
     
    6868
    6969During the run:
    70     detailed-progress   print one dot per test completed
    7170    one-line-progress   print a one-line progress bar
    7271    unexpected          print any unexpected results as they occur
     
    8988
    9089Notes:
    91     - 'detailed-progress' can only be used if running in a single thread
    92       (using --child-processes=1) or a single queue of tests (using
    93        --experimental-fully-parallel). If these conditions aren't true,
    94       'one-line-progress' will be used instead.
    95     - If both 'detailed-progress' and 'one-line-progress' are specified (and
    96       both are possible), 'detailed-progress' will be used.
    9790    - If 'nothing' is specified, it overrides all of the other options.
    9891    - Specifying --verbose is equivalent to --print everything plus it
     
    126119
    127120
    128 def parse_print_options(print_options, verbose, child_processes,
    129                         is_fully_parallel):
     121def parse_print_options(print_options, verbose):
    130122    """Parse the options provided to --print and dedup and rank them.
    131123
     
    144136        return set()
    145137
    146     if (child_processes != 1 and not is_fully_parallel and
    147         'detailed-progress' in switches):
    148         _log.warn("Can only print 'detailed-progress' if running "
    149                   "with --child-processes=1 or "
    150                   "with --experimental-fully-parallel. "
    151                   "Using 'one-line-progress' instead.")
    152         switches.discard('detailed-progress')
    153         switches.add('one-line-progress')
    154 
    155138    if 'everything' in switches:
    156139        switches.discard('everything')
     
    161144        switches.update(set(PRINT_DEFAULT.split(',')))
    162145
    163     if 'detailed-progress' in switches:
    164         switches.discard('one-line-progress')
    165 
    166146    if 'trace-everything' in switches:
    167         switches.discard('detailed-progress')
    168147        switches.discard('one-line-progress')
    169148        switches.discard('trace-unexpected')
     
    211190    output gets logged to stderr."""
    212191    def __init__(self, port, options, regular_output, buildbot_output,
    213                  child_processes, is_fully_parallel, configure_logging):
     192                 configure_logging):
    214193        """
    215194        Args
     
    220199          buildbot_output    stream to which output intended to be read by
    221200                             the buildbots (and humans) should be written
    222           child_processes    number of parallel threads running (usually
    223                              controlled by --child-processes)
    224           is_fully_parallel  are the tests running in a single queue, or
    225                              in shards (usually controlled by
    226                              --experimental-fully-parallel)
    227201          configure_loggign  Whether a logging handler should be registered
    228202
    229         Note that the fourth and fifth args are separate rather than bundled into
    230         the options structure so that this object does not assume any flags
    231         set in options that weren't returned from logging_options(), above.
    232         The two are used to determine whether or not we can sensibly use
    233         the 'detailed-progress' option, or can only use 'one-line-progress'.
    234203        """
    235204        self._buildbot_stream = buildbot_output
     
    238207        self._stream = regular_output
    239208
    240         # These are used for --print detailed-progress to track status by
    241         # directory.
    242         self._current_dir = None
    243         self._current_progress_str = ""
    244         self._current_test_number = 0
    245 
    246209        self._meter = metered_stream.MeteredStream(options.verbose,
    247210                                                   regular_output)
     
    251214
    252215        self.switches = parse_print_options(options.print_options,
    253             options.verbose, child_processes, is_fully_parallel)
     216            options.verbose)
    254217
    255218    def cleanup(self):
     
    335298            self.enabled('trace-unexpected') and not expected):
    336299            self._print_test_trace(result, exp_str, got_str)
    337         elif (not expected and self.enabled('unexpected') and
    338               self.disabled('detailed-progress')):
    339             # Note: 'detailed-progress' handles unexpected results internally,
    340             # so we skip it here.
     300        elif not expected and self.enabled('unexpected'):
    341301            self._print_unexpected_test_result(result)
    342302
     
    378338    def print_progress(self, result_summary, retrying, test_list):
    379339        """Print progress through the tests as determined by --print."""
    380         if self.enabled('detailed-progress'):
    381             self._print_detailed_progress(result_summary, test_list)
    382         elif self.enabled('one-line-progress'):
     340        if self.enabled('one-line-progress'):
    383341            self._print_one_line_progress(result_summary, retrying)
    384342        else:
     
    398356            " %d left" % (action, percent_complete, result_summary.expected,
    399357             result_summary.unexpected, result_summary.remaining))
    400 
    401     def _print_detailed_progress(self, result_summary, test_list):
    402         """Display detailed progress output where we print the directory name
    403         and one dot for each completed test. This is triggered by
    404         "--log detailed-progress"."""
    405         if self._current_test_number == len(test_list):
    406             return
    407 
    408         next_test = test_list[self._current_test_number]
    409         next_dir = self._port._filesystem.dirname(
    410             self._port.relative_test_filename(next_test))
    411         if self._current_progress_str == "":
    412             self._current_progress_str = "%s: " % (next_dir)
    413             self._current_dir = next_dir
    414 
    415         while next_test in result_summary.results:
    416             if next_dir != self._current_dir:
    417                 self._meter.write("%s\n" % (self._current_progress_str))
    418                 self._current_progress_str = "%s: ." % (next_dir)
    419                 self._current_dir = next_dir
    420             else:
    421                 self._current_progress_str += "."
    422 
    423             if (next_test in result_summary.unexpected_results and
    424                 self.enabled('unexpected')):
    425                 self._meter.write("%s\n" % self._current_progress_str)
    426                 test_result = result_summary.results[next_test]
    427                 self._print_unexpected_test_result(test_result)
    428                 self._current_progress_str = "%s: " % self._current_dir
    429 
    430             self._current_test_number += 1
    431             if self._current_test_number == len(test_list):
    432                 break
    433 
    434             next_test = test_list[self._current_test_number]
    435             next_dir = self._port._filesystem.dirname(
    436                 self._port.relative_test_filename(next_test))
    437 
    438         if result_summary.remaining:
    439             remain_str = " (%d)" % (result_summary.remaining)
    440             self._meter.progress("%s%s" % (self._current_progress_str,
    441                                            remain_str))
    442         else:
    443             self._meter.progress("%s" % (self._current_progress_str))
    444358
    445359    def print_unexpected_results(self, unexpected_results):
  • trunk/Tools/Scripts/webkitpy/layout_tests/layout_package/printing_unittest.py

    r87591 r87593  
    7878
    7979    def test_parse_print_options(self):
    80         def test_switches(args, expected_switches_str,
    81                           verbose=False, child_processes=1,
    82                           is_fully_parallel=False):
     80        def test_switches(args, expected_switches_str, verbose=False):
    8381            options, args = get_options(args)
    8482            if expected_switches_str:
     
    8785                expected_switches = set()
    8886            switches = printing.parse_print_options(options.print_options,
    89                                                     verbose,
    90                                                     child_processes,
    91                                                     is_fully_parallel)
     87                                                    verbose)
    9288            self.assertEqual(expected_switches, switches)
    9389
     
    113109
    114110class  Testprinter(unittest.TestCase):
    115     def get_printer(self, args=None, single_threaded=False,
    116                    is_fully_parallel=False):
     111    def get_printer(self, args=None):
    117112        args = args or []
    118113        printing_options = printing.print_options()
     
    121116        self._port = port.get('test', options)
    122117        nproc = 2
    123         if single_threaded:
    124             nproc = 1
    125118
    126119        regular_output = array_stream.ArrayStream()
    127120        buildbot_output = array_stream.ArrayStream()
    128121        printer = printing.Printer(self._port, options, regular_output,
    129                                    buildbot_output, single_threaded,
    130                                    is_fully_parallel,
    131                                    configure_logging=True)
     122                                   buildbot_output, configure_logging=True)
    132123        return printer, regular_output, buildbot_output
    133124
     
    356347        self.assertFalse(err.empty())
    357348
    358         err.reset()
    359         out.reset()
    360         printer.print_progress(rs, True, paths)
    361         self.assertFalse(err.empty())
    362         self.assertTrue(out.empty())
    363 
    364     def test_print_progress__detailed(self):
    365         tests = ['passes/text.html', 'failures/expected/timeout.html',
    366                  'failures/expected/crash.html']
    367         expectations = 'BUGX : failures/expected/timeout.html = TIMEOUT'
    368 
    369         # first, test that it is disabled properly
    370         # should still print one-line-progress
    371         printer, err, out = self.get_printer(
    372             ['--print', 'detailed-progress'], single_threaded=False)
    373         paths, rs, exp = self.get_result_summary(tests, expectations)
    374         printer.print_progress(rs, False, paths)
    375         self.assertFalse(err.empty())
    376         self.assertTrue(out.empty())
    377 
    378         # now test the enabled paths
    379         printer, err, out = self.get_printer(
    380             ['--print', 'detailed-progress'], single_threaded=True)
    381         paths, rs, exp = self.get_result_summary(tests, expectations)
    382         printer.print_progress(rs, False, paths)
    383         self.assertFalse(err.empty())
    384         self.assertTrue(out.empty())
    385 
    386         err.reset()
    387         out.reset()
    388         printer.print_progress(rs, True, paths)
    389         self.assertFalse(err.empty())
    390         self.assertTrue(out.empty())
    391 
    392         rs.add(self.get_result('passes/text.html', test_expectations.TIMEOUT), False)
    393         rs.add(self.get_result('failures/expected/timeout.html'), True)
    394         rs.add(self.get_result('failures/expected/crash.html', test_expectations.CRASH), True)
    395         err.reset()
    396         out.reset()
    397         printer.print_progress(rs, False, paths)
    398         self.assertFalse(err.empty())
    399         self.assertTrue(out.empty())
    400 
    401         # We only clear the meter when retrying w/ detailed-progress.
    402         err.reset()
    403         out.reset()
    404         printer.print_progress(rs, True, paths)
    405         self.assertFalse(err.empty())
    406         self.assertTrue(out.empty())
    407 
    408         printer, err, out = self.get_printer(
    409             ['--print', 'detailed-progress,unexpected'], single_threaded=True)
    410         paths, rs, exp = self.get_result_summary(tests, expectations)
    411         printer.print_progress(rs, False, paths)
    412         self.assertFalse(err.empty())
    413         self.assertTrue(out.empty())
    414 
    415         err.reset()
    416         out.reset()
    417         printer.print_progress(rs, True, paths)
    418         self.assertFalse(err.empty())
    419         self.assertTrue(out.empty())
    420 
    421         rs.add(self.get_result('passes/text.html', test_expectations.TIMEOUT), False)
    422         rs.add(self.get_result('failures/expected/timeout.html'), True)
    423         rs.add(self.get_result('failures/expected/crash.html', test_expectations.CRASH), True)
    424         err.reset()
    425         out.reset()
    426         printer.print_progress(rs, False, paths)
    427         self.assertFalse(err.empty())
    428         self.assertTrue(out.empty())
    429 
    430         # We only clear the meter when retrying w/ detailed-progress.
    431349        err.reset()
    432350        out.reset()
  • trunk/Tools/Scripts/webkitpy/layout_tests/run_webkit_tests.py

    r87591 r87593  
    7373
    7474    printer = printing.Printer(port, options, regular_output, buildbot_output,
    75         int(options.child_processes), options.experimental_fully_parallel,
    76         configure_logging=True)
     75                               configure_logging=True)
    7776    for w in warnings:
    7877        _log.warning(w)
Note: See TracChangeset for help on using the changeset viewer.