[autotest] Only integer or None as num argument in create_suite_job
Cleanup to reduce confusion and type casting back and forth between int
and string.
BUG=chromium-os:37936
TEST=unit test that non-integer or None num arguments throw appropriate
exception; unit test that integer arguments get passed along correctly;
ran a suite locally to ensure rpc call still working
Change-Id: Id8b8e0dd5a08db2ebec67cdba13b2b1d8eb0b149
Reviewed-on: https://gerrit.chromium.org/gerrit/41791
Reviewed-by: Aviv Keshet <akeshet@chromium.org>
Tested-by: Aviv Keshet <akeshet@chromium.org>
Commit-Queue: David James <davidjames@chromium.org>
diff --git a/site_utils/suite_scheduler/task.py b/site_utils/suite_scheduler/task.py
index c53938a..4e32fed 100644
--- a/site_utils/suite_scheduler/task.py
+++ b/site_utils/suite_scheduler/task.py
@@ -4,7 +4,7 @@
import logging, re
-import deduping_scheduler, forgiving_config_parser
+import deduping_scheduler
from distutils import version
from constants import Labels
@@ -136,13 +136,14 @@
@param pool: the pool of machines to use for scheduling purposes.
Default: None
@param num: the number of devices across which to shard the test suite.
+ Type: integer or None
Default: None
"""
self._name = name
self._suite = suite
self._branch_specs = branch_specs
self._pool = pool
- self._num = '%d' % num if num else None
+ self._num = num
self._bare_branches = []
if not branch_specs:
@@ -159,7 +160,7 @@
# Since we expect __hash__() and other comparitor methods to be used
# frequently by set operations, and they use str() a lot, pre-compute
# the string representation of this object.
- self._str = '%s: %s on %s with pool %s, across %r machines' % (
+ self._str = '%s: %s on %s with pool %s, across %d machines' % (
self.__class__.__name__, suite, branch_specs, pool, num)