Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

merge default -> production

--HG--
branch : production-0.8
  • Loading branch information...
commit 4a7a3dbbf7d9946cb9b17e3bd827aba5b253b6cf 2 parents 3adc968 + eb64714
Aki Sasaki escapewindow authored
31 bin/l10n-stage/README
View
@@ -1,31 +0,0 @@
-The scripts
-
-create-stage,
-create-buildbot, and
-botmaster
-
-provide help in setting up and running a testing environment for how we
-schedule l10n builds.
-
-Use create-stage to create the required repos as well as one en-US and
-four l10n dummy repositories. Those will already have an initial push in
-the pushlog database. The repositories are in the repos directory.
-
-Clones to work on these and to then push changes are in the workdir directory
-tree. When pushing, you need to make sure that mozhghooks in
-repos/hghooks is in your PYTHONPATH.
-
-create-buildbot sets up a master and a number of slaves for each of the
-three platforms. The master is set up to have en-US dep builds, nightlies,
-and l10n builds, with build properties depending on whether it's an en-US
-change-triggered build, l10n triggered or nightly.
-
-Last but not least, botmaster offers start and stop commands to start and
-stop the master and all slaves.
-
-All commands take the staging dir as argument.
-
-After creating the hg repositories, you want to set up a
-hg serve -p 8080 --webdir-conf webdir.conf
-in the staging dir, that will offer the repositories on the localhost.
-Make sure to map the port here with what you specify in create-buildbot.
24 bin/l10n-stage/botmaster
View
@@ -1,24 +0,0 @@
-#!/usr/bin/env python
-
-from optparse import OptionParser
-import os
-import subprocess
-
-if __name__ == "__main__":
- p = OptionParser()
- (options, args) = p.parse_args()
-
- dest = args[1]
- command = args[0]
-
- for d in sorted(os.listdir(dest)):
- dir = os.path.join(dest, d)
- pid = os.path.join(dir, 'twistd.pid')
- if command == 'start':
- if os.path.isfile(pid):
- subprocess.call(['buildbot', 'restart', dir])
- else:
- subprocess.call(['buildbot', 'start', dir])
- if command == 'stop':
- if os.path.isfile(pid):
- subprocess.call(['buildbot', 'stop', dir])
251 bin/l10n-stage/create-buildbot
View
@@ -1,251 +0,0 @@
-#!/usr/bin/env python
-
-from optparse import OptionParser
-import os
-import subprocess
-
-master_cfg = '''c = BuildmasterConfig = {}
-from buildbot.buildslave import BuildSlave
-from buildbot import locks, manhole, scheduler
-from buildbot.process import factory
-from buildbot.steps.dummy import Dummy
-from buildbot.status import html
-
-from twisted.internet import reactor
-
-from buildbotcustom.l10n import Scheduler, NightlyL10n
-from buildbotcustom.changes.hgpoller import HgAllLocalesPoller, HgPoller
-
-from twisted.web.client import HTTPClientFactory
-HTTPClientFactory.noisy = False
-
-c['slaves'] = [
-%(slaves)s
- ]
-
-c['slavePortnum'] = %(port)s
-
-hga = HgAllLocalesPoller('http://localhost:%(hg_port)s/',
- 'l10n', pollInterval = 60)
-hga.parallelRequests = 1
-c['change_source'] = [
- hga,
- HgPoller('http://localhost:%(hg_port)s/', 'mozilla',
- pollInterval = 90)
-]
-
-c['schedulers'] = [
- Scheduler('l10n', 'l10nbuilds.ini'),
- NightlyL10n('l10n nightly',
- ['Firefox test linux', 'Firefox test mac',
- 'Firefox test win'],
- 'hg',
- repo='http://localhost:%(hg_port)s/',
- branch='mozilla',
- localesFile='browser/locales/all-locales',
- minute=5),
- scheduler.Scheduler('enUS dep', 'mozilla', 30,
- ['Linux mozilla build',
- 'OS X 10.5.2 mozilla build',
- 'WINNT 5.2 mozilla build']),
- scheduler.Nightly('enUS nightly',
- ['Linux mozilla nightly',
- 'OS X 10.5.2 mozilla nightly',
- 'WINNT 5.2 mozilla nightly'])
-]
-
-bigSlaveLock = locks.SlaveLock("bigSlaveLock")
-
-f = factory.BuildFactory()
-class L10nReporter(Dummy):
- def start(self):
- p = self.step_status.build.getProperties()
- desc = [p['locale']]
- if p.has_key('tree'):
- desc += [p['tree'], p['app']]
- self.desc = desc
- if p.has_key('compareOnly'):
- desc.append('compareOnly')
- if p.has_key('nightly'):
- desc.append('nightly')
- desc.append('building')
- desc.append('on %%s' %% p['slavename'])
- self.step_status.setText(desc)
- self.desc = desc[:]
- timeout = self.timeout
- if 'win' in p['buildername'].lower():
- timeout *= 3
- if 'mac' in p['buildername'].lower():
- timeout *= 2
- self.timer = reactor.callLater(timeout, self.done)
- def done(self):
- self.desc[-2] = 'built'
- self.step_status.setText(self.desc)
- Dummy.done(self)
-
-f.addStep(L10nReporter(timeout=2, name='l10nstep'))
-
-enBuild = factory.BuildFactory()
-class EnBuildStep(Dummy):
- def start(self):
- p = self.step_status.build.getProperties()
- desc = ['en-US', 'building',
- 'on %%s' %% p['slavename']]
- self.desc = desc[:]
- self.step_status.setText(desc)
- timeout = self.timeout
- if 'win' in p['buildername'].lower():
- timeout *= 3
- if 'os x' in p['buildername'].lower():
- timeout *= 2
- self.timer = reactor.callLater(timeout, self.done)
- def done(self):
- self.desc[1] = 'built'
- self.step_status.setText(self.desc)
- Dummy.done(self)
-
-enBuild.addStep(EnBuildStep(timeout=15, name='enstep'))
-
-enNightly = factory.BuildFactory()
-enNightly.addStep(EnBuildStep(timeout=15, name='enstep'))
-
-c['builders'] = [
- {'name': 'Firefox test linux',
- 'slavenames': [%(slaves_linux)s],
- 'builddir': 'fx_test_linux',
- 'factory': f,
- 'category': 'l10n',
- 'locks': [bigSlaveLock]},
- {'name': 'Linux mozilla build',
- 'slavenames': [%(slaves_linux)s],
- 'builddir': 'fx_en_linux',
- 'factory': enBuild,
- 'category': 'mozilla',
- 'locks': [bigSlaveLock]},
- {'name': 'Linux mozilla nightly',
- 'slavenames': [%(slaves_linux)s],
- 'builddir': 'fx_en_nightly_linux',
- 'factory': enNightly,
- 'category': 'mozilla',
- 'locks': [bigSlaveLock]},
- {'name': 'Firefox test mac',
- 'slavenames': [%(slaves_mac)s],
- 'builddir': 'fx_test_mac',
- 'factory': f,
- 'category': 'l10n',
- 'locks': [bigSlaveLock]},
- {'name': 'OS X 10.5.2 mozilla build',
- 'slavenames': [%(slaves_mac)s],
- 'builddir': 'fx_en_mac',
- 'factory': enBuild,
- 'category': 'mozilla',
- 'locks': [bigSlaveLock]},
- {'name': 'OS X 10.5.2 mozilla nightly',
- 'slavenames': [%(slaves_mac)s],
- 'builddir': 'fx_en_nightly_mac',
- 'factory': enNightly,
- 'category': 'mozilla',
- 'locks': [bigSlaveLock]},
- {'name': 'Firefox test win',
- 'slavenames': [%(slaves_win)s],
- 'builddir': 'fx_test_win',
- 'factory': f,
- 'category': 'l10n',
- 'locks': [bigSlaveLock]},
- {'name': 'WINNT 5.2 mozilla build',
- 'slavenames': [%(slaves_win)s],
- 'builddir': 'fx_en_win',
- 'factory': enBuild,
- 'category': 'mozilla',
- 'locks': [bigSlaveLock]},
- {'name': 'WINNT 5.2 mozilla nightly',
- 'slavenames': [%(slaves_win)s],
- 'builddir': 'fx_en_nightly_win',
- 'factory': enNightly,
- 'category': 'mozilla',
- 'locks': [bigSlaveLock]},
- ]
-
-c['manhole'] = manhole.TelnetManhole(%(telnet_port)s, "%(telnet_user)s",
- "%(telnet_pass)s")
-
-c['status'] = []
-
-c['status'].append(html.WebStatus(http_port=%(http_port)s,
- allowForce=True))
-c['buildbotURL'] = 'http://localhost:%(http_port)s/'
-c['projectName'] = 'l10n testbed'
-'''
-
-l10nini = '''[fx]
-app = browser
-type = hg
-locales = all
-mozilla = mozilla
-l10n = l10n
-repo = http://localhost:%(hgport)s/
-l10n.ini = browser/locales/l10n.ini
-builders = Firefox\ test\ linux Firefox\ test\ mac Firefox\ test\ win
-'''
-
-def createMaster(dest, opts):
- if os.path.isdir(dest):
- raise RuntimeError("Upgrading not supported")
- os.makedirs(dest)
- rv = subprocess.call(['buildbot', 'create-master', 'master'],
- cwd=dest)
- if rv:
- raise RuntimeError('creation of master failed')
- l_s = ['"sl%d"' % i for i in xrange(opts.slaves)]
- m_s = ['"sm%d"' % i for i in xrange(opts.slaves)]
- w_s = ['"sw%d"' % i for i in xrange(opts.slaves)]
- def formatSlave(s):
- return ' BuildSlave(%s, "pwd"),\n' % s
- open(os.path.join(dest, 'master', 'master.cfg'),
- 'w').write(master_cfg % {
- 'slaves': ''.join(map(formatSlave, l_s + m_s + w_s)),
- 'slaves_linux': ','.join(l_s),
- 'slaves_mac': ','.join(m_s),
- 'slaves_win': ','.join(w_s),
- 'port': options.port,
- 'http_port': options.http_port,
- 'hg_port': options.hg_port,
- 'telnet_port': options.telnet_port,
- 'telnet_user': options.telnet_user,
- 'telnet_pass': options.telnet_pass,
- })
- open(os.path.join(dest, 'master', 'l10nbuilds.ini'),
- 'w').write(l10nini % {'hgport': opts.hg_port})
-
-def createSlave(dest, name, opts):
- if os.path.isdir(os.path.join(dest, name)):
- return
- rv = subprocess.call(['buildbot', 'create-slave', name,
- 'localhost:%s' % opts.port,
- name, 'pwd'],
- cwd=dest)
- if rv:
- raise RuntimeError('creation of master failed')
-
-
-if __name__ == "__main__":
- p = OptionParser()
- p.add_option('-v', dest='verbose', action='store_true')
- p.add_option('-p', '--port', default='9876')
- p.add_option('-q', '--http-port', dest='http_port',
- default='8010')
- p.add_option('-g', '--hg-port', dest='hg_port',
- default='8000')
- p.add_option('-n', '--slaves', type='int', default=3)
- p.add_option('--telnet-port', dest='telnet_port', default='9875')
- p.add_option('--telnet-user', dest='telnet_user', default='god')
- p.add_option('--telnet-pass', dest='telnet_pass', default='knows')
- (options, args) = p.parse_args()
-
- dest = args[0]
-
- createMaster(dest, options)
- for i in xrange(options.slaves):
- createSlave(dest, "sl%d" % i, options)
- createSlave(dest, "sm%d" % i, options)
- createSlave(dest, "sw%d" % i, options)
142 bin/l10n-stage/create-stage
View
@@ -1,142 +0,0 @@
-#!/usr/bin/env python
-
-from optparse import OptionParser
-import os
-import subprocess
-
-repos = (
- 'http://hg.mozilla.org/users/bsmedberg_mozilla.com/hghooks/',
- 'http://hg.mozilla.org/users/bsmedberg_mozilla.com/hgpoller/',
- 'http://hg.mozilla.org/hg_templates/',
- )
-
-downstreams = (
- 'mozilla',
- 'l10n/ab',
- 'l10n/de',
- 'l10n/ja-JP-mac',
- 'l10n/x-testing',
- )
-
-def ensureUpstreamRepo(r, dest):
- base = os.path.join(dest, 'repos')
- if not os.path.isdir(base):
- os.makedirs(base)
- leaf = r.rsplit('/', 2)[1]
- if os.path.isdir(os.path.join(base, leaf, '.hg')):
- return
- rv = subprocess.call(['hg', 'clone', r], cwd = base)
- if rv:
- raise RuntimeError('hg failed to clone %s' % leaf)
-
-
-def ensureRepo(leaf, dest, push_l10n=True):
- base = os.path.join(dest, 'repos')
- if not os.path.isdir(base):
- os.makedirs(base)
- if os.path.isdir(os.path.join(base, leaf)):
- return
-
- os.makedirs(os.path.join(base, leaf))
- rv = subprocess.call(['hg', 'init', leaf], cwd = base)
- if rv:
- raise RuntimeError('Couldnt hg init %s' % leaf)
- tail = '''
-[hooks]
-pretxnchangegroup.a_singlehead = python:mozhghooks.single_head_per_branch.hook
-pretxnchangegroup.z_linearhistory = python:mozhghooks.pushlog.log
-
-[extensions]
-pushlog-feed = %(dest)s/repos/hgpoller/pushlog-feed.py
-buglink = %(dest)s/repos/hgpoller/buglink.py
-hgwebjson = %(dest)s/repos/hgpoller/hgwebjson.py
-
-[web]
-style = gitweb_mozilla
-templates = %(dest)s/repos/hg_templates
-'''
- hgrc = open(os.path.join(base, leaf, '.hg', 'hgrc'), 'a')
- hgrc.write(tail % {'dest': os.path.abspath(dest)})
- hgrc.close()
-
- rv = subprocess.call(['hg', 'clone', leaf,
- os.path.join('..', 'workdir', leaf)],
- cwd=base)
- if rv:
- raise RuntimeError('clone for %s failed' % leaf)
- browserdir = os.path.join(dest, 'workdir', leaf, 'browser')
- if leaf.startswith('l10n'):
- # create initial content for l10n
- os.makedirs(browserdir)
- open(os.path.join(browserdir, 'file.properties'),
- 'w').write('''k_e_y: %s value
-''' % leaf)
- else:
- # create initial content for mozilla
- os.makedirs(os.path.join(browserdir, 'locales', 'en-US'))
- open(os.path.join(browserdir, 'locales', 'en-US', 'file.properties'),
- 'w').write('''k_e_y: en-US value
-''')
- open(os.path.join(browserdir, 'locales', 'all-locales'),
- 'w').write('''ab
-de
-ja-JP-mac
-x-testing
-''')
- open(os.path.join(browserdir, 'locales', 'l10n.ini'),
- 'w').write('''[general]
-depth = ../..
-all = browser/locales/all-locales
-
-[compare]
-dirs = browser
-''')
- env = dict(os.environ)
- if 'PYTHONPATH' in env:
- env['PYTHONPATH'] += ':%s/hghooks' % os.path.abspath(base)
- else:
- env['PYTHONPATH'] = '%s/hghooks' % os.path.abspath(base)
- rv = subprocess.call(['hg', 'add', '.'], cwd=browserdir)
- if rv:
- raise RuntimeError('failed to add initial content')
- rv = subprocess.call(['hg', 'ci', '-mInitial commit for %s' % leaf],
- cwd=browserdir)
- if rv:
- raise RuntimeError('failed to check in initian content to %s' %
- leaf)
- if leaf.startswith('l10n') and not push_l10n:
- return
- rv = subprocess.call(['hg', 'push'], cwd=browserdir, env=env)
- if rv:
- raise RuntimeError('failed to push to %s' % leaf)
-
-
-def createWebDir(dest, port):
- content = '''[collections]
-repos = repos
-'''
- if not os.path.isfile(os.path.join(dest, 'webdir.conf')):
- open(os.path.join(dest, 'webdir.conf'),
- 'w').write(content % {'port': port,
- 'dest': os.path.abspath(dest)})
-
-if __name__ == "__main__":
- p = OptionParser()
- p.add_option('-v', dest='verbose', action='store_true')
- p.add_option('-p', '--port', default='8000')
- p.add_option('-l', '--no-locales', action='store_true', default=False)
- (options, args) = p.parse_args()
-
- dest = args[0]
-
- if not os.path.isdir(os.path.join(dest, 'workdir', 'l10n')):
- os.makedirs(os.path.join(dest, 'workdir', 'l10n'))
-
- for r in repos:
- ensureUpstreamRepo(r, dest)
-
-
- for l in downstreams:
- ensureRepo(l, dest, push_l10n=not options.no_locales)
-
- createWebDir(dest, options.port)
115 misc.py
View
@@ -47,10 +47,9 @@
from buildbotcustom.common import reallyShort
from buildbotcustom.changes.hgpoller import HgPoller, HgAllLocalesPoller
from buildbotcustom.process.factory import NightlyBuildFactory, \
- NightlyRepackFactory, UnittestBuildFactory, CodeCoverageFactory, \
- UnittestPackagedBuildFactory, TalosFactory, CCNightlyBuildFactory, \
- CCNightlyRepackFactory, CCUnittestBuildFactory, TryBuildFactory, \
- TryUnittestBuildFactory, ScriptFactory, rc_eval_func
+ NightlyRepackFactory, UnittestPackagedBuildFactory, TalosFactory, \
+ CCNightlyBuildFactory, CCNightlyRepackFactory, CCUnittestBuildFactory, \
+ TryBuildFactory, ScriptFactory, rc_eval_func
from buildbotcustom.process.factory import RemoteUnittestFactory
from buildbotcustom.scheduler import MultiScheduler, BuilderChooserScheduler, \
PersistentScheduler, makePropertiesScheduler, SpecificNightly
@@ -622,14 +621,6 @@ def generateBranchObjects(config, name, secrets=None):
if config['enable_valgrind'] and \
platform in config['valgrind_platforms']:
nightlyBuilders.append('%s valgrind' % base_name)
- # Regular unittest builds
- if pf.get('enable_unittests'):
- unittestBuilders.append('%s unit test' % base_name)
- test_builders = []
- for suites_name, suites in config['unittest_suites']:
- test_builders.extend(generateTestBuilderNames('%s test' % base_name, suites_name, suites))
- unittestPrettyNames[platform] = '%s test' % base_name
- triggeredUnittestBuilders.append(('%s-%s-unittest' % (name, platform), test_builders, config.get('enable_merging', True)))
# Optimized unittest builds
if pf.get('enable_opt_unittests'):
test_builders = []
@@ -637,8 +628,6 @@ def generateBranchObjects(config, name, secrets=None):
unittestPrettyNames[platform] = '%s opt test' % base_name
test_builders.extend(generateTestBuilderNames('%s opt test' % base_name, suites_name, suites))
triggeredUnittestBuilders.append(('%s-%s-opt-unittest' % (name, platform), test_builders, config.get('enable_merging', True)))
- if config['enable_codecoverage'] and platform in ('linux',):
- coverageBuilders.append('%s code coverage' % base_name)
if config.get('enable_blocklist_update', False) and platform in ('linux',):
weeklyBuilders.append('%s blocklist update' % base_name)
if pf.get('enable_xulrunner', config['enable_xulrunner']):
@@ -1561,62 +1550,6 @@ def generateBranchObjects(config, name, secrets=None):
}
branchObjects['builders'].append(mozilla2_l10n_dep_builder)
- if pf.get('enable_unittests'):
- runA11y = True
- if platform.startswith('macosx'):
- runA11y = config['enable_mac_a11y']
-
- extra_args = {}
- if config.get('enable_try'):
- factory_class = TryUnittestBuildFactory
- extra_args['branchName'] = name
- else:
- factory_class = UnittestBuildFactory
-
- if config.get('mozilla_dir'):
- extra_args['mozillaDir'] = config['mozilla_dir']
-
- unittest_factory = factory_class(
- env=pf.get('unittest-env', {}),
- platform=platform,
- productName=pf['product_name'],
- config_repo_path=config['config_repo_path'],
- config_dir=config['config_subdir'],
- objdir=config['objdir_unittests'],
- hgHost=config['hghost'],
- repoPath=config['repo_path'],
- buildToolsRepoPath=config['build_tools_repo_path'],
- buildSpace=config['unittest_build_space'],
- clobberURL=config['base_clobber_url'],
- clobberTime=clobberTime,
- buildsBeforeReboot=pf['builds_before_reboot'],
- run_a11y=runA11y,
- mochitest_leak_threshold=mochitestLeakThreshold,
- crashtest_leak_threshold=crashtestLeakThreshold,
- stageServer=config['stage_server'],
- stageUsername=config['stage_username'],
- stageSshKey=config['stage_ssh_key'],
- unittestMasters=config['unittest_masters'],
- unittestBranch="%s-%s-unittest" % (name, platform),
- uploadPackages=True,
- **extra_args
- )
- unittest_builder = {
- 'name': '%s unit test' % pf['base_name'],
- 'slavenames': pf['slaves'],
- 'builddir': '%s-%s-unittest' % (name, platform),
- 'slavebuilddir': reallyShort('%s-%s-unittest' % (name, platform), pf['stage_product']),
- 'factory': unittest_factory,
- 'category': name,
- 'nextSlave': _nextFastSlave,
- 'properties': {'branch': name,
- 'platform': platform,
- 'stage_platform': stage_platform,
- 'product': pf['stage_product'],
- 'slavebuilddir': reallyShort('%s-%s-unittest' % (name, platform), pf['stage_product'])},
- }
- branchObjects['builders'].append(unittest_builder)
-
for suites_name, suites in config['unittest_suites']:
runA11y = True
if platform.startswith('macosx'):
@@ -1628,14 +1561,6 @@ def generateBranchObjects(config, name, secrets=None):
suites = suites[:]
suites.remove('mochitest-a11y')
- if pf.get('enable_unittests'):
- branchObjects['builders'].extend(generateTestBuilder(
- config, name, platform, "%s test" % pf['base_name'],
- "%s-%s-unittest" % (name, platform),
- suites_name, suites, mochitestLeakThreshold,
- crashtestLeakThreshold, stagePlatform=stage_platform,
- stageProduct=pf['stage_product']))
-
# Remove mochitest-a11y from other types of builds, since they're not
# built with a11y enabled
if platform.startswith("macosx") and 'mochitest-a11y' in suites:
@@ -1651,40 +1576,6 @@ def generateBranchObjects(config, name, secrets=None):
crashtestLeakThreshold, stagePlatform=stage_platform,
stageProduct=pf['stage_product']))
- if config['enable_codecoverage']:
- # We only do code coverage builds on linux right now
- if platform == 'linux':
- codecoverage_factory = CodeCoverageFactory(
- platform=platform,
- productName=pf['product_name'],
- config_repo_path=config['config_repo_path'],
- config_dir=config['config_subdir'],
- objdir=config['objdir_unittests'],
- hgHost=config['hghost'],
- repoPath=config['repo_path'],
- buildToolsRepoPath=config['build_tools_repo_path'],
- buildSpace=7,
- clobberURL=config['base_clobber_url'],
- clobberTime=clobberTime,
- buildsBeforeReboot=pf['builds_before_reboot'],
- mochitest_leak_threshold=mochitestLeakThreshold,
- crashtest_leak_threshold=crashtestLeakThreshold,
- stageServer=config['stage_server'],
- stageUsername=config['stage_username'],
- stageSshKey=config['stage_ssh_key'],
- )
- codecoverage_builder = {
- 'name': '%s code coverage' % pf['base_name'],
- 'slavenames': pf['slaves'],
- 'builddir': '%s-%s-codecoverage' % (name, platform),
- 'slavebuilddir': reallyShort('%s-%s-codecoverage' % (name, platform), pf['stage_product']),
- 'factory': codecoverage_factory,
- 'category': name,
- 'nextSlave': _nextSlowSlave,
- 'properties': {'branch': name, 'product': pf['stage_product'], 'platform': platform, 'slavebuilddir': reallyShort('%s-%s-codecoverage' % (name, platform), pf['stage_product'])},
- }
- branchObjects['builders'].append(codecoverage_builder)
-
if config.get('enable_blocklist_update', False):
if platform == 'linux':
blocklistBuilder = generateBlocklistBuilder(config, name, platform, pf['base_name'], pf['slaves'])
393 process/factory.py
View
@@ -4326,282 +4326,6 @@ def __init__(self, username, sshKey, repositories, userRepoRoot,
))
-
-class ReleaseTaggingFactory(ReleaseFactory):
- def __init__(self, repositories, productName, appName, version, appVersion,
- milestone, baseTag, buildNumber, hgUsername, hgSshKey=None,
- relbranchPrefix=None, buildSpace=1.5, **kwargs):
- """Repositories looks like this:
- repositories[name]['revision']: changeset# or tag
- repositories[name]['relbranchOverride']: branch name
- repositories[name]['bumpFiles']: [filesToBump]
- eg:
- repositories['http://hg.mozilla.org/mozilla-central']['revision']:
- d6a0a4fca081
- repositories['http://hg.mozilla.org/mozilla-central']['relbranchOverride']:
- GECKO191_20080828_RELBRANCH
- repositories['http://hg.mozilla.org/mozilla-central']['bumpFiles']:
- ['client.mk', 'browser/config/version.txt',
- 'js/src/config/milestone.txt', 'config/milestone.txt']
- relbranchOverride is typically used in two situations:
- 1) During a respin (buildNumber > 1) when the "release" branch has
- already been created (during build1). In cases like this all
- repositories should have the relbranch specified
- 2) During non-Firefox builds. Because Seamonkey, Thunderbird, etc.
- are releases off of the same platform code as Firefox, the
- "release branch" will already exist in mozilla-central but not
- comm-central, mobile-browser, domi, etc. In cases like this,
- mozilla-central and l10n should be specified with a
- relbranchOverride and the other source repositories should NOT
- specify one.
- productName: The name of the actual *product* being shipped.
- Examples include: firefox, thunderbird, seamonkey.
- This is only used for the automated check-in message
- the version bump generates.
- appName: The "application" name (NOT product name). Examples:
- browser, suite, mailnews. It is used in version bumping
- code and assumed to be a subdirectory of the source
- repository being bumped. Eg, for Firefox, appName should be
- 'browser', which is a subdirectory of 'mozilla-central'.
- For Thunderbird, it would be 'mailnews', a subdirectory
- of 'comm-central'.
- version: What this build is actually called. I most cases this is
- the version number of the application, eg, 3.0.6, 3.1b2.
- During the RC phase we "call" builds, eg, 3.1 RC1, but the
- version of the application is still 3.1. In these cases,
- version should be set to, eg, 3.1rc1.
- appVersion: The current version number of the application being
- built. Eg, 3.0.2 for Firefox, 2.0 for Seamonkey, etc.
- This is different than the platform version. See below.
- This is usually the same as 'version', except during the
- RC phase. Eg, when version is 3.1rc1 appVersion is still
- 3.1.
- milestone: The current version of *Gecko*. This is generally
- along the lines of: 1.8.1.14, 1.9.0.2, etc.
- baseTag: The prefix to use for BUILD/RELEASE tags. It will be
- post-fixed with _BUILD$buildNumber and _RELEASE. Generally,
- this is something like: FIREFOX_3_0_2.
- buildNumber: The current build number. If this is the first time
- attempting a release this is 1. Other times it may be
- higher. It is used for post-fixing tags and some
- internal logic.
- hgUsername: The username to use when pushing changes to the remote
- repository.
- hgSshKey: The full path to the ssh key to use (if necessary) when
- pushing changes to the remote repository.
- relbranchPrefix: the prefix to start relelease branch names with
- (defaults to 'GECKO')
-
- """
- # MozillaBuildFactory needs the 'repoPath' argument, but we don't
- ReleaseFactory.__init__(self, repoPath='nothing', buildSpace=buildSpace,
- **kwargs)
-
- # extremely basic validation, to catch really dumb configurations
- assert len(repositories) > 0, \
- 'You must provide at least one repository.'
- assert productName, 'You must provide a product name (eg. firefox).'
- assert appName, 'You must provide an application name (eg. browser).'
- assert version, \
- 'You must provide an application version (eg. 3.0.2).'
- assert milestone, 'You must provide a milestone (eg. 1.9.0.2).'
- assert baseTag, 'You must provide a baseTag (eg. FIREFOX_3_0_2).'
- assert buildNumber, 'You must provide a buildNumber.'
-
- # if we're doing a respin we already have a relbranch created
- if buildNumber > 1:
- for repo in repositories:
- assert repositories[repo]['relbranchOverride'], \
- 'No relbranchOverride specified for ' + repo + \
- '. You must provide a relbranchOverride when buildNumber > 1'
-
- # now, down to work
- self.buildTag = '%s_BUILD%s' % (baseTag, str(buildNumber))
- self.releaseTag = '%s_RELEASE' % baseTag
-
- # generate the release branch name, which is based on the
- # version and the current date.
- # looks like: GECKO191_20080728_RELBRANCH
- # This can be overridden per-repository. This case is handled
- # in the loop below
- if not relbranchPrefix:
- relbranchPrefix = 'GECKO'
- relbranchName = '%s%s_%s_RELBRANCH' % (
- relbranchPrefix, milestone.replace('.', ''),
- datetime.now().strftime('%Y%m%d'))
-
- for repoPath in sorted(repositories.keys()):
- repoName = self.getRepoName(repoPath)
- repo = self.getRepository(repoPath)
- pushRepo = self.getRepository(repoPath, push=True)
-
- sshKeyOption = self.getSshKeyOption(hgSshKey)
-
- repoRevision = repositories[repoPath]['revision']
- bumpFiles = repositories[repoPath]['bumpFiles']
-
- # use repo-specific variable so that a changed name doesn't
- # propagate to later repos without an override
- relbranchOverride = False
- if repositories[repoPath]['relbranchOverride']:
- relbranchOverride = True
- repoRelbranchName = repositories[repoPath]['relbranchOverride']
- else:
- repoRelbranchName = relbranchName
-
- # For l10n we never bump any files, so this will never get
- # overridden. For source repos, we will do a version bump in build1
- # which we commit, and set this property again, so we tag
- # the right revision. For build2, we don't version bump, and this
- # will not get overridden
- self.addStep(SetBuildProperty(
- property_name="%s-revision" % repoName,
- value=repoRevision,
- haltOnFailure=True
- ))
- # 'hg clone -r' breaks in the respin case because the cloned
- # repository will not have ANY changesets from the release branch
- # and 'hg up -C' will fail
- self.addStep(MercurialCloneCommand(
- name='hg_clone',
- command=['hg', 'clone', repo, repoName],
- workdir='.',
- description=['clone %s' % repoName],
- haltOnFailure=True,
- timeout=30*60 # 30 minutes
- ))
- # for build1 we need to create a branch
- if buildNumber == 1 and not relbranchOverride:
- # remember:
- # 'branch' in Mercurial does not actually create a new branch,
- # it switches the "current" branch to the one of the given name.
- # when buildNumber == 1 this will end up creating a new branch
- # when we commit version bumps and tags.
- # note: we don't actually have to switch to the release branch
- # to create tags, but it seems like a more sensible place to
- # have those commits
- self.addStep(ShellCommand(
- name='hg_update',
- command=['hg', 'up', '-C', '-r',
- WithProperties('%s', '%s-revision' % repoName)],
- workdir=repoName,
- description=['update', repoName],
- haltOnFailure=True
- ))
-
- self.addStep(SetProperty(
- command=['sh', '-c', 'hg branches | grep %s | wc -l' % repoRelbranchName],
- property='branch_match_count',
- workdir=repoName,
- haltOnFailure=True,
- ))
-
- self.addStep(ShellCommand(
- name='hg_branch',
- command=['hg', 'branch', repoRelbranchName],
- workdir=repoName,
- description=['branch %s' % repoName],
- doStepIf=lambda step: int(step.getProperty('branch_match_count')) == 0,
- haltOnFailure=True
- ))
-
- self.addStep(ShellCommand(
- name='switch_branch',
- command=['hg', 'up', '-C', repoRelbranchName],
- workdir=repoName,
- description=['switch to', repoRelbranchName],
- doStepIf=lambda step: int(step.getProperty('branch_match_count')) > 0,
- haltOnFailure=True
- ))
- # if buildNumber > 1 we need to switch to it with 'hg up -C'
- else:
- self.addStep(ShellCommand(
- name='switch_branch',
- command=['hg', 'up', '-C', repoRelbranchName],
- workdir=repoName,
- description=['switch to', repoRelbranchName],
- haltOnFailure=True
- ))
- # we don't need to do any version bumping if this is a respin
- if buildNumber == 1 and len(bumpFiles) > 0:
- command = ['perl', 'tools/scripts/release/version-bump.pl',
- '-w', repoName, '-a', appName,
- '-v', appVersion, '-m', milestone]
- command.extend(bumpFiles)
- self.addStep(ShellCommand(
- name='bump',
- command=command,
- workdir='.',
- description=['bump %s' % repoName],
- haltOnFailure=True
- ))
- self.addStep(ShellCommand(
- name='hg_diff',
- command=['hg', 'diff'],
- workdir=repoName
- ))
- self.addStep(ShellCommand(
- # mozilla-central and other developer repositories have a
- # 'CLOSED TREE' or 'APPROVAL REQUIRED' hook on them which
- # rejects commits when the tree is declared closed/approval
- # required. It is very common for us to tag
- # and branch when the tree is in this state. Adding the
- # 'CLOSED TREE a=release' string at the end will force the
- # hook to let us commit regardless of the tree state.
- name='hg_commit',
- command=['hg', 'commit', '-u', hgUsername, '-m',
- 'Automated checkin: version bump remove "pre" ' + \
- ' from version number for ' + productName + ' ' + \
- version + ' release on ' + repoRelbranchName + ' ' + \
- 'CLOSED TREE a=release'],
- workdir=repoName,
- description=['commit %s' % repoName],
- haltOnFailure=True
- ))
- self.addStep(SetProperty(
- command=['hg', 'identify', '-i'],
- property='%s-revision' % repoName,
- workdir=repoName,
- haltOnFailure=True
- ))
- for tag in (self.buildTag, self.releaseTag):
- self.addStep(ShellCommand(
- name='hg_tag',
- command=['hg', 'tag', '-u', hgUsername, '-f', '-r',
- WithProperties('%s', '%s-revision' % repoName),
- '-m',
- # This part is pretty ugly. Because we need both
- # WithProperties interpolation (for repoName-revision)
- # and regular variables we need to piece it together
- # this way.
- WithProperties('Added tag ' + tag + \
- ' for changeset ' + \
- '%(' + repoName + '-revision' + ')s. ' + \
- 'CLOSED TREE a=release'),
- tag],
- workdir=repoName,
- description=['tag %s' % repoName],
- haltOnFailure=True
- ))
- self.addStep(ShellCommand(
- name='hg_out',
- command=['hg', 'out', '-e',
- 'ssh -l %s %s' % (hgUsername, sshKeyOption),
- pushRepo],
- workdir=repoName,
- description=['hg out', repoName]
- ))
- self.addStep(ShellCommand(
- name='hg_push',
- command=['hg', 'push', '-e',
- 'ssh -l %s %s' % (hgUsername, sshKeyOption),
- '-f', pushRepo],
- workdir=repoName,
- description=['push %s' % repoName],
- haltOnFailure=True
- ))
-
-
class SingleSourceFactory(ReleaseFactory):
def __init__(self, productName, version, baseTag, stagingServer,
stageUsername, stageSshKey, buildNumber, mozconfig,
@@ -4751,123 +4475,6 @@ def addConfigSteps(self, workdir='build'):
workdir=workdir
))
-class MultiSourceFactory(ReleaseFactory):
- """You need to pass in a repoConfig, which will be a list that
- looks like this:
- repoConfig = [{
- 'repoPath': repoPath,
- 'location': branchName,
- 'bundleName': '%s-%s.bundle' % (productName, version)
- }]"""
- def __init__(self, productName, version, baseTag, stagingServer,
- stageUsername, stageSshKey, buildNumber, autoconfDirs=['.'],
- buildSpace=1, repoConfig=None, uploadProductName=None,
- stageNightlyDir="nightly", **kwargs):
- ReleaseFactory.__init__(self, buildSpace=buildSpace, **kwargs)
- releaseTag = '%s_RELEASE' % (baseTag)
- bundleFiles = []
- sourceTarball = 'source/%s-%s.source.tar.bz2' % (productName,
- version)
- if not uploadProductName:
- uploadProductName = productName
-
- assert repoConfig
- # '-c' is for "release to candidates dir"
- postUploadCmd = 'post_upload.py -p %s -v %s -n %s -c --nightly-dir %s' % \
- (uploadProductName, version, buildNumber, stageNightlyDir)
- uploadEnv = {'UPLOAD_HOST': stagingServer,
- 'UPLOAD_USER': stageUsername,
- 'UPLOAD_SSH_KEY': '~/.ssh/%s' % stageSshKey,
- 'UPLOAD_TO_TEMP': '1',
- 'POST_UPLOAD_CMD': postUploadCmd}
-
- self.addStep(ShellCommand(
- name='rm_srcdir',
- command=['rm', '-rf', 'source'],
- workdir='.',
- haltOnFailure=True
- ))
- self.addStep(ShellCommand(
- name='make_srcdir',
- command=['mkdir', 'source'],
- workdir='.',
- haltOnFailure=True
- ))
- for repo in repoConfig:
- repository = self.getRepository(repo['repoPath'])
- location = repo['location']
- bundleFiles.append('source/%s' % repo['bundleName'])
-
- self.addStep(MercurialCloneCommand(
- name='hg_clone',
- command=['hg', 'clone', repository, location],
- workdir='.',
- description=['clone %s' % location],
- haltOnFailure=True,
- timeout=30*60 # 30 minutes
- ))
- # This will get us to the version we're building the release with
- self.addStep(ShellCommand(
- name='hg_update',
- command=['hg', 'up', '-C', '-r', releaseTag],
- workdir=location,
- description=['update to', releaseTag],
- haltOnFailure=True
- ))
- # ...And this will get us the tags so people can do things like
- # 'hg up -r FIREFOX_3_1b1_RELEASE' with the bundle
- self.addStep(ShellCommand(
- name='hg_update_incl_tags',
- command=['hg', 'up', '-C'],
- workdir=location,
- description=['update to', 'include tag revs'],
- haltOnFailure=True
- ))
- self.addStep(SetProperty(
- name='hg_ident_revision',
- command=['hg', 'identify', '-i'],
- property='revision',
- workdir=location,
- haltOnFailure=True
- ))
- self.addStep(ShellCommand(
- name='create_bundle',
- command=['hg', '-R', location, 'bundle', '--base', 'null',
- '-r', WithProperties('%(revision)s'),
- 'source/%s' % repo['bundleName']],
- workdir='.',
- description=['create bundle'],
- haltOnFailure=True
- ))
- self.addStep(ShellCommand(
- name='delete_metadata',
- command=['rm', '-rf', '.hg'],
- workdir=location,
- description=['delete metadata'],
- haltOnFailure=True
- ))
- for dir in autoconfDirs:
- self.addStep(ShellCommand(
- name='autoconf',
- command=['autoconf-2.13'],
- workdir='%s/%s' % (self.branchName, dir),
- haltOnFailure=True
- ))
- self.addStep(ShellCommand(
- name='create_tarball',
- command=['tar', '-cjf', sourceTarball, self.branchName],
- workdir='.',
- description=['create tarball'],
- haltOnFailure=True
- ))
- self.addStep(ShellCommand(
- name='upload_files',
- command=['python', '%s/build/upload.py' % self.branchName,
- '--base-path', '.'] + bundleFiles + [sourceTarball],
- workdir='.',
- env=uploadEnv,
- description=['upload files'],
- ))
class CCSourceFactory(ReleaseFactory):
def __init__(self, productName, version, baseTag, stagingServer,
437 process/mobiletestfactory.py
View
@@ -1,437 +0,0 @@
-import re
-
-from buildbot.process.factory import BuildFactory
-from buildbot.steps.shell import WithProperties
-from buildbot.changes import base, changes
-
-import buildbotcustom.steps.misc
-import buildbotcustom.steps.talos
-import buildbotcustom.steps.mobile
-reload(buildbotcustom.steps.misc)
-reload(buildbotcustom.steps.talos)
-reload(buildbotcustom.steps.mobile)
-from buildbotcustom.steps.base import ShellCommand, SetProperty
-from buildbotcustom.steps.misc import FindFile, DownloadFile, UnpackFile, \
- DisconnectStep
-from buildbotcustom.steps.talos import MozillaRunPerfTests
-from buildbotcustom.steps.mobile import MobileParseTestLog
-
-import buildbotcustom.steps.unittest
-reload(buildbotcustom.steps.unittest)
-from buildbotcustom.steps.unittest import ShellCommandReportTimeout, \
- emphasizeFailureText, summaryText
-
-#Parse a line of output from .ini files
-def parse_build_info(output, repo_type):
- retval = {}
- patterns=["^BuildID=(?P<%s_buildid>.*)$" % repo_type,
- "^SourceStamp=(?P<%s_changeset>.*)$" % repo_type,
- "^SourceRepository=(?P<%s_repository>\S+)$" % repo_type,
- "^Milestone=(?P<milestone>.*)$",
- "^Version=(?P<version>.*)$",
- ]
-
- for pattern in patterns:
- m = re.search(pattern, output, re.M)
- if m:
- retval.update(m.groupdict())
- return retval
-
-def download_dir(rc, stdout, stderr):
- m = re.search("^(?P<download_dir>.*/)[^/]*$", stdout)
- return m.groupdict()
-
-def simpleCVS(cvsroot, module, path, workdir):
- #TODO: Add ability to pull up to a certain date (-D)
- return ShellCommand(
- command=['cvs', '-d', cvsroot, 'co', '-d', module, path],
- description=[module, 'checkout'],
- name="%s_checkout" % module,
- workdir=workdir,
- haltOnFailure=True,
- )
-
-def simpleHG(host, repo, workdir, target=None):
- if target is None:
- target = repo.rstrip('/').split('/')[-1]
- steps = []
- steps.append(ShellCommand(
- command=['rm', '-rf', target],
- workdir=workdir,
- description=['delete', target, 'repo'],
- name='rm_%s_repo' % target,
- ))
- steps.append(ShellCommand(
- command=['hg', '-v', 'clone', '%s/%s' % (host, repo), target],
- workdir=workdir,
- description=[target, 'clone'],
- name='clone_%s' % target,
- haltOnFailure=True,
- ))
- return steps
-
-
-#
-# Run Talos on Maemo Phones
-#
-class MobileTalosFactory(BuildFactory):
-
- def __init__(self, test, timeout, branch=None, talos_config_file='sample.config',
- results_server=None, reboot=True, base_dir='/builds',
- reboot_cmd=['sudo', 'reboot-user'], nochrome=False,
- cvsroot=":pserver:anonymous@63.245.209.14:/cvsroot",
- hg_host='http://hg.mozilla.org', tools_repo_path='build/tools',
- talos_tarball=None, pageloader_tarball=None,
- cleanup_glob='tools talos fennec* *.tar.bz2 *.zip',
- tp4_source='/tools/tp4', browser_wait=7, **kwargs):
- BuildFactory.__init__(self, **kwargs)
- self.test = test
- self.timeout = timeout
- self.branch = branch
- self.talos_config_file = talos_config_file
- self.results_server = results_server
- self.reboot = reboot
- self.base_dir = base_dir
- self.reboot_cmd = reboot_cmd
- self.nochrome = '' if nochrome is None else '--noChrome'
- self.cvsroot = cvsroot #We are using a static ip because of dns failures
- self.hg_host = hg_host
- self.tools_repo_path = tools_repo_path
- self.talos_tarball = talos_tarball
- self.pageloader_tarball = pageloader_tarball
- self.cleanup_glob = cleanup_glob
- self.tp4_source = tp4_source
- self.browser_wait = browser_wait
-
- self.addStartupSteps()
- self.addCleanupSteps()
- self.addSetupSteps()
- self.addObtainBuildSteps()
- self.addRunSteps()
- self.addFinalSteps()
-
- def addStartupSteps(self):
- self.addStep(ShellCommand(
- command=['echo', WithProperties("TinderboxPrint: %(slavename)s")],
- description="hostname",
- name='hostname'
- ))
- self.addStep(ShellCommand(
- command=['sh', '-c', 'echo TinderboxPrint: $(uname -m)'],
- description='arch',
- name='arch',
- ))
- self.addStep(ShellCommand(
- command=['free'],
- workdir=self.base_dir,
- description=['memory', 'check'],
- name='memory_check',
- ))
- self.addStep(ShellCommand(
- command=['df', '-h'],
- workdir=self.base_dir,
- description=['check', 'disk'],
- name='disk_check',
- ))
-
- def addCleanupSteps(self):
- self.addStep(ShellCommand(
- command=['sh', '-c',
- "rm talos/tp4 ; rm -rf %s" % self.cleanup_glob],
- # If you don't delete the tp4 symlink before cleanup
- # bad things happen!
- workdir=self.base_dir,
- name='cleanup',
- description='cleanup',
- haltOnFailure=True,
- ))
-
- def addObtainBuildSteps(self):
- self.addDownloadBuildStep()
- self.addUnpackBuildSteps()
-
- #If people *hate* lambdas, i could define simple functions
- mozilla_fn = lambda x,y,z: parse_build_info(' '.join([y,z]), 'mozilla')
- mobile_fn = lambda x,y,z: parse_build_info(' '.join([y,z]), 'mobile')
- self.addStep(SetProperty(
- command=['cat', 'platform.ini'],
- workdir='%s/fennec' % self.base_dir,
- extract_fn=mozilla_fn,
- description=['get', 'mobile', 'revision'],
- name='mozilla_rev',
- ))
- self.addStep(SetProperty(
- command=['cat', 'application.ini'],
- workdir='%s/fennec' % self.base_dir,
- extract_fn=mobile_fn,
- description=['get', 'mobile', 'revision'],
- name='mobile_rev',
- ))
- self.addStep(SetProperty(
- command=['echo',
- WithProperties('%(mozilla_changeset)s:%(mobile_changeset)s')],
- property='got_revision',
- name='set_got_revision',
- description=['set_got_revision']
- ))
- self.addStep(ShellCommand(
- command=['echo', 'TinderboxPrint:',
- WithProperties('<a href=%(mozilla_repository)s/rev/%(mozilla_changeset)s' +
- 'title="Built from Mozilla revision %(mozilla_changeset)s">' +
- 'moz:%(mozilla_changeset)s</a> <br />' +
- '<a href=%(mobile_repository)s/rev/%(mobile_changeset)s' +
- 'title="Built from Mobile revision %(mobile_changeset)s">' +
- 'mobile:%(mobile_changeset)s</a>')],
- description=['list', 'revisions'],
- name='rev_info',
- ))
-
- def addSetupSteps(self):
- if self.talos_tarball is None:
- self.addStep(simpleCVS(cvsroot=self.cvsroot, module='talos',
- path='mozilla/testing/performance/talos',
- workdir=self.base_dir))
- else:
- self.addTarballTalosSteps()
- if self.pageloader_tarball is None:
- self.addHGPageloaderSteps()
- else:
- self.addTarballPageloaderSteps()
- self.addStep(ShellCommand(
- command=['sudo', 'chmod', '-R', '+rx', '.'],
- workdir=self.base_dir,
- description=['fix', 'permissions'],
- name='fix_perms',
- ))
- if 'tp4' in self.test:
- self.addStep(ShellCommand(
- #maybe do rsync -a self.tp4_source.rstrip('/')
- # self.base_dir/talos/page_load_test+'/'
- #so we know we are always working with a pristine tp4 set
- command=['ln', '-s', self.tp4_source, '.'],
- workdir='%s/talos/page_load_test' % self.base_dir,
- description=['create', 'tp4', 'symlink'],
- name='tp4_symlink',
- haltOnFailure=True,
- ))
-
- def addHGPageloaderSteps(self):
- self.addSteps(simpleHG(self.hg_host, self.tools_repo_path,
- self.base_dir, 'tools'))
-
- def addTarballPageloaderSteps(self):
- self.addStep(ShellCommand(
- command=['wget', self.pageloader_tarball,
- '-O', 'pageloader.tar.bz2'],
- workdir=self.base_dir,
- #PerfConfigurator.py will copy the pageloader extension
- description=['get', 'pageloader'],
- name='get_pageloader',
- haltOnFailure=True,
- ))
- self.addStep(ShellCommand(
- command=['tar', 'jxvf', '%s/pageloader.tar.bz2' % self.base_dir],
- workdir='%s/fennec' % self.base_dir,
- description=['unpack', 'pageloader'],
- name='unpack_pageloader',
- haltOnFailure=True,
- ))
-
- def addTarballTalosSteps(self):
- self.addStep(ShellCommand(
- command=['wget', self.talos_tarball, '-O', 'talos.tar.bz2'],
- workdir=self.base_dir,
- description=['get', 'talos'],
- name='get_talos',
- haltOnFailure=True,
- ))
- self.addStep(ShellCommand(
- command=['tar', 'jxvf', 'talos.tar.bz2'],
- workdir=self.base_dir,
- description=['unpack', 'talos'],
- name='unpack_talos',
- haltOnFailure=True,
- ))
-
- def addRunSteps(self):
- perfconf_cmd=['python',
- "PerfConfigurator.py",
- '-v', '-e',
- '%s/fennec/fennec' % self.base_dir,
- '-t', WithProperties("%(slavename)s"),
- '--branch', self.branch,
- '--branchName', self.branch,
- '--activeTests', self.test,
- '--sampleConfig', self.talos_config_file,
- '--browserWait', str(self.browser_wait),
- '--resultsServer', self.results_server,
- self.nochrome,
- '--resultsLink', '/server/collect.cgi',
- '--output', 'local.config']
- runtest_cmd=["python", "run_tests.py", "--noisy",
- "--debug", "local.config"]
- self.addStep(ShellCommand(
- command=perfconf_cmd,
- workdir="%s/talos" % self.base_dir,
- description=['perfconfig', self.test],
- haltOnFailure=True,
- name='perfconfig_%s' % self.test,
- ))
- self.addStep(ShellCommand(
- command=["cat", "local.config"],
- workdir="%s/talos" % self.base_dir,
- description=["config", self.test],
- name='cat_config_%s' % self.test,
- haltOnFailure=True,
- ))
- self.addStep(MozillaRunPerfTests(
- command=runtest_cmd,
- workdir = "%s/talos" % self.base_dir,
- description=['run', self.test],
- timeout=self.timeout + 2*60, #make sure that can hit the test
- #timeout before we kill the command
- warnOnWarnings=True,
- haltOnFailure=False,
- name='run_test_%s' % self.test,
- ))
-
- def addFinalSteps(self):
- if self.reboot:
- self.addStep(DisconnectStep(
- command=self.reboot_cmd,
- force_disconnect=True,
- warnOnFailure=False,
- flunkOnFailure=False,
- alwaysRun=True,
- description='reboot',
- name='reboot',
- ))
- else:
- self.addCleanupSteps()
-
- # from TalosFactory
- def addDownloadBuildStep(self):
- def get_url(build):
- url = build.source.changes[-1].files[0]
- return url
- self.addStep(DownloadFile(
- url_fn=get_url,
- url_property="fileURL",
- filename_property="filename",
- workdir=self.base_dir,
- haltOnFailure=True,
- timeout=60*60,
- name="get_build",
- description=['get', 'build'],
- ))
-
- # also from TalosFactory. Moving towards refactoring, which is good,
- # but not there yet.
- def addUnpackBuildSteps(self):
- self.addStep(UnpackFile(
- filename=WithProperties("%(filename)s"),
- workdir=self.base_dir,
- haltOnFailure=True,
- timeout=60*60,
- name="unpack_build",
- description=['unpack', 'build'],
- ))
-
-#
-# Run unit tests through maemkit on Maemo Phones
-#
-class MobileUnittestFactory(MobileTalosFactory):
- def __init__(self, test_type, known_fail_count=0, clients=None,
- maemkit_repo_path='qa/maemkit', maemkit_tarball=None,
- **kwargs):
- ''' clients is a tuple of (clientnumber, totalclients), e.g. (1,4).
- being hopeful about default 0 for known fail count'''
- self.test_type = test_type
- self.known_fail_count = known_fail_count
- self.clients = clients
- self.maemkit_repo_path = maemkit_repo_path
- self.maemkit_tarball = maemkit_tarball
- MobileTalosFactory.__init__(self, **kwargs)
-
- def addSetupSteps(self):
- self.addStep(ShellCommand(
- command=['mkdir', '-p', '%s/maemkit_logs' % self.base_dir],
- name='mkdir_maemkit_logs',
- description=['make', 'maemkit', 'log', 'dir'],
- ))
- if self.maemkit_tarball is not None:
- self.addTarballMaemkitSteps()
- else:
- self.addSteps(simpleHG(self.hg_host,
- self.maemkit_repo_path, self.base_dir, 'maemkit'))
-
- def addObtainBuildSteps(self):
- MobileTalosFactory.addObtainBuildSteps(self)
- self.addStep(SetProperty(
- command=['echo', WithProperties("%(fileURL)s")],
- extract_fn=download_dir,
- name='download_dir',
- description=['download', 'directory', 'property'],
- ))
- self.addStep(ShellCommand(
- command=['wget',
- WithProperties("%(download_dir)s/fennec-%(version)s.en-US.linux-gnueabi-arm.tests.zip"),
- '-O', 'fennec-tests.zip'],
- workdir=self.base_dir,
- haltOnFailure=True,
- name="get_tests",
- description=['get', 'unit', 'tests'],
- ))
- self.addStep(ShellCommand(
- command=['unzip', '%s/fennec-tests.zip' % self.base_dir],
- workdir="%s/fennec" % self.base_dir,
- name='unpack_test',
- description=['unpack', 'tests'],
- haltOnFailure=True,
- ))
-
- def addTarballMaemkitSteps(self):
- self.addStep(ShellCommand(
- command=['wget', self.maemkit_tarball,
- '-O', 'maemkit.tar.bz2'],
- workdir=self.base_dir,
- description=['get', 'maemkit'],
- name='get_maemkit',
- haltOnFailure=True,
- ))
- self.addStep(ShellCommand(
- command=['tar', 'jxvf', 'maemkit.tar.bz2'],
- workdir='%s' % self.base_dir,
- description=['unpack', 'maemkit'],
- name='unpack_maemkit',
- haltOnFailure=True,
- ))
-
- def addRunSteps(self):
- test_command = ['python', 'maemkit-chunked.py']
- log_name = 'log_%s.txt' % self.test_type
- test_command.append('--testtype=%s' % self.test_type)
- if self.clients:
- assert issubclass(type(self.clients), tuple), "self.clients must be tuple"
- assert len(self.clients) is 2, "self.clients too long"
- client, total = self.clients
- test_command.append('--client-number=%d' % client)
- test_command.append('--total-clients=%d' % total)
- self.addStep(ShellCommand(
- command=test_command,
- workdir="%s/maemkit" % self.base_dir,
- description=['run', self.test],
- name="run_%s" % self.test,
- haltOnFailure=True,
- timeout=self.timeout,
- ))
- self.addStep(MobileParseTestLog(
- name=self.test_type,
- command=['cat', log_name],
- knownFailCount=self.known_fail_count,
- workdir="/builds/fennec",
- description=['parse', self.test_type, 'log'],
- timeout=120,
- flunkOnFailure=False,
- haltOnFailure=False,
- ))
Please sign in to comment.
Something went wrong with that request. Please try again.