Changeset 57466 in webkit


Ignore:
Timestamp:
Apr 11, 2010 7:54:37 PM (14 years ago)
Author:
abarth@webkit.org
Message:

2010-04-11 Adam Barth <abarth@webkit.org>

Unreviewed.

Fix new-run-webkit-tests regressions cased by Eric's option parsing patch
https://bugs.webkit.org/show_bug.cgi?id=37430

We need some basic unit testing of this script, or we're going to keep
breaking it like this. Added missing namespace qualifiers and
propagated renaming of an option.

  • Scripts/webkitpy/common/config/ports.py:
  • Scripts/webkitpy/layout_tests/driver_test.py:
  • Scripts/webkitpy/layout_tests/port/base.py:
  • Scripts/webkitpy/layout_tests/port/mac.py:
  • Scripts/webkitpy/layout_tests/run_webkit_tests.py:
Location:
trunk/WebKitTools
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebKitTools/ChangeLog

    r57463 r57466  
     12010-04-11  Adam Barth  <abarth@webkit.org>
     2
     3        Unreviewed.
     4
     5        Fix new-run-webkit-tests regressions cased by Eric's option parsing patch
     6        https://bugs.webkit.org/show_bug.cgi?id=37430
     7
     8        We need some basic unit testing of this script, or we're going to keep
     9        breaking it like this.  Added missing namespace qualifiers and
     10        propagated renaming of an option.
     11
     12        * Scripts/webkitpy/common/config/ports.py:
     13        * Scripts/webkitpy/layout_tests/driver_test.py:
     14        * Scripts/webkitpy/layout_tests/port/base.py:
     15        * Scripts/webkitpy/layout_tests/port/mac.py:
     16        * Scripts/webkitpy/layout_tests/run_webkit_tests.py:
     17
    1182010-04-11  Eric Seidel  <eric@webkit.org>
    219
  • trunk/WebKitTools/Scripts/webkitpy/common/config/ports.py

    r57427 r57466  
    3131import os
    3232import platform
    33 
    34 from optparse import make_option
    3533
    3634from webkitpy.common.system.executive import Executive
  • trunk/WebKitTools/Scripts/webkitpy/layout_tests/driver_test.py

    r57463 r57466  
    6464    # FIXME: configuration_options belong in a shared location.
    6565    configuration_options = [
    66         make_option('--debug', action='store_const', const='Debug', dest="configuration", help='Set the configuration to Debug'),
    67         make_option('--release', action='store_const', const='Release', dest="configuration", help='Set the configuration to Release'),
     66        optparse.make_option('--debug', action='store_const', const='Debug', dest="configuration", help='Set the configuration to Debug'),
     67        optparse.make_option('--release', action='store_const', const='Release', dest="configuration", help='Set the configuration to Release'),
    6868    ]
    6969    misc_options = [
    70         make_option('-p', '--platform', action='store', default='mac', help='Platform to test (e.g., "mac", "chromium-mac", etc.'),
    71         make_option('--timeout', action='store', default='2000', help='test timeout in milliseconds (2000 by default)'),
    72         make_option('--wrapper', action='store'),
    73         make_option('--no-pixel-tests', action='store_true', default=False, help='disable pixel-to-pixel PNG comparisons'),
     70        optparse.make_option('-p', '--platform', action='store', default='mac', help='Platform to test (e.g., "mac", "chromium-mac", etc.'),
     71        optparse.make_option('--timeout', action='store', default='2000', help='test timeout in milliseconds (2000 by default)'),
     72        optparse.make_option('--wrapper', action='store'),
     73        optparse.make_option('--no-pixel-tests', action='store_true', default=False, help='disable pixel-to-pixel PNG comparisons'),
    7474    ]
    7575    option_list = configuration_options + misc_options
  • trunk/WebKitTools/Scripts/webkitpy/layout_tests/port/base.py

    r57446 r57466  
    7171        self._executive = executive
    7272
    73     def default_num_dump_render_trees(self):
     73    def default_child_processes(self):
    7474        """Return the number of DumpRenderTree instances to use for this
    7575        port."""
  • trunk/WebKitTools/Scripts/webkitpy/layout_tests/port/mac.py

    r57444 r57466  
    5656        WebKitPort.__init__(self, port_name, options)
    5757
    58     def default_num_dump_render_trees(self):
     58    def default_child_processes(self):
    5959        # FIXME: new-run-webkit-tests is unstable on Mac running more than
    6060        # four threads in parallel.
    6161        # See https://bugs.webkit.org/show_bug.cgi?id=36622
    62         num_dump_render_trees = WebKitPort.default_num_dump_render_trees(self)
    63         if num_dump_render_trees > 4:
     62        child_processes = WebKitPort.default_child_processes(self)
     63        if child_processes > 4:
    6464            return 4
    65         return num_dump_render_trees
     65        return child_processes
    6666
    6767    def baseline_search_path(self):
  • trunk/WebKitTools/Scripts/webkitpy/layout_tests/run_webkit_tests.py

    r57463 r57466  
    517517        # Instantiate TestShellThreads and start them.
    518518        threads = []
    519         for i in xrange(int(self._options.num_dump_render_trees)):
     519        for i in xrange(int(self._options.child_processes)):
    520520            # Create separate TestTypes instances for each thread.
    521521            test_types = []
     
    543543    def _is_single_threaded(self):
    544544        """Returns whether we should run all the tests in the main thread."""
    545         return int(self._options.num_dump_render_trees) == 1
     545        return int(self._options.child_processes) == 1
    546546
    547547    def _run_tests(self, file_list, result_summary):
     
    960960            cuml_time += t['total_time']
    961961        write("   %6.2f cumulative, %6.2f optimal" %
    962               (cuml_time, cuml_time / int(self._options.num_dump_render_trees)))
     962              (cuml_time, cuml_time / int(self._options.child_processes)))
    963963        write("")
    964964
     
    14251425                              ignore_errors=True)
    14261426
    1427     if not options.num_dump_render_trees:
     1427    if not options.child_processes:
    14281428        # FIXME: Investigate perf/flakiness impact of using cpu_count + 1.
    1429         options.num_dump_render_trees = port_obj.default_num_dump_render_trees()
     1429        options.child_processes = port_obj.default_child_processes()
    14301430
    14311431    write = create_logging_writer(options, 'config')
    1432     write("Running %s DumpRenderTrees in parallel" % options.num_dump_render_trees)
     1432    write("Running %s DumpRenderTrees in parallel" % options.child_processes)
    14331433
    14341434    if not options.time_out_ms:
     
    15301530    # FIXME: configuration_options should move to WebKitPort and be shared across all scripts.
    15311531    configuration_options = [
    1532         make_option("-t", "--target", dest="configuration", help="(DEPRECATED)"),
     1532        optparse.make_option("-t", "--target", dest="configuration", help="(DEPRECATED)"),
    15331533        # FIXME: --help should display which configuration is default.
    1534         make_option('--debug', action='store_const', const='Debug', dest="configuration", help='Set the configuration to Debug'),
    1535         make_option('--release', action='store_const', const='Release', dest="configuration", help='Set the configuration to Release'),
     1534        optparse.make_option('--debug', action='store_const', const='Debug', dest="configuration", help='Set the configuration to Debug'),
     1535        optparse.make_option('--release', action='store_const', const='Release', dest="configuration", help='Set the configuration to Release'),
    15361536        # old-run-webkit-tests also accepts -c, --configuration CONFIGURATION.
    15371537    ]
    15381538
    15391539    logging_options = [
    1540         make_option("--log", action="store", default="detailed-progress,unexpected",
     1540        optparse.make_option("--log", action="store", default="detailed-progress,unexpected",
    15411541                    help="log various types of data. The param should be a comma-separated list of values from: "
    15421542                         "actual,config," + LOG_DETAILED_PROGRESS + ",expected,timing," + LOG_UNEXPECTED + " "
    15431543                          "(defaults to " + "--log detailed-progress,unexpected)"),
    1544         make_option("-v", "--verbose", action="store_true", default=False, help="include debug-level logging"),
    1545         make_option("--sources", action="store_true", help="show expected result file path for each test (implies --verbose)"),
     1544        optparse.make_option("-v", "--verbose", action="store_true", default=False, help="include debug-level logging"),
     1545        optparse.make_option("--sources", action="store_true", help="show expected result file path for each test (implies --verbose)"),
    15461546        # old-run-webkit-tests has a --slowest option which just prints the slowest 10.
    1547         make_option("--num-slow-tests-to-log", default=50, help="Number of slow tests whose timings to print."),
     1547        optparse.make_option("--num-slow-tests-to-log", default=50, help="Number of slow tests whose timings to print."),
    15481548    ]
    15491549
    15501550    # FIXME: These options should move onto the ChromiumPort.
    15511551    chromium_options = [
    1552         make_option("--chromium", action="store_true", default=False, help="use the Chromium port"),
    1553         make_option("--startup-dialog", action="store_true", default=False, help="create a dialog on DumpRenderTree startup"),
    1554         make_option("--gp-fault-error-box", action="store_true", default=False, help="enable Windows GP fault error box"),
    1555         make_option("--nocheck-sys-deps", action="store_true", default=False, help="Don't check the system dependencies (themes)"),
     1552        optparse.make_option("--chromium", action="store_true", default=False, help="use the Chromium port"),
     1553        optparse.make_option("--startup-dialog", action="store_true", default=False, help="create a dialog on DumpRenderTree startup"),
     1554        optparse.make_option("--gp-fault-error-box", action="store_true", default=False, help="enable Windows GP fault error box"),
     1555        optparse.make_option("--nocheck-sys-deps", action="store_true", default=False, help="Don't check the system dependencies (themes)"),
    15561556    ]
    15571557
     
    15631563    results_options = [
    15641564        # NEED for bots: --use-remote-links-to-tests     Link to test files within the SVN repository in the results.
    1565         make_option("-p", "--pixel-tests'", action="store_true", dest="pixel_tests", help="Enable pixel-to-pixel PNG comparisons"),
    1566         make_option("--no-pixel-tests", action="store_false", dest="pixel_tests", help="Disable pixel-to-pixel PNG comparisons"),
    1567         make_option("--fuzzy-pixel-tests", action="store_true", default=False, help="Also use fuzzy matching to compare pixel test outputs."),
     1565        optparse.make_option("-p", "--pixel-tests'", action="store_true", dest="pixel_tests", help="Enable pixel-to-pixel PNG comparisons"),
     1566        optparse.make_option("--no-pixel-tests", action="store_false", dest="pixel_tests", help="Disable pixel-to-pixel PNG comparisons"),
     1567        optparse.make_option("--fuzzy-pixel-tests", action="store_true", default=False, help="Also use fuzzy matching to compare pixel test outputs."),
    15681568        # old-run-webkit-tests allows a specific tollerance: --tolerance t  Ignore image differences less than this percentage (default: 0.1)
    1569         make_option("--results-directory", default="layout-test-results", help="Output results directory source dir, relative to Debug or Release"),
    1570         make_option("--new-baseline", action="store_true", default=False, help="Save all generated results as new baselines into the platform directory, overwriting whatever's already there."),
     1569        optparse.make_option("--results-directory", default="layout-test-results", help="Output results directory source dir, relative to Debug or Release"),
     1570        optparse.make_option("--new-baseline", action="store_true", default=False, help="Save all generated results as new baselines into the platform directory, overwriting whatever's already there."),
    15711571        # FIXME: --noshow should be --no-show to match the GNU get_opt pattern.
    1572         make_option("--noshow-results", action="store_true", default=False, help="Don't launch a browser with results after the tests are done"),
     1572        optparse.make_option("--noshow-results", action="store_true", default=False, help="Don't launch a browser with results after the tests are done"),
    15731573        # old-run-webkit-tests: --[no-]launch-safari            Launch (or do not launch) Safari to display test results (default: launch)
    1574         make_option("--full-results-html", action="store_true", default=False, help="Show all failures in results.html, rather than only regressions"),
    1575         make_option("--clobber-old-results", action="store_true", default=False, help="Clobbers test results from previous runs."),
    1576         make_option("--platform", help="Override the platform for expected results"),
     1574        optparse.make_option("--full-results-html", action="store_true", default=False, help="Show all failures in results.html, rather than only regressions"),
     1575        optparse.make_option("--clobber-old-results", action="store_true", default=False, help="Clobbers test results from previous runs."),
     1576        optparse.make_option("--platform", help="Override the platform for expected results"),
    15771577        # old-run-webkit-tests also has HTTP toggle options:
    15781578        # --[no-]http                     Run (or do not run) http tests (default: run)
     
    15821582    test_options = [
    15831583        # old-run-webkit-tests has --valgrind instead of wrapper.
    1584         make_option("--wrapper", help="wrapper command to insert before invocations of DumpRenderTree; option is split "
     1584        optparse.make_option("--wrapper", help="wrapper command to insert before invocations of DumpRenderTree; option is split "
    15851585                                      "on whitespace before running. (Example: --wrapper='valgrind --smc-check=all')"),
    15861586        # old-run-webkit-tests: -i|--ignore-tests               Comma-separated list of directories or tests to ignore
    1587         make_option("--test-list", action="append", help="read list of tests to run from file", metavar="FILE"),
     1587        optparse.make_option("--test-list", action="append", help="read list of tests to run from file", metavar="FILE"),
    15881588        # old-run-webkit-tests uses --skipped==[default|ignore|only] instead of --force:
    1589         make_option("--force", action="store_true", default=False, help="Run all tests, even those marked SKIP in the test list"),
    1590         make_option("--use-apache", action="store_true", default=False, help="Whether to use apache instead of lighttpd."),
    1591         make_option("--time-out-ms", help="Set the timeout for each test"),
     1589        optparse.make_option("--force", action="store_true", default=False, help="Run all tests, even those marked SKIP in the test list"),
     1590        optparse.make_option("--use-apache", action="store_true", default=False, help="Whether to use apache instead of lighttpd."),
     1591        optparse.make_option("--time-out-ms", help="Set the timeout for each test"),
    15921592        # old-run-webkit-tests calls --randomize-order --random:
    1593         make_option("--randomize-order", action="store_true", default=False, help=("Run tests in random order (useful for tracking down corruption)")),
    1594         make_option("--run-chunk", help=("Run a specified chunk (n:l), the nth of len l, of the layout tests")),
    1595         make_option("--run-part", help=("Run a specified part (n:m), the nth of m parts, of the layout tests")),
     1593        optparse.make_option("--randomize-order", action="store_true", default=False, help=("Run tests in random order (useful for tracking down corruption)")),
     1594        optparse.make_option("--run-chunk", help=("Run a specified chunk (n:l), the nth of len l, of the layout tests")),
     1595        optparse.make_option("--run-part", help=("Run a specified part (n:m), the nth of m parts, of the layout tests")),
    15961596        # old-run-webkit-tests calls --batch-size: --nthly n   Restart DumpRenderTree every n tests (default: 1000)
    1597         make_option("--batch-size", help=("Run a the tests in batches (n), after every n tests, DumpRenderTree is relaunched.")),
     1597        optparse.make_option("--batch-size", help=("Run a the tests in batches (n), after every n tests, DumpRenderTree is relaunched.")),
    15981598        # old-run-webkit-tests calls --run-singly: -1|--singly  Isolate each test case run (implies --nthly 1 --verbose)
    1599         make_option("--run-singly", action="store_true", default=False, help="run a separate DumpRenderTree for each test"),
    1600         make_option("--child-processes", help="Number of DumpRenderTrees to run in parallel."), # FIXME: Display default.
    1601         make_option("--experimental-fully-parallel", action="store_true", default=False, help="run all tests in parallel"),
     1599        optparse.make_option("--run-singly", action="store_true", default=False, help="run a separate DumpRenderTree for each test"),
     1600        optparse.make_option("--child-processes", help="Number of DumpRenderTrees to run in parallel."), # FIXME: Display default.
     1601        optparse.make_option("--experimental-fully-parallel", action="store_true", default=False, help="run all tests in parallel"),
    16021602        # FIXME: Need --exit-after-n-failures N       Exit after the first N failures instead of running all tests
    16031603        # FIXME: consider: --iterations n                  Number of times to run the set of tests (e.g. ABCABCABC)
     
    16051605
    16061606    misc_options = [
    1607         make_option("--lint-test-files", action="store_true", default=False, help="Makes sure the test files parse for all configurations. Does not run any tests."),
     1607        optparse.make_option("--lint-test-files", action="store_true", default=False, help="Makes sure the test files parse for all configurations. Does not run any tests."),
    16081608    ]
    16091609
    16101610    # FIXME: Move these into json_results_generator.py
    16111611    results_json_options = [
    1612         make_option("--builder-name", default="DUMMY_BUILDER_NAME", help=("The name of the builder shown on the waterfall running this script e.g. WebKit.")),
    1613         make_option("--build-name", default="DUMMY_BUILD_NAME", help=("The name of the builder used in its path, e.g. webkit-rel.")),
    1614         make_option("--build-number", default="DUMMY_BUILD_NUMBER", help=("The build number of the builder running this script.")),
     1612        optparse.make_option("--builder-name", default="DUMMY_BUILDER_NAME", help=("The name of the builder shown on the waterfall running this script e.g. WebKit.")),
     1613        optparse.make_option("--build-name", default="DUMMY_BUILD_NAME", help=("The name of the builder used in its path, e.g. webkit-rel.")),
     1614        optparse.make_option("--build-number", default="DUMMY_BUILD_NUMBER", help=("The build number of the builder running this script.")),
    16151615    ]
    16161616
    1617     options_list = configuration_options + logging_options + chromium_options + results_options + test_options + misc_options + results_json_options
     1617    option_list = configuration_options + logging_options + chromium_options + results_options + test_options + misc_options + results_json_options
    16181618    option_parser = optparse.OptionParser(option_list=option_list)
    16191619    return option_parser.parse_args(args)
Note: See TracChangeset for help on using the changeset viewer.