--profile should imply --test-runner-count=1 in run-perf-tests
authorrniwa@webkit.org <rniwa@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 18 Mar 2014 00:58:40 +0000 (00:58 +0000)
committerrniwa@webkit.org <rniwa@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 18 Mar 2014 00:58:40 +0000 (00:58 +0000)
https://bugs.webkit.org/show_bug.cgi?id=130375

Reviewed by Benjamin Poulain.

Use the test runner count of 1 when --profile is specified but not --test-runner-count.

* Scripts/webkitpy/performance_tests/perftestsrunner.py:
(PerfTestsRunner._parse_args): Use -1 as the default value.
(PerfTestsRunner._collect_tests): If --test-runner-count is set (i.e. it's a positive value),
then use that value. Otherwise, if it's never set and --profile is present, test-runner-count
should be 1.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@165782 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Tools/ChangeLog
Tools/Scripts/webkitpy/performance_tests/perftestsrunner.py

index dba4c56a2c1b2b10bde94250262c1fb39ca9e6db..203f05f9212cc2d5c21e202968b4a950ec02c0ae 100644 (file)
@@ -1,3 +1,18 @@
+2014-03-17  Ryosuke Niwa  <rniwa@webkit.org>
+
+        --profile should imply --test-runner-count=1 in run-perf-tests
+        https://bugs.webkit.org/show_bug.cgi?id=130375
+
+        Reviewed by Benjamin Poulain.
+
+        Use the test runner count of 1 when --profile is specified but not --test-runner-count.
+
+        * Scripts/webkitpy/performance_tests/perftestsrunner.py:
+        (PerfTestsRunner._parse_args): Use -1 as the default value.
+        (PerfTestsRunner._collect_tests): If --test-runner-count is set (i.e. it's a positive value),
+        then use that value. Otherwise, if it's never set and --profile is present, test-runner-count
+        should be 1.
+
 2014-03-17  Simon Fraser  <simon.fraser@apple.com>
 
         Address some style nits.
index f981e69bed699925a5ddf7ccc7260472f403eed4..b755d2e29f28f88b1608bf51b533235fbceacb13 100644 (file)
@@ -125,7 +125,7 @@ class PerfTestsRunner(object):
                 help="Alternative DumpRenderTree binary to use"),
             optparse.make_option("--repeat", default=1, type="int",
                 help="Specify number of times to run test set (default: 1)."),
-            optparse.make_option("--test-runner-count", default=DEFAULT_TEST_RUNNER_COUNT, type="int",
+            optparse.make_option("--test-runner-count", default=-1, type="int",
                 help="Specify number of times to invoke test runner for each performance test."),
             ]
         return optparse.OptionParser(option_list=(perf_option_list)).parse_args(args)
@@ -152,11 +152,18 @@ class PerfTestsRunner(object):
         skipped_directories = set(['.svn', 'resources'])
         test_files = find_files.find(filesystem, self._base_path, paths, skipped_directories, _is_test_file)
         tests = []
+
+        test_runner_count = DEFAULT_TEST_RUNNER_COUNT
+        if self._options.test_runner_count > 0:
+            test_runner_count = self._options.test_runner_count
+        elif self._options.profile:
+            test_runner_count = 1
+
         for path in test_files:
             relative_path = filesystem.relpath(path, self._base_path).replace('\\', '/')
             if self._options.use_skipped_list and self._port.skips_perf_test(relative_path) and filesystem.normpath(relative_path) not in paths:
                 continue
-            test = PerfTestFactory.create_perf_test(self._port, relative_path, path, test_runner_count=self._options.test_runner_count)
+            test = PerfTestFactory.create_perf_test(self._port, relative_path, path, test_runner_count=test_runner_count)
             tests.append(test)
 
         return tests