commands: Delete dead code
BUG=chromium:1091878
TEST=./run_pytest cbuildbot/commands_unittest
Change-Id: Ib9c9d9cc52c3f25a9064b21b752fa760621147de
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/chromite/+/2255331
Commit-Queue: Prathmesh Prabhu <pprabhu@chromium.org>
Tested-by: Prathmesh Prabhu <pprabhu@chromium.org>
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Reviewed-by: Sean Abraham <seanabraham@chromium.org>
diff --git a/cbuildbot/commands.py b/cbuildbot/commands.py
index 5e1f250..bf19534 100644
--- a/cbuildbot/commands.py
+++ b/cbuildbot/commands.py
@@ -29,7 +29,6 @@
from chromite.cbuildbot import swarming_lib
from chromite.cbuildbot import topology
-from chromite.lib import buildbot_annotations
from chromite.lib import chroot_lib
from chromite.lib import cipd
from chromite.lib import config_lib
@@ -1218,117 +1217,6 @@
# pylint: disable=docstring-missing-args
-def _SkylabCreateTestArgs(build,
- pool,
- test_name,
- board=None,
- model=None,
- timeout_mins=None,
- tags=None,
- keyvals=None,
- test_args=None):
- """Get a list of args for skylab create-test.
-
- Args:
- See args of RunSkylabHWTEST.
-
- Returns:
- A list of string args for skylab create-test.
- """
- args = ['-image', build]
- args += ['-pool', 'DUT_POOL_%s' % pool.upper()]
- if board is None and model is None:
- raise ValueError('Need to specify either board or model.')
-
- if board is not None:
- args += ['-board', board]
-
- if model is not None:
- args += ['-model', model]
-
- if timeout_mins is not None:
- args += ['-timeout-mins', str(timeout_mins)]
-
- if tags is not None:
- for tag in tags:
- args += ['-tag', tag]
-
- if keyvals is not None:
- for k in keyvals:
- args += ['-keyval', k]
-
- if test_args is not None:
- args += ['-test-args', test_args]
-
- args += ['-service-account-json', constants.CHROMEOS_SERVICE_ACCOUNT]
-
- return args + [test_name]
-
-# TODO(crbug.com/1008919): Remove 120 default once config is properly set
-# with default timeouts.
-def RunSkylabHWTest(build,
- pool,
- test_name,
- shown_test_name=None,
- board=None,
- model=None,
- timeout_mins=120,
- tags=None,
- keyvals=None,
- test_args=None):
- """Run a skylab test in the Autotest lab using skylab tool.
-
- Args:
- build: A string full image name.
- pool: A string pool to run the test on.
- test_name: A string testname to run.
- shown_test_name: A string to print the test in cbuildbot. Usually it's the
- same as test_name. But for parameterized tests, it could
- vary due to different test_args, e.g. for paygen au tests:
- test_name: autoupdate_EndToEndTest
- shown_test_name:
- autoupdate_EndToEndTest_paygen_au_beta_full_11316.66.0
- board: A string board to run the test on.
- model: A string model to run the test on.
- timeout_mins: An integer to indicate the test's timeout.
- tags: A list of strings to tag the task in swarming.
- keyvals: A list of strings to be passed to the test as job_keyvals.
- test_args: A string to be passed to the test as arguments. The format is:
- 'X1=Y1 X2=Y2 X3=Y3 ...'
-
- Returns:
- A swarming task link if the test is created successfully.
- """
- if shown_test_name is None:
- shown_test_name = test_name
-
- skylab_path = _InstallSkylabTool()
- args = _SkylabCreateTestArgs(build, pool, test_name, board, model,
- timeout_mins, tags, keyvals, test_args)
- try:
- result = cros_build_lib.run(
- [skylab_path, 'create-test'] + args, stdout=True)
- return HWTestSuiteResult(None, None)
- except cros_build_lib.RunCommandError as e:
- result = e.result
- to_raise = failures_lib.TestFailure(
- '** HWTest failed (code %d) **' % result.returncode)
- return HWTestSuiteResult(to_raise, None)
- finally:
- # This is required to output buildbot annotations, e.g. 'STEP_LINKS'.
- output = result.output.strip()
- # The format of output is:
- # Created Swarming task https://chromeos-swarming.appspot.com/task?id=XX
- sys.stdout.write('%s \n' % output)
- sys.stdout.write('######## Output for buildbot annotations ######## \n')
- sys.stdout.write('%s \n' % str(
- buildbot_annotations.StepLink(shown_test_name,
- output.split()[-1])))
- sys.stdout.write('######## END Output for buildbot annotations ######## \n')
- sys.stdout.flush()
-
-
-# pylint: disable=docstring-missing-args
@failures_lib.SetFailureType(failures_lib.SuiteTimedOut,
timeout_util.TimeoutError)
def RunSkylabHWTestSuite(