Changeset 129683 in webkit


Ignore:
Timestamp:
Sep 26, 2012 12:20:37 PM (12 years ago)
Author:
commit-queue@webkit.org
Message:

run-perf-tests must expand environment variables in user provided paths
https://bugs.webkit.org/show_bug.cgi?id=97686

Patch by Marcelo Lira <marcelo.lira@openbossa.org> on 2012-09-26
Reviewed by Ryosuke Niwa.

The run-perf-tests command line options that receive paths from the
user now expand any possible environment variables, because Python's
file handling methods do not handle those.

Examples:
run-perf-tests --platform=qt --release --output-json-path=~/perf-results
run-perf-tests --platform=qt --release --output-json-path=$HOME/perf-results

Also removed unused imports.

  • Scripts/webkitpy/performance_tests/perftestsrunner.py:

(PerfTestsRunner._parse_args._expand_path): expand environment variables in a path passed via command line
(PerfTestsRunner._parse_args):

Location:
trunk/Tools
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Tools/ChangeLog

    r129672 r129683  
     12012-09-26  Marcelo Lira  <marcelo.lira@openbossa.org>
     2
     3        run-perf-tests must expand environment variables in user provided paths
     4        https://bugs.webkit.org/show_bug.cgi?id=97686
     5
     6        Reviewed by Ryosuke Niwa.
     7
     8        The run-perf-tests command line options that receive paths from the
     9        user now expand any possible environment variables, because Python's
     10        file handling methods do not handle those.
     11
     12        Examples:
     13        run-perf-tests --platform=qt --release --output-json-path=~/perf-results
     14        run-perf-tests --platform=qt --release --output-json-path=$HOME/perf-results
     15
     16        Also removed unused imports.
     17
     18        * Scripts/webkitpy/performance_tests/perftestsrunner.py:
     19        (PerfTestsRunner._parse_args._expand_path): expand environment variables in a path passed via command line
     20        (PerfTestsRunner._parse_args):
     21
    1222012-09-26  Sheriff Bot  <webkit.review.bot@gmail.com>
    223
  • trunk/Tools/Scripts/webkitpy/performance_tests/perftestsrunner.py

    r129580 r129683  
    3030"""Run Inspector's perf tests in perf mode."""
    3131
     32import os
    3233import json
    3334import logging
    3435import optparse
    35 import re
    36 import sys
    3736import time
    3837
     
    4039from webkitpy.common.host import Host
    4140from webkitpy.common.net.file_uploader import FileUploader
    42 from webkitpy.layout_tests.views import printing
    4341from webkitpy.performance_tests.perftest import PerfTestFactory
    44 from webkitpy.performance_tests.perftest import ReplayPerfTest
    4542
    4643
     
    7471    @staticmethod
    7572    def _parse_args(args=None):
     73        def _expand_path(option, opt_str, value, parser):
     74            path = os.path.expandvars(os.path.expanduser(value))
     75            setattr(parser.values, option.dest, path)
    7676        perf_option_list = [
    7777            optparse.make_option('--debug', action='store_const', const='Debug', dest="configuration",
     
    9999            optparse.make_option("--no-results", action="store_false", dest="generate_results", default=True,
    100100                help="Do no generate results JSON and results page."),
    101             optparse.make_option("--output-json-path",
     101            optparse.make_option("--output-json-path", action='callback', callback=_expand_path, type="str",
    102102                help="Path to generate a JSON file at; may contain previous results if it already exists."),
    103103            optparse.make_option("--reset-results", action="store_true",
    104104                help="Clears the content in the generated JSON file before adding the results."),
    105             optparse.make_option("--slave-config-json-path",
     105            optparse.make_option("--slave-config-json-path", action='callback', callback=_expand_path, type="str",
    106106                help="Only used on bots. Path to a slave configuration file."),
    107             optparse.make_option("--source-json-path", dest="slave_config_json_path",
     107            optparse.make_option("--source-json-path", action='callback', callback=_expand_path, type="str", dest="slave_config_json_path",
    108108                # FIXME: Remove this option once build.webkit.org is updated to use --slave-config-json-path.
    109109                help="Deprecated. Overrides --slave-config-json-path."),
Note: See TracChangeset for help on using the changeset viewer.