Skip to content

Commit

Permalink
b2g inbound builds support for mozregression and renaming B2gNighly t…
Browse files Browse the repository at this point in the history
…o B2GNightly
  • Loading branch information
parkouss authored and julien.pages committed Jun 10, 2014
1 parent 218356d commit 62ba14b
Show file tree
Hide file tree
Showing 4 changed files with 44 additions and 16 deletions.
22 changes: 14 additions & 8 deletions mozregression/inboundfinder.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,12 @@ def get_build_base_url(app_name='firefox', bits=mozinfo.bits, os=mozinfo.os):
return "http://inbound-archive.pub.build.mozilla.org/pub/mozilla.org" \
"/mobile/tinderbox-builds/mozilla-inbound-android/"

base_url = 'http://inbound-archive.pub.build.mozilla.org/pub/mozilla.org' \
'/firefox/tinderbox-builds/'
if app_name == 'b2g':
base_url = 'http://ftp.mozilla.org/pub/mozilla.org/b2g'\
'/tinderbox-builds/b2g-inbound-%s_gecko/'
else:
base_url = 'http://inbound-archive.pub.build.mozilla.org/pub' \
'/mozilla.org/firefox/tinderbox-builds/mozilla-inbound-%s/'
if os == "win":
if bits == 64:
# XXX this should actually throw an error to be consumed
Expand All @@ -24,22 +28,24 @@ def get_build_base_url(app_name='firefox', bits=mozinfo.bits, os=mozinfo.os):
" (try specifying --bits=32)"
sys.exit()
else:
return base_url + 'mozilla-inbound-win32/'
return base_url % 'win32'
elif os == "linux":
if bits == 64:
return base_url + 'mozilla-inbound-linux64/'
return base_url % 'linux64'
else:
return base_url + 'mozilla-inbound-linux/'
return base_url % ('linux32' if app_name == 'b2g' else 'linux')
elif os == "mac":
return base_url + 'mozilla-inbound-macosx64/'
return base_url % 'macosx64'


def get_inbound_revisions(start_rev, end_rev, app_name='firefox',
bits=mozinfo.bits, os=mozinfo.os):

revisions = []
r = requests.get('https://hg.mozilla.org/integration/mozilla-inbound/'
'json-pushes?fromchange=%s&tochange=%s' % (start_rev,
url_part = 'b2g' if app_name == 'b2g' else 'mozilla'
r = requests.get('https://hg.mozilla.org/integration/%s-inbound/'
'json-pushes?fromchange=%s&tochange=%s' % (url_part,
start_rev,
end_rev))
pushlog = json.loads(r.content)
for pushid in sorted(pushlog.keys()):
Expand Down
10 changes: 5 additions & 5 deletions mozregression/regression.py
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ def bisect_nightlies(self, good_date, bad_date, skips=0):

if mid_date == bad_date or mid_date == good_date:
print "Got as far as we can go bisecting nightlies..."
if self.appname == 'firefox' or self.appname == 'fennec':
if self.appname in ('firefox', 'fennec', 'b2g'):
self._ensure_metadata(good_date, bad_date)
self.print_range(good_date, bad_date)
print "... attempting to bisect inbound builds (starting " \
Expand Down Expand Up @@ -251,9 +251,9 @@ def cli():
help="command-line arguments to pass to the application",
metavar="ARG1,ARG2", default="")
parser.add_option("-n", "--app", dest="app",
help="application name (firefox, fennec or"
" thunderbird)",
metavar="[firefox|fennec|thunderbird]",
help="application name (firefox, fennec,"
" thunderbird or b2g)",
metavar="[firefox|fennec|thunderbird|b2g]",
default="firefox")
parser.add_option("-r", "--repo", dest="repo_name",
help="repository name on ftp.mozilla.org",
Expand Down Expand Up @@ -281,7 +281,7 @@ def cli():
cmdargs = strsplit(options.cmdargs, ",")

inbound_runner = None
if options.app == "firefox" or options.app == "fennec":
if options.app in ("firefox", "fennec", "b2g"):
inbound_runner = InboundRunner(appname=options.app,
addons=addons,
repo_name=options.repo_name,
Expand Down
24 changes: 23 additions & 1 deletion mozregression/runinbound.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from optparse import OptionParser

from mozregression.runnightly import FennecNightly, FirefoxNightly, \
NightlyRunner, parse_bits
B2GNightly, NightlyRunner, parse_bits
from mozregression.inboundfinder import get_build_base_url
from mozregression.utils import url_links, strsplit, get_date

Expand Down Expand Up @@ -53,12 +53,34 @@ def get_repo_name(self, date):
return "mozilla-inbound"


class B2GInbound(B2GNightly):

repo_name = None

def get_build_url(self, timestamp):
url = "%s%s/" % (get_build_base_url(app_name=self.app_name,
bits=self.bits),
timestamp)
matches = []
for link in url_links(url):
href = link.get("href")
if re.match(self.build_regex, href):
matches.append(url + href)
matches.sort()
return matches[-1] # the most recent build url

def get_repo_name(self, date):
return "mozilla-inbound"


class InboundRunner(NightlyRunner):

def __init__(self, addons=None, appname="firefox", repo_name=None,
profile=None, cmdargs=(), bits=mozinfo.bits, persist=None):
if appname == 'firefox':
self.app = FirefoxInbound(bits=bits, persist=persist)
elif appname == 'b2g':
self.app = B2GInbound(bits=bits, persist=persist)
else:
self.app = FennecInbound(persist=persist)
self.app_name = appname
Expand Down
4 changes: 2 additions & 2 deletions mozregression/runnightly.py
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,7 @@ def get_app_info(self):
return None


class B2gNightly(Nightly):
class B2GNightly(Nightly):
app_name = 'b2g'
name = 'b2g'
profile_class = Profile
Expand All @@ -295,7 +295,7 @@ class NightlyRunner(object):
apps = {'thunderbird': ThunderbirdNightly,
'fennec': FennecNightly,
'firefox': FirefoxNightly,
'b2g': B2gNightly}
'b2g': B2GNightly}

def __init__(self, addons=None, appname="firefox", repo_name=None,
profile=None, cmdargs=(), bits=mozinfo.bits, persist=None):
Expand Down

0 comments on commit 62ba14b

Please sign in to comment.