summaryrefslogtreecommitdiffstats
path: root/tools/auto_bisect
diff options
context:
space:
mode:
authorqyearsley <qyearsley@chromium.org>2015-02-10 13:09:20 -0800
committerCommit bot <commit-bot@chromium.org>2015-02-10 21:10:07 +0000
commit30acccac63eab05248870f11aceb2c74ee76ccea (patch)
treead6af1e2cb4cf312b2d923ebeb359cfca840129b /tools/auto_bisect
parente5399b75fcba86ff036cb33cd02c25a729a1ba67 (diff)
downloadchromium_src-30acccac63eab05248870f11aceb2c74ee76ccea.zip
chromium_src-30acccac63eab05248870f11aceb2c74ee76ccea.tar.gz
chromium_src-30acccac63eab05248870f11aceb2c74ee76ccea.tar.bz2
Fix formatting and printing of help of bisect_perf_regression.py.
BUG=457024 Review URL: https://codereview.chromium.org/916503002 Cr-Commit-Position: refs/heads/master@{#315638}
Diffstat (limited to 'tools/auto_bisect')
-rwxr-xr-xtools/auto_bisect/bisect_perf_regression.py11
-rw-r--r--tools/auto_bisect/bisect_perf_regression_test.py7
2 files changed, 11 insertions, 7 deletions
diff --git a/tools/auto_bisect/bisect_perf_regression.py b/tools/auto_bisect/bisect_perf_regression.py
index d60f29f3..e4d876f 100755
--- a/tools/auto_bisect/bisect_perf_regression.py
+++ b/tools/auto_bisect/bisect_perf_regression.py
@@ -2578,10 +2578,9 @@ class BisectOptions(object):
' --max_time_minutes. Values will be clamped to '
'range [1, 60]. Default value is 20.')
group.add_argument('-t', '--truncate_percent', type=int, default=25,
- help='The highest/lowest % are discarded to form a '
- 'truncated mean. Values will be clamped to range '
- '[0, 25]. Default value is 25 (highest/lowest 25% '
- 'will be discarded).')
+ help='The highest/lowest percent are discarded to form '
+ 'a truncated mean. Values will be clamped to range '
+ '[0, 25]. Default value is 25 percent.')
group.add_argument('--bisect_mode', default=bisect_utils.BISECT_MODE_MEAN,
choices=[bisect_utils.BISECT_MODE_MEAN,
bisect_utils.BISECT_MODE_STD_DEV,
@@ -2670,9 +2669,9 @@ class BisectOptions(object):
"""Creates a parser with bisect options.
Returns:
- An instance of optparse.OptionParser.
+ An instance of argparse.ArgumentParser.
"""
- usage = ('%prog [options] [-- chromium-options]\n'
+ usage = ('%(prog)s [options] [-- chromium-options]\n'
'Perform binary search on revision history to find a minimal '
'range of revisions where a performance metric regressed.\n')
diff --git a/tools/auto_bisect/bisect_perf_regression_test.py b/tools/auto_bisect/bisect_perf_regression_test.py
index f45516a..bd49d8a 100644
--- a/tools/auto_bisect/bisect_perf_regression_test.py
+++ b/tools/auto_bisect/bisect_perf_regression_test.py
@@ -197,6 +197,12 @@ class BisectPerfRegressionTest(unittest.TestCase):
def tearDown(self):
os.chdir(self.cwd)
+ def testBisectOptionsCanPrintHelp(self):
+ """Tests that the argument parser can be made and can print help."""
+ bisect_options = bisect_perf_regression.BisectOptions()
+ parser = bisect_options._CreateCommandLineParser()
+ parser.format_help()
+
def testParseDEPSStringManually(self):
"""Tests DEPS parsing."""
deps_file_contents = """
@@ -665,4 +671,3 @@ class GitTryJobTestCases(unittest.TestCase):
if __name__ == '__main__':
unittest.main()
-