diff options
author | Manoj Gupta <manojgupta@google.com> | 2016-11-01 12:56:25 -0700 |
---|---|---|
committer | chrome-bot <chrome-bot@chromium.org> | 2016-11-01 15:50:24 -0700 |
commit | c39917fe61858e884d06656122cf88a8c66fd825 (patch) | |
tree | 4281d50331476710319707d3d15d613690cea646 /crosperf/settings_factory.py | |
parent | d768dc1c6dbd2cdc8f2503574e88ad88316e24f2 (diff) | |
download | toolchain-utils-c39917fe61858e884d06656122cf88a8c66fd825.tar.gz |
Update formatting of files before committing changes for autotest. No functional change.
BUG: chromium:647429
TEST: crosperf unit tests
Change-Id: I827f9ec4d00a0d8c1ae8a9930d7832289e694dc8
Reviewed-on: https://chrome-internal-review.googlesource.com/301457
Commit-Ready: Manoj Gupta <manojgupta@google.com>
Tested-by: Manoj Gupta <manojgupta@google.com>
Reviewed-by: Luis Lozano <llozano@chromium.org>
Diffstat (limited to 'crosperf/settings_factory.py')
-rw-r--r-- | crosperf/settings_factory.py | 419 |
1 files changed, 245 insertions, 174 deletions
diff --git a/crosperf/settings_factory.py b/crosperf/settings_factory.py index 372c7ff3..3bda6139 100644 --- a/crosperf/settings_factory.py +++ b/crosperf/settings_factory.py @@ -1,4 +1,3 @@ - # Copyright (c) 2013 The Chromium OS Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. @@ -18,29 +17,38 @@ class BenchmarkSettings(Settings): def __init__(self, name): super(BenchmarkSettings, self).__init__(name, 'benchmark') - self.AddField(TextField('test_name', - description='The name of the test to run. ' - 'Defaults to the name of the benchmark.')) - self.AddField(TextField('test_args', - description='Arguments to be passed to the ' - 'test.')) - self.AddField(IntegerField('iterations', - default=1, - description='Number of iterations to run the ' - 'test.')) - self.AddField(TextField('suite', - default='', - description='The type of the benchmark.')) - self.AddField(IntegerField('retries', - default=0, - description='Number of times to retry a ' - 'benchmark run.')) - self.AddField(BooleanField('run_local', - description='Run benchmark harness on the DUT. ' - 'Currently only compatible with the suite: ' - 'telemetry_Crosperf.', - required=False, - default=True)) + self.AddField( + TextField( + 'test_name', + description='The name of the test to run. ' + 'Defaults to the name of the benchmark.')) + self.AddField( + TextField( + 'test_args', description='Arguments to be passed to the ' + 'test.')) + self.AddField( + IntegerField( + 'iterations', + default=1, + description='Number of iterations to run the ' + 'test.')) + self.AddField( + TextField( + 'suite', default='', description='The type of the benchmark.')) + self.AddField( + IntegerField( + 'retries', + default=0, + description='Number of times to retry a ' + 'benchmark run.')) + self.AddField( + BooleanField( + 'run_local', + description='Run benchmark harness on the DUT. ' + 'Currently only compatible with the suite: ' + 'telemetry_Crosperf.', + required=False, + default=True)) class LabelSettings(Settings): @@ -48,46 +56,61 @@ class LabelSettings(Settings): def __init__(self, name): super(LabelSettings, self).__init__(name, 'label') - self.AddField(TextField('chromeos_image', - required=False, - description='The path to the image to run tests ' - 'on, for local/custom-built images. See the ' - "'build' option for official or trybot images.")) - self.AddField(TextField('chromeos_root', - description='The path to a chromeos checkout which ' - 'contains a src/scripts directory. Defaults to ' - 'the chromeos checkout which contains the ' - 'chromeos_image.')) - self.AddField( - ListField('remote', - description='A comma-separated list of IPs of chromeos' - 'devices to run experiments on.')) - self.AddField(TextField('image_args', - required=False, - default='', - description='Extra arguments to pass to ' - 'image_chromeos.py.')) - self.AddField(TextField('cache_dir', - default='', - description='The cache dir for this image.')) - self.AddField(TextField('compiler', - default='gcc', - description='The compiler used to build the ' - 'ChromeOS image (gcc or llvm).')) - self.AddField(TextField('chrome_src', - description='The path to the source of chrome. ' - 'This is used to run telemetry benchmarks. ' - 'The default one is the src inside chroot.', - required=False, - default='')) - self.AddField(TextField('build', - description='The xbuddy specification for an ' - 'official or trybot image to use for tests. ' - "'/remote' is assumed, and the board is given " - "elsewhere, so omit the '/remote/<board>/' xbuddy " - 'prefix.', - required=False, - default='')) + self.AddField( + TextField( + 'chromeos_image', + required=False, + description='The path to the image to run tests ' + 'on, for local/custom-built images. See the ' + "'build' option for official or trybot images.")) + self.AddField( + TextField( + 'chromeos_root', + description='The path to a chromeos checkout which ' + 'contains a src/scripts directory. Defaults to ' + 'the chromeos checkout which contains the ' + 'chromeos_image.')) + self.AddField( + ListField( + 'remote', + description='A comma-separated list of IPs of chromeos' + 'devices to run experiments on.')) + self.AddField( + TextField( + 'image_args', + required=False, + default='', + description='Extra arguments to pass to ' + 'image_chromeos.py.')) + self.AddField( + TextField( + 'cache_dir', + default='', + description='The cache dir for this image.')) + self.AddField( + TextField( + 'compiler', + default='gcc', + description='The compiler used to build the ' + 'ChromeOS image (gcc or llvm).')) + self.AddField( + TextField( + 'chrome_src', + description='The path to the source of chrome. ' + 'This is used to run telemetry benchmarks. ' + 'The default one is the src inside chroot.', + required=False, + default='')) + self.AddField( + TextField( + 'build', + description='The xbuddy specification for an ' + 'official or trybot image to use for tests. ' + "'/remote' is assumed, and the board is given " + "elsewhere, so omit the '/remote/<board>/' xbuddy " + 'prefix.', + required=False, + default='')) class GlobalSettings(Settings): @@ -95,116 +118,164 @@ class GlobalSettings(Settings): def __init__(self, name): super(GlobalSettings, self).__init__(name, 'global') - self.AddField(TextField('name', - description='The name of the experiment. Just an ' - 'identifier.')) - self.AddField(TextField('board', - description='The target board for running ' - 'experiments on, e.g. x86-alex.')) - self.AddField(ListField('remote', - description="A comma-separated list of IPs of " - 'chromeos devices to run experiments on.')) - self.AddField(BooleanField('rerun_if_failed', - description='Whether to re-run failed test runs ' - 'or not.', - default=False)) - self.AddField(BooleanField('rm_chroot_tmp', - default=False, - description='Whether to remove the test_that ' - 'result in the chroot.')) - self.AddField(ListField('email', - description='Space-separated list of email ' - 'addresses to send email to.')) - self.AddField(BooleanField('rerun', - description='Whether to ignore the cache and ' - 'for tests to be re-run.', - default=False)) - self.AddField(BooleanField('same_specs', - default=True, - description='Ensure cached runs are run on the ' - 'same kind of devices which are specified as a ' - 'remote.')) - self.AddField(BooleanField('same_machine', - default=False, - description='Ensure cached runs are run on the ' - 'same remote.')) - self.AddField(BooleanField('use_file_locks', - default=False, - description='Whether to use the file locks ' - 'mechanism (deprecated) instead of the AFE ' - 'server lock mechanism.')) - self.AddField(IntegerField('iterations', - default=1, - description='Number of iterations to run all ' - 'tests.')) - self.AddField(TextField('chromeos_root', - description='The path to a chromeos checkout which ' - 'contains a src/scripts directory. Defaults to ' - 'the chromeos checkout which contains the ' - 'chromeos_image.')) - self.AddField(TextField('logging_level', - default='average', - description='The level of logging desired. ' - "Options are 'quiet', 'average', and 'verbose'.")) - self.AddField(IntegerField('acquire_timeout', - default=0, - description='Number of seconds to wait for ' - 'machine before exit if all the machines in ' - 'the experiment file are busy. Default is 0.')) - self.AddField(TextField('perf_args', - default='', - description='The optional profile command. It ' - 'enables perf commands to record perforamance ' - 'related counters. It must start with perf ' - 'command record or stat followed by arguments.')) - self.AddField(TextField('cache_dir', - default='', - description='The abs path of cache dir. ' - 'Default is /home/$(whoami)/cros_scratch.')) - self.AddField(BooleanField('cache_only', - default=False, - description='Whether to use only cached ' - 'results (do not rerun failed tests).')) - self.AddField(BooleanField('no_email', - default=False, - description='Whether to disable the email to ' - 'user after crosperf finishes.')) - self.AddField(BooleanField('json_report', - default=False, - description='Whether to generate a json version ' - 'of the report, for archiving.')) - self.AddField(BooleanField('show_all_results', - default=False, - description='When running Telemetry tests, ' - 'whether to all the results, instead of just ' - 'the default (summary) results.')) - self.AddField(TextField('share_cache', - default='', - description='Path to alternate cache whose data ' - 'you want to use. It accepts multiple directories ' - 'separated by a ",".')) - self.AddField(TextField('results_dir', - default='', - description='The results dir.')) - self.AddField(TextField('locks_dir', - default='', - description='An alternate directory to use for ' - 'storing/checking machine locks. Using this field ' - 'automatically sets use_file_locks to True.\n' - 'WARNING: If you use your own locks directory, ' - 'there is no guarantee that someone else might not ' - 'hold a lock on the same machine in a different ' - 'locks directory.')) - self.AddField(TextField('chrome_src', - description='The path to the source of chrome. ' - 'This is used to run telemetry benchmarks. ' - 'The default one is the src inside chroot.', - required=False, - default='')) - self.AddField(IntegerField('retries', - default=0, - description='Number of times to retry a ' - 'benchmark run.')) + self.AddField( + TextField( + 'name', + description='The name of the experiment. Just an ' + 'identifier.')) + self.AddField( + TextField( + 'board', + description='The target board for running ' + 'experiments on, e.g. x86-alex.')) + self.AddField( + ListField( + 'remote', + description='A comma-separated list of IPs of ' + 'chromeos devices to run experiments on.')) + self.AddField( + BooleanField( + 'rerun_if_failed', + description='Whether to re-run failed test runs ' + 'or not.', + default=False)) + self.AddField( + BooleanField( + 'rm_chroot_tmp', + default=False, + description='Whether to remove the test_that ' + 'result in the chroot.')) + self.AddField( + ListField( + 'email', + description='Space-separated list of email ' + 'addresses to send email to.')) + self.AddField( + BooleanField( + 'rerun', + description='Whether to ignore the cache and ' + 'for tests to be re-run.', + default=False)) + self.AddField( + BooleanField( + 'same_specs', + default=True, + description='Ensure cached runs are run on the ' + 'same kind of devices which are specified as a ' + 'remote.')) + self.AddField( + BooleanField( + 'same_machine', + default=False, + description='Ensure cached runs are run on the ' + 'same remote.')) + self.AddField( + BooleanField( + 'use_file_locks', + default=False, + description='Whether to use the file locks ' + 'mechanism (deprecated) instead of the AFE ' + 'server lock mechanism.')) + self.AddField( + IntegerField( + 'iterations', + default=1, + description='Number of iterations to run all ' + 'tests.')) + self.AddField( + TextField( + 'chromeos_root', + description='The path to a chromeos checkout which ' + 'contains a src/scripts directory. Defaults to ' + 'the chromeos checkout which contains the ' + 'chromeos_image.')) + self.AddField( + TextField( + 'logging_level', + default='average', + description='The level of logging desired. ' + "Options are 'quiet', 'average', and 'verbose'.")) + self.AddField( + IntegerField( + 'acquire_timeout', + default=0, + description='Number of seconds to wait for ' + 'machine before exit if all the machines in ' + 'the experiment file are busy. Default is 0.')) + self.AddField( + TextField( + 'perf_args', + default='', + description='The optional profile command. It ' + 'enables perf commands to record perforamance ' + 'related counters. It must start with perf ' + 'command record or stat followed by arguments.')) + self.AddField( + TextField( + 'cache_dir', + default='', + description='The abs path of cache dir. ' + 'Default is /home/$(whoami)/cros_scratch.')) + self.AddField( + BooleanField( + 'cache_only', + default=False, + description='Whether to use only cached ' + 'results (do not rerun failed tests).')) + self.AddField( + BooleanField( + 'no_email', + default=False, + description='Whether to disable the email to ' + 'user after crosperf finishes.')) + self.AddField( + BooleanField( + 'json_report', + default=False, + description='Whether to generate a json version ' + 'of the report, for archiving.')) + self.AddField( + BooleanField( + 'show_all_results', + default=False, + description='When running Telemetry tests, ' + 'whether to all the results, instead of just ' + 'the default (summary) results.')) + self.AddField( + TextField( + 'share_cache', + default='', + description='Path to alternate cache whose data ' + 'you want to use. It accepts multiple directories ' + 'separated by a ",".')) + self.AddField( + TextField( + 'results_dir', default='', description='The results dir.')) + self.AddField( + TextField( + 'locks_dir', + default='', + description='An alternate directory to use for ' + 'storing/checking machine locks. Using this field ' + 'automatically sets use_file_locks to True.\n' + 'WARNING: If you use your own locks directory, ' + 'there is no guarantee that someone else might not ' + 'hold a lock on the same machine in a different ' + 'locks directory.')) + self.AddField( + TextField( + 'chrome_src', + description='The path to the source of chrome. ' + 'This is used to run telemetry benchmarks. ' + 'The default one is the src inside chroot.', + required=False, + default='')) + self.AddField( + IntegerField( + 'retries', + default=0, + description='Number of times to retry a ' + 'benchmark run.')) class SettingsFactory(object): |