def testSimple(self): self.slavebase = "testSimple.slave" self.masterbase = "testSimple.master" sb = self.makeSlaveBuilder() sb.flag = False registry.registerSlaveCommand("simple", _SimpleCommand, "1") step = self.makeStep(_SimpleBuildStep) d = self.runStep(step) def _checkSimple(results): self.failUnless(sb.flag) self.failUnlessEqual(sb.flag_args, {"arg1": "value"}) d.addCallback(_checkSimple) return d
def RegisterGclient(): try: # This version should work on BB 8.3 # We run this code in a try because it fails with an assertion if # the module is loaded twice. commandRegistry['gclient'] = 'webrtc_buildbot.slave_utils.GClient' return except (AssertionError, NameError): pass try: # This version should work on BB 7.12 # We run this code in a try because it fails with an assertion if # the module is loaded twice. registerSlaveCommand('gclient', GClient, commands.command_version) except (AssertionError, NameError): pass
def RegisterCommands(): """Registers all command objects defined in this file.""" try: # This version should work on BB 8.3 # We run this code in a try because it fails with an assertion if # the module is loaded twice. commandRegistry['gclient'] = 'slave.chromium_commands.GClient' commandRegistry['apply_issue'] = 'slave.chromium_commands.ApplyIssue' return except (AssertionError, NameError): pass try: # This version should work on BB 7.12 # We run this code in a try because it fails with an assertion if # the module is loaded twice. registerSlaveCommand('gclient', GClient, commands.command_version) registerSlaveCommand('apply_issue', ApplyIssue, commands.command_version) except (AssertionError, NameError): pass
"""Subclass InspectCommand to only compare two directories. This is used by the InspectLocaleDirs command, as part of the dashboard for weave. Requires `refpath` and `l10npath` to be in args, both are relative to `workingdir`. """ def _compare(self, workingdir, locale, gather_stats, args): """Overload _compare to call compareDirs.""" ref, l10n = (self.args[k] for k in ('refpath', 'l10npath')) obs = stats = None if gather_stats: obs = Observer() log.msg(workingdir, ref, l10n) o = compareDirs(os.path.join(workingdir, ref), os.path.join(workingdir, l10n), otherObserver = obs) try: summary = o.summary.values()[0] except: log.msg("Couldn't get summary") summary = {} if gather_stats: stats = obs.dict() return o, summary, stats registerSlaveCommand('moz_inspectlocales', InspectCommand, '0.2') registerSlaveCommand('moz_inspectlocales_dirs', InspectDirsCommand, '0.2')
log.msg('es.index: ' + json.dumps(rv)) def _compare(self, workingdir, locale, args): inipath, l10nbase, redirects = (self.args[k] for k in ('inipath', 'l10nbase', 'redirects')) try: app = EnumerateSourceTreeApp(os.path.join(workingdir, inipath), workingdir, os.path.join(workingdir, l10nbase), redirects, [locale]) observerlist = compareProjects( [app.asConfig()], os.path.join(workingdir, l10nbase), ) except Exception as e: log.msg(e) raise return observerlist def finished(self, *args): # sometimes self.rc isn't set here, no idea why try: rc = self.rc except AttributeError: rc = FAILURE self.sendStatus({'rc': rc}) registerSlaveCommand('moz_inspectlocales', InspectCommand, '0.2')