[autotest] ignore milestones when looking at factory/firmware branches
In the suite scheduler, we intend to ignore the numeric milestones
when deciding to run a suite on a factory/firmware build. The code
was not doing this. Now it is.
BUG=chromium-os:31415
TEST=unit
Change-Id: I14d989980066ffaa57184b45ef2bace3057c7c08
Reviewed-on: https://gerrit.chromium.org/gerrit/24120
Tested-by: Chris Masone <cmasone@chromium.org>
Reviewed-by: Chris Masone <cmasone@chromium.org>
Commit-Ready: Chris Masone <cmasone@chromium.org>
diff --git a/site_utils/suite_scheduler/task.py b/site_utils/suite_scheduler/task.py
index 4dbc383..1290b49 100644
--- a/site_utils/suite_scheduler/task.py
+++ b/site_utils/suite_scheduler/task.py
@@ -132,7 +132,6 @@
spec.lstrip('>=R'))
else:
self._bare_branches.append(spec)
-
# 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.
@@ -150,9 +149,10 @@
@param branch: the branch to check.
@return True if b 'fits' with stored specs, False otherwise.
"""
- return (branch in self._bare_branches or
- (self._numeric_constraint and
- version.LooseVersion(branch) >= self._numeric_constraint))
+ if branch in BARE_BRANCHES:
+ return branch in self._bare_branches
+ return (self._numeric_constraint and
+ version.LooseVersion(branch) >= self._numeric_constraint)
@property