Permalink
Browse files

Kill UnittestBuildFactory too. r=catlee

  • Loading branch information...
1 parent 0ec8a85 commit bd00573a02dc8a477d6c259947539411ad462cb7 @mozbhearsum mozbhearsum committed Aug 2, 2012
Showing with 0 additions and 310 deletions.
  1. +0 −310 process/factory.py
View
@@ -4654,316 +4654,6 @@ def __init__(self, baseTag, appName, config, productName, version,
workdir='tools/release',
))
-class UnittestBuildFactory(MozillaBuildFactory):
- def __init__(self, platform, productName, config_repo_path, config_dir,
- objdir, mochitest_leak_threshold=None,
- crashtest_leak_threshold=None, uploadPackages=False,
- unittestMasters=None, unittestBranch=None, stageUsername=None,
- stageServer=None, stageSshKey=None, run_a11y=True,
- env={}, **kwargs):
- self.env = {}
-
- MozillaBuildFactory.__init__(self, env=env, **kwargs)
-
- self.productName = productName
- self.stageServer = stageServer
- self.stageUsername = stageUsername
- self.stageSshKey = stageSshKey
- self.uploadPackages = uploadPackages
- self.config_repo_path = config_repo_path
- self.config_dir = config_dir
- self.objdir = objdir
- self.run_a11y = run_a11y
- self.crashtest_leak_threshold = crashtest_leak_threshold
- self.mochitest_leak_threshold = mochitest_leak_threshold
-
- self.unittestMasters = unittestMasters or []
- self.unittestBranch = unittestBranch
- if self.unittestMasters:
- assert self.unittestBranch
-
- self.config_repo_url = self.getRepository(self.config_repo_path)
-
- env_map = {
- 'linux': 'linux-unittest',
- 'linux64': 'linux64-unittest',
- 'macosx': 'macosx-unittest',
- 'macosx64': 'macosx64-unittest',
- 'win32': 'win32-unittest',
- }
-
- self.platform = platform.split('-')[0]
- assert self.platform in getSupportedPlatforms()
-
- self.env = MozillaEnvironments[env_map[self.platform]].copy()
- self.env['MOZ_OBJDIR'] = self.objdir
- self.env.update(env)
-
- if self.platform == 'win32':
- self.addStep(SetProperty(
- command=['bash', '-c', 'pwd -W'],
- property='toolsdir',
- workdir='tools'
- ))
-
- self.addStep(Mercurial(
- name='hg_update',
- mode='update',
- baseURL='http://%s/' % self.hgHost,
- defaultBranch=self.repoPath,
- timeout=60*60 # 1 hour
- ))
-
- self.addPrintChangesetStep()
-
- self.addStep(ShellCommand(
- name='rm_configs',
- command=['rm', '-rf', 'mozconfigs'],
- workdir='.'
- ))
-
- self.addStep(MercurialCloneCommand(
- name='buildbot_configs',
- command=['hg', 'clone', self.config_repo_url, 'mozconfigs'],
- workdir='.'
- ))
-
- self.addCopyMozconfigStep()
-
- # TODO: Do we need this special windows rule?
- if self.platform == 'win32':
- self.addStep(ShellCommand(
- name='mozconfig_contents',
- command=["type", ".mozconfig"]
- ))
- else:
- self.addStep(ShellCommand(
- name='mozconfig_contents',
- command=['cat', '.mozconfig']
- ))
-
- self.addStep(ShellCommand(
- name='compile',
- command=["make", "-f", "client.mk", "build"],
- description=['compile'],
- timeout=60*60, # 1 hour
- haltOnFailure=1,
- env=self.env,
- ))
-
- self.addStep(ShellCommand(
- name='make_buildsymbols',
- command=['make', 'buildsymbols'],
- workdir='build/%s' % self.objdir,
- timeout=60*60,
- env=self.env,
- ))
-
- # Need to override toolsdir as set by MozillaBuildFactory because
- # we need Windows-style paths.
- if self.platform.startswith('win'):
- self.addStep(SetProperty(
- command=['bash', '-c', 'pwd -W'],
- property='toolsdir',
- workdir='tools'
- ))
-
- self.doUpload()
-
- self.env['MINIDUMP_STACKWALK'] = getPlatformMinidumpPath(self.platform)
- self.env['MINIDUMP_SAVE_PATH'] = WithProperties('%(basedir:-)s/minidumps')
-
- self.addPreTestSteps()
-
- self.addTestSteps()
-
- self.addPostTestSteps()
-
- if self.buildsBeforeReboot and self.buildsBeforeReboot > 0:
- self.addPeriodicRebootSteps()
-
- def doUpload(self, postUploadBuildDir=None, uploadMulti=False):
- if self.uploadPackages:
- self.addStep(ShellCommand(
- name='make_pkg',
- command=['make', 'package'],
- env=self.env,
- workdir='build/%s' % self.objdir,
- haltOnFailure=True
- ))
- self.addStep(ShellCommand(
- name='make_pkg_tests',
- command=['make', 'package-tests'],
- env=self.env,
- workdir='build/%s' % self.objdir,
- haltOnFailure=True
- ))
- self.addStep(GetBuildID(
- name='get_build_id',
- objdir=self.objdir,
- ))
-
- uploadEnv = self.env.copy()
- uploadEnv.update({'UPLOAD_HOST': self.stageServer,
- 'UPLOAD_USER': self.stageUsername,
- 'UPLOAD_TO_TEMP': '1'})
- if self.stageSshKey:
- uploadEnv['UPLOAD_SSH_KEY'] = '~/.ssh/%s' % self.stageSshKey
-
- # Always upload builds to the dated tinderbox builds directories
- uploadEnv['POST_UPLOAD_CMD'] = postUploadCmdPrefix(
- as_list=False,
- upload_dir="%s-%s-unittest" % (self.branchName, self.platform),
- buildid=WithProperties("%(buildid)s"),
- product=self.productName,
- to_tinderbox_dated=True,
- )
- self.addStep(RetryingSetProperty(
- name='make_upload',
- command=['make', 'upload'],
- env=uploadEnv,
- workdir='build/%s' % self.objdir,
- extract_fn=parse_make_upload,
- haltOnFailure=True,
- description=['upload'],
- timeout=60*60, # 60 minutes
- log_eval_func=lambda c,s: regex_log_evaluator(c, s, upload_errors),
- ))
-
- sendchange_props = {
- 'buildid': WithProperties('%(buildid:-)s'),
- 'builduid': WithProperties('%(builduid:-)s'),
- }
- for master, warn, retries in self.unittestMasters:
- self.addStep(SendChangeStep(
- name='sendchange_%s' % master,
- warnOnFailure=warn,
- master=master,
- retries=retries,
- revision=WithProperties('%(got_revision)s'),
- branch=self.unittestBranch,
- files=[WithProperties('%(packageUrl)s'),
- WithProperties('%(testsUrl)s')],
- user="sendchange-unittest",
- comments=WithProperties('%(comments:-)s'),
- sendchange_props=sendchange_props,
- ))
-
- def addTestSteps(self):
- self.addStep(unittest_steps.MozillaCheck,
- test_name="check",
- warnOnWarnings=True,
- workdir="build/%s" % self.objdir,
- timeout=5*60, # 5 minutes.
- env=self.env,
- )
-
- def addPrintChangesetStep(self):
- changesetLink = ''.join(['<a href=http://hg.mozilla.org/',
- self.repoPath,
- '/rev/%(got_revision)s title="Built from revision %(got_revision)s">rev:%(got_revision)s</a>'])
- self.addStep(OutputStep(
- name='tinderboxprint_changeset',
- data=['TinderboxPrint:', WithProperties(changesetLink)],
- ))
-
- def addCopyMozconfigStep(self):
- config_dir_map = {
- 'linux': 'linux/%s/unittest' % self.branchName,
- 'linux64': 'linux64/%s/unittest' % self.branchName,
- 'macosx': 'macosx/%s/unittest' % self.branchName,
- 'macosx64': 'macosx64/%s/unittest' % self.branchName,
- 'win32': 'win32/%s/unittest' % self.branchName,
- }
- mozconfig = 'mozconfigs/%s/%s/mozconfig' % \
- (self.config_dir, config_dir_map[self.platform])
-
- self.addStep(ShellCommand(
- name='copy_mozconfig',
- command=['cp', mozconfig, 'build/.mozconfig'],
- description=['copy mozconfig'],
- workdir='.'
- ))
-
- def addPreTestSteps(self):
- pass
-
- def addPostTestSteps(self):
- pass
-
-class TryUnittestBuildFactory(UnittestBuildFactory):
- def __init__(self, **kwargs):
-
- UnittestBuildFactory.__init__(self, **kwargs)
-
- def doUpload(self, postUploadBuildDir=None, uploadMulti=False):
- if self.uploadPackages:
- self.addStep(ShellCommand(
- name='make_pkg',
- command=['make', 'package'],
- env=self.env,
- workdir='build/%s' % self.objdir,
- haltOnFailure=True
- ))
- self.addStep(ShellCommand(
- name='make_pkg_tests',
- command=['make', 'package-tests'],
- env=self.env,
- workdir='build/%s' % self.objdir,
- haltOnFailure=True
- ))
- self.addStep(GetBuildID(
- name='get_build_id',
- objdir=self.objdir,
- ))
- self.addStep(SetBuildProperty(
- property_name="who",
- value=lambda build:build.source.changes[0].who if len(build.source.changes) > 0 else "",
- haltOnFailure=True
- ))
-
- uploadEnv = self.env.copy()
- uploadEnv.update({'UPLOAD_HOST': self.stageServer,
- 'UPLOAD_USER': self.stageUsername,
- 'UPLOAD_TO_TEMP': '1'})
- if self.stageSshKey:
- uploadEnv['UPLOAD_SSH_KEY'] = '~/.ssh/%s' % self.stageSshKey
-
- uploadEnv['POST_UPLOAD_CMD'] = postUploadCmdPrefix(
- as_list=False,
- upload_dir="%s-%s-unittest" % (self.branchName, self.platform),
- buildid=WithProperties("%(buildid)s"),
- product=self.productName,
- revision=WithProperties('%(got_revision)s'),
- who=WithProperties('%(who)s'),
- builddir=WithProperties('%(builddir)s'),
- to_try=True,
- )
-
- self.addStep(RetryingSetProperty(
- command=['make', 'upload'],
- env=uploadEnv,
- workdir='build/%s' % self.objdir,
- extract_fn=parse_make_upload,
- haltOnFailure=True,
- description=['upload'],
- log_eval_func=lambda c,s: regex_log_evaluator(c, s, upload_errors),
- locks=[upload_lock.access('counting')],
- ))
-
- for master, warn, retries in self.unittestMasters:
- self.addStep(SendChangeStep(
- name='sendchange_%s' % master,
- warnOnFailure=warn,
- master=master,
- retries=retries,
- revision=WithProperties('%(got_revision)s'),
- branch=self.unittestBranch,
- files=[WithProperties('%(packageUrl)s')],
- user=WithProperties('%(who)s')),
- comments=WithProperties('%(comments:-)s'),
- )
-
def parse_sendchange_files(build, include_substr='', exclude_substrs=[]):
'''Given a build object, figure out which files have the include_substr
in them, then exclude files that have one of the exclude_substrs. This

0 comments on commit bd00573

Please sign in to comment.