diff options
author | zhizhouy <zhizhouy@google.com> | 2020-04-21 18:11:36 -0700 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2020-04-23 01:07:26 +0000 |
commit | c3671eecda39df9d6bbb6bda9157de5edf118b02 (patch) | |
tree | 8c6468dc31f8aa8ac8cc06eaa39a39876f66c608 /crosperf/suite_runner.py | |
parent | 3b2358092e00ab7904a873b516ac6aac832c2277 (diff) | |
download | toolchain-utils-c3671eecda39df9d6bbb6bda9157de5edf118b02.tar.gz |
crosperf: add support to run tast benchmarks
Crosperf used to only support autotest server/client tests, and was
limiting us from running and collecting tast benchmarks.
This patch introduces a simple support for crosperf to run tast. Note
that currently we do not support passing arguments or running tast with
local changes. It basically launches `tast run <ip> <tast_test>` and
collects chart json result and parses it.
BUG=chromium:1071937
TEST=tested with tast.platform.ReportDiskUsage
Change-Id: I1980a48c4ca8e02548e5313d32b8c5ddcf5e3e60
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/2160128
Commit-Queue: Zhizhou Yang <zhizhouy@google.com>
Tested-by: Zhizhou Yang <zhizhouy@google.com>
Auto-Submit: Zhizhou Yang <zhizhouy@google.com>
Reviewed-by: George Burgess <gbiv@chromium.org>
Diffstat (limited to 'crosperf/suite_runner.py')
-rw-r--r-- | crosperf/suite_runner.py | 27 |
1 files changed, 24 insertions, 3 deletions
diff --git a/crosperf/suite_runner.py b/crosperf/suite_runner.py index 62a85cc6..17e1ad73 100644 --- a/crosperf/suite_runner.py +++ b/crosperf/suite_runner.py @@ -17,7 +17,7 @@ import time from cros_utils import command_executer TEST_THAT_PATH = '/usr/bin/test_that' -# TODO: Need to check whether Skylab is installed and set up correctly. +TAST_PATH = '/usr/bin/tast' SKYLAB_PATH = '/usr/local/bin/skylab' GS_UTIL = 'src/chromium/depot_tools/gsutil.py' AUTOTEST_DIR = '/mnt/host/source/src/third_party/autotest/files' @@ -78,8 +78,11 @@ class SuiteRunner(object): if label.skylab: ret_tup = self.Skylab_Run(label, benchmark, test_args, profiler_args) else: - ret_tup = self.Test_That_Run(machine_name, label, benchmark, test_args, - profiler_args) + if benchmark.suite == 'tast': + ret_tup = self.Tast_Run(machine_name, label, benchmark) + else: + ret_tup = self.Test_That_Run(machine_name, label, benchmark, + test_args, profiler_args) if ret_tup[0] != 0: self.logger.LogOutput('benchmark %s failed. Retries left: %s' % (benchmark.name, benchmark.retries - i)) @@ -127,6 +130,24 @@ class SuiteRunner(object): return args_list + # TODO(zhizhouy): Currently do not support passing arguments or running + # customized tast tests, as we do not have such requirements. + def Tast_Run(self, machine, label, benchmark): + # Remove existing tast results + command = 'rm -rf /usr/local/autotest/results/*' + self._ce.CrosRunCommand( + command, machine=machine, chromeos_root=label.chromeos_root) + + command = ' '.join( + [TAST_PATH, 'run', '-build=False', machine, benchmark.test_name]) + + if self.log_level != 'verbose': + self.logger.LogOutput('Running test.') + self.logger.LogOutput('CMD: %s' % command) + + return self._ce.ChrootRunCommandWOutput( + label.chromeos_root, command, command_terminator=self._ct) + def Test_That_Run(self, machine, label, benchmark, test_args, profiler_args): """Run the test_that test..""" |