Ticket #418 (closed defect: fixed)
[patch] Git version testing fails for rc-type version numbers
| Reported by: | marcusl | Owned by: | |
|---|---|---|---|
| Priority: | major | Milestone: | 0.7.10 |
| Version: | 0.7.9 | Keywords: | |
| Cc: | dustin |
Description
My 'git --version' output is currently: git version 1.6.0.2.1172.ga5ed0 which doesn't play nice with test_vc.GitHelper?._capable.
I decided to change the regex to only fetch the first two numbers as follows, and catch and report any exception from the integer conversion:
def _capable(self, v, vcexe): try: m = re.search(r'(d+).(d+)', v) if not m: raise Exception, 'no regex match' ver = tuple([int(num) for num in m.groups()]) if ver < (1, 2): return (False, "Found git (%s) but it is older than 1.2.x" % vcexe) except Exception, e: log.msg("couldn't identify git version number in output:") log.msg("'''%s'''" % v) log.msg("because: %s" % e) log.msg("skipping tests") return (False, "Found git (%s) but couldn't identify its version from '%s'" % (vcexe, v)) # git-1.1.3 (as shipped with Dapper) doesn't understand 'git # init' (it wants 'git init-db'), and fails unit tests that # involve branches. git-1.5.3.6 (on my debian/unstable system) # works. I don't know where the dividing point is: if someone can # figure it out (or figure out how to make buildbot support more # versions), please update this check. self.vcexe = vcexe return (True, None)
Change History
Note: See
TracTickets for help on using
tickets.
![[Buildbot Logo]](/chrome/site/header-text-transparent.png)
committed - thanks!