diff options
author | Manoj Gupta <manojgupta@google.com> | 2017-01-09 14:52:51 -0800 |
---|---|---|
committer | ChromeOS Commit Bot <chromeos-commit-bot@chromium.org> | 2017-01-11 20:56:45 +0000 |
commit | 3fb928efb42405e386da41adf4bd674e86e23022 (patch) | |
tree | 85fd5ec00c0f5131fef3e3b696a2b314f04007ea | |
parent | 70204447c3c103508f1b8e58d59a9b8f165e1c21 (diff) | |
download | toolchain-utils-3fb928efb42405e386da41adf4bd674e86e23022.tar.gz |
Fix test_that run for non-telemtry tests.
Do not add the autotest_dir argument to test_that
for non-telemetry tests.
Minor change: Remove a leftover print from download_images
unit test.
BUG: chromium:679001
TEST:crosperf unit tests
Change-Id: I0ff5365902af40097b61ae57d7c0d8d43ea308a8
Reviewed-on: https://chromium-review.googlesource.com/426073
Reviewed-by: Caroline Tice <cmtice@chromium.org>
Commit-Queue: Manoj Gupta <manojgupta@chromium.org>
Tested-by: Manoj Gupta <manojgupta@chromium.org>
Trybot-Ready: Manoj Gupta <manojgupta@chromium.org>
-rwxr-xr-x | crosperf/download_images_unittest.py | 1 | ||||
-rw-r--r-- | crosperf/suite_runner.py | 19 | ||||
-rwxr-xr-x | crosperf/suite_runner_unittest.py | 3 |
3 files changed, 14 insertions, 9 deletions
diff --git a/crosperf/download_images_unittest.py b/crosperf/download_images_unittest.py index 24a94a37..7a4f3850 100755 --- a/crosperf/download_images_unittest.py +++ b/crosperf/download_images_unittest.py @@ -116,7 +116,6 @@ class ImageDownloaderTestcast(unittest.TestCase): # Verify RunCommand was called twice with correct arguments. self.assertEqual(mock_cmd_exec.RunCommand.call_count, 2) - print(mock_cmd_exec.RunCommand.call_args_list) # Call 1, should have 2 arguments self.assertEqual(len(mock_cmd_exec.RunCommand.call_args_list[0]), 2) actual_arg = mock_cmd_exec.RunCommand.call_args_list[0][0] diff --git a/crosperf/suite_runner.py b/crosperf/suite_runner.py index 744d8bb3..796c1e4d 100644 --- a/crosperf/suite_runner.py +++ b/crosperf/suite_runner.py @@ -13,6 +13,7 @@ from cros_utils import command_executer import test_flag TEST_THAT_PATH = '/usr/bin/test_that' +AUTOTEST_DIR = '~/trunk/src/third_party/autotest/files' CHROME_MOUNT_DIR = '/tmp/chrome_root' @@ -173,13 +174,19 @@ class SuiteRunner(object): # Rebooting between iterations has proven to help with this. self.RebootMachine(machine, label.chromeos_root) - autotest_dir = '~/trunk/src/third_party/autotest/files' + autotest_dir = AUTOTEST_DIR if label.autotest_path != '': autotest_dir = label.autotest_path - command = ( - ('%s --autotest_dir %s --fast ' - '%s %s %s') % - (TEST_THAT_PATH, autotest_dir, options, machine, benchmark.test_name)) + + autotest_dir_arg = '--autotest_dir %s' % autotest_dir + # For non-telemetry tests, specify an autotest directory only if the + # specified directory is different from default (crosbug.com/679001). + if autotest_dir == AUTOTEST_DIR: + autotest_dir_arg = '' + + command = (('%s %s --fast ' + '%s %s %s') % (TEST_THAT_PATH, autotest_dir_arg, options, + machine, benchmark.test_name)) if self.log_level != 'verbose': self.logger.LogOutput('Running test.') self.logger.LogOutput('CMD: %s' % command) @@ -211,7 +218,7 @@ class SuiteRunner(object): # For telemetry runs, we can use the autotest copy from the source # location. No need to have one under /build/<board>. - autotest_dir_arg = '--autotest_dir ~/trunk/src/third_party/autotest/files' + autotest_dir_arg = '--autotest_dir %s' % AUTOTEST_DIR if label.autotest_path != '': autotest_dir_arg = '--autotest_dir %s' % label.autotest_path diff --git a/crosperf/suite_runner_unittest.py b/crosperf/suite_runner_unittest.py index b5a0439f..15847b02 100755 --- a/crosperf/suite_runner_unittest.py +++ b/crosperf/suite_runner_unittest.py @@ -256,8 +256,7 @@ class SuiteRunnerTest(unittest.TestCase): args_dict = mock_chroot_runcmd.call_args_list[0][1] self.assertEqual(len(args_list), 2) self.assertEqual(args_list[0], '/tmp/chromeos') - self.assertEqual(args_list[1], ('/usr/bin/test_that --autotest_dir ' - '~/trunk/src/third_party/autotest/files ' + self.assertEqual(args_list[1], ('/usr/bin/test_that ' '--fast --board=lumpy ' '--iterations=2 lumpy1.cros octane')) self.assertEqual(args_dict['command_terminator'], self.mock_cmd_term) |