rem
stringlengths
0
322k
add
stringlengths
0
2.05M
context
stringlengths
8
228k
params['quality_log'] = '\n'.join(data['quality_log'])
params['quality_log'] = base64.encodestring('\n'.join(data['quality_log']))
def create_test_step_log(step_object = None, step_name = ''): source = step_object.build.builder.test_ids properties = step_object.build.builder.openerp_properties openerp_host = properties.get('openerp_host', 'localhost') openerp_port = properties.get('openerp_port',8069) openerp_dbname = properties.get('openerp_dbnam...
params['log'] = '\n'.join(data['log'])
params['log'] = base64.encodestring('\n'.join(data['log']))
def create_test_step_log(step_object = None, step_name = ''): source = step_object.build.builder.test_ids properties = step_object.build.builder.openerp_properties openerp_host = properties.get('openerp_host', 'localhost') openerp_port = properties.get('openerp_port',8069) openerp_dbname = properties.get('openerp_dbnam...
default_section = parse_option_section(config, config.items('general'), 5)
try: default_section = parse_option_section(config, config.items('general'), 5) except NoSectionError: default_section = [] pass
def parse_color_section(conf, sname): """Parse the config section sname for colors configuration """ pass
return c.start()
d = c.start() d.addCallback(self.doVCClean) return d def doVCClean(self, res=None): """ Clean the repository after some pull or update This will remove untracked files (eg. *.pyc, junk) from the repo dir. """ command = [self.vcexe, 'clean-tree', '-q', '--force', '--unknown', '--detritus'] srcdir = os.path.join(self.b...
def doVCUpdate(self): if self.revision: command = [self.vcexe, 'pull', self.sourcedata.split('\n')[0], '-q', '--overwrite', '-r', str(self.revision)] else: command = [self.vcexe, 'update', '-q'] srcdir = os.path.join(self.builder.basedir, self.srcdir) c = ShellCommand(self.builder, command, srcdir, sendRC=False, timeou...
return (not self.sourcedirIsPatched() and
return (not self.sourcedirIsPatched()) and \
def sourcedirIsUpdateable(self): if os.path.exists(os.path.join(self.builder.basedir, self.srcdir, ".buildbot-patched")): return False # contrary to base class, we allow update when self.revision return (not self.sourcedirIsPatched() and os.path.isdir(os.path.join(self.builder.basedir, self.srcdir, ".bzr")))
self.srcdir, ".bzr")))
self.srcdir, ".bzr"))
def sourcedirIsUpdateable(self): if os.path.exists(os.path.join(self.builder.basedir, self.srcdir, ".buildbot-patched")): return False # contrary to base class, we allow update when self.revision return (not self.sourcedirIsPatched() and os.path.isdir(os.path.join(self.builder.basedir, self.srcdir, ".bzr")))
openERP_environment = openerp_env.get_test_environment(self.builder.basedir)
try: openERP_environment = openerp_env.get_test_environment(self.builder.basedir) except: openERP_environment = None
def start(self): args = self.args assert args['workdir'] is not None workdir = os.path.join(self.builder.basedir, args['workdir']) addonsdir = args.get('addonsdir', False) if addonsdir: dirs = [] if 'stable_openobject_server' in args['addonsdir'].split('/'): dirs.append('base') else: for dir in os.listdir(workdir): if ...
'install-translation', 'multi'): parser.error("incorrect command")
'install-translation', 'multi', '--'): parser.error("incorrect command: %s" % command)
def parse_cmdargs(args): """Parse the non-option arguments into an array of commands The array has entries like ('cmd', [args...]) Multiple commands may be specified either with the 'multi' command or with the '--' separator from the last cmd. """ global parser ret = [] while len(args): command = args[0] #if command.s...
if command == 'multi':
if command == '--': continue elif command == 'multi':
def parse_cmdargs(args): """Parse the non-option arguments into an array of commands The array has entries like ('cmd', [args...]) Multiple commands may be specified either with the 'multi' command or with the '--' separator from the last cmd. """ global parser ret = [] while len(args): command = args[0] #if command.s...
ftp_port=None,
ftp_port=None, defines=False,
def __init__(self, root_path, port, netport, addons_path, pyver=None, srv_mode='v600', timed=False, debug=False, do_warnings=False, ftp_port=None, config=None): threading.Thread.__init__(self) self.root_path = root_path self.port = port # self.addons_path = addons_path self.args = [ 'python%s' %(pyver or ''),] if do_wa...
if opt.debug:
if opt.debug or opt.debug_bqi:
def init_log(): global opt log = logging.getLogger() if opt.debug: log.setLevel(logging.DEBUG) else: log.setLevel(logging.INFO) has_stdout = has_stderr = False if not (opt.xml_log or opt.txt_log or opt.mach_log): # Default to a txt logger opt.txt_log = 'stderr' if opt.xml_log: hnd = XMLStreamHandler(opt.xml_log) log....
ftp_port=opt.ftp_port, debug=opt.debug)
ftp_port=opt.ftp_port, defines=opt.defines, debug=opt.debug or opt.debug_server)
def load_mod_info(mdir, module): """ :param module: The name of the module (sale, purchase, ...) """ for filename in ['__openerp__.py', '__terp__.py']: description_file = os.path.join(mdir, module, filename) # Broken for zip modules. if description_file and os.path.isfile(description_file): return eval(open(description...
logger.error('xmlrpc exception: %s', reduce_homedir(e.faultCode.strip()))
e_fc = str(e.faultCode) logger.error('xmlrpc exception: %s', reduce_homedir(e_fc.strip()))
def load_mod_info(mdir, module): """ :param module: The name of the module (sale, purchase, ...) """ for filename in ['__openerp__.py', '__terp__.py']: description_file = os.path.join(mdir, module, filename) # Broken for zip modules. if description_file and os.path.isfile(description_file): return eval(open(description...
if sres.getResult() == SUCCESS:
if sbuild.getResult() == SUCCESS:
def start(self): self.logfiles = {} global ports_pool builder_props = self.build.getProperties() if not ports_pool: # Effectively, the range of these ports will limit the number of # simultaneous databases that can be tested min_port = builder_props.getProperty('min_port',8200) max_port = builder_props.getProperty('max...
fileIsImportant=None, properties=None, openerp_properties=None):
fileIsImportant=None, properties=None, keeper=None):
def __init__(self, name, branch, treeStableTimer, builderNames, fileIsImportant=None, properties=None, openerp_properties=None): self.unimportantChanges = [] Scheduler.__init__(self, name=name, branch=branch, treeStableTimer=treeStableTimer, builderNames=builderNames, fileIsImportant=fileIsImportant, properties=propert...
self.openerp_properties = openerp_properties
self.keeper = keeper
def __init__(self, name, branch, treeStableTimer, builderNames, fileIsImportant=None, properties=None, openerp_properties=None): self.unimportantChanges = [] Scheduler.__init__(self, name=name, branch=branch, treeStableTimer=treeStableTimer, builderNames=builderNames, fileIsImportant=fileIsImportant, properties=propert...
summaries = {self.name:{}}
summaries = {self.name:{'log': [], 'state':None}}
def createSummary(self, log): counts = {"log": 0} summaries = {self.name:{}} io = StringIO(log.getText()).readlines() for line in io: if line.find("ERROR") != -1: pos = line.find("ERROR") + len("ERROR") line = line[pos:] summaries[self.name]["log"].append(line) counts["log"] += 1 else: pass self.summaries = summaries i...
print 'Change:', cdict
def addChangeToDatabase(self, change): change_obj = rpc.RpcProxy('software_dev.commit') cdict = change.asDict() cleanupDict(cdict) for f in cdict['files']: cleanupDict(f) print 'Change:', cdict change.number = change_obj.submit_change(cdict)
important = self._get_change_num(Token(), [ r['commit_id'] for r in res])
important = self._get_change_num(Token(), [ r['commit_id'][0] for r in res])
def scheduler_get_classified_changes(self, schedulerid, t): scha_obj = rpc.RpcProxy('software_dev.sched_change') # one time for important ones sids = scha_obj.search([('sched_id','=', schedulerid), ('important','=',True)]) res = scha_obj.read(sids, ['commit_id']) important = self._get_change_num(Token(), [ r['commit_...
unimportant = self._get_change_num(Token(), [ r['commit_id'] for r in res])
unimportant = self._get_change_num(Token(), [ r['commit_id'][0] for r in res])
def scheduler_get_classified_changes(self, schedulerid, t): scha_obj = rpc.RpcProxy('software_dev.sched_change') # one time for important ones sids = scha_obj.search([('sched_id','=', schedulerid), ('important','=',True)]) res = scha_obj.read(sids, ['commit_id']) important = self._get_change_num(Token(), [ r['commit_...
change.number = change_obj.submit_change(cdict) prop_arr = [] for propname,propvalue in change.properties.properties.items(): prop_arr.append((propname, json.dumps(propvalue))) if prop_arr: change_obj.setProperties(change.number, prop_arr) self.notify("add-change", change.number) self._change_cache.add(change.number, ...
try: change.number = change_obj.submit_change(cdict) prop_arr = [] for propname,propvalue in change.properties.properties.items(): prop_arr.append((propname, json.dumps(propvalue))) if prop_arr: change_obj.setProperties(change.number, prop_arr) self.notify("add-change", change.number) self._change_cache.add(change.num...
def addChangeToDatabase(self, change): change_obj = rpc.RpcProxy('software_dev.commit') cdict = change.asDict() cleanupDict(cdict) for f in cdict['files']: cleanupDict(f) change.number = change_obj.submit_change(cdict) prop_arr = [] for propname,propvalue in change.properties.properties.items(): prop_arr.append((propna...
rows = change_obj.search(domain, 0, None, 'id desc')
rows = change_obj.search(domain, 0, 0, 'id desc')
def changeEventGenerator(self, branches=[], categories=[], committers=[], minTime=0): change_obj = rpc.RpcProxy('software_dev.commit') domain = [] if branches: domain.append( ('branch_id', 'in', branches) ) # if categories: Not Implemented yet # domain.append( ('category_id', 'in', categories) ) if committers: dom...
return self.runInteractionNow(self._txn_get_active_buildset_ids) def _txn_get_active_buildset_ids(self, t): raise NotImplementedError t.execute("SELECT id FROM buildsets WHERE complete=0") return [bsid for (bsid,) in t.fetchall()]
bsids = bset_obj.search([('complete', '=', False)]) return list(bsids)
def get_active_buildset_ids(self): return self.runInteractionNow(self._txn_get_active_buildset_ids)
return self.runInteractionNow(self._txn_get_buildset_info, bsid) def _txn_get_buildset_info(self, t, bsid): raise NotImplementedError q = self.quoteq("SELECT external_idstring, reason, sourcestampid," " complete, results" " FROM buildsets WHERE id=?") t.execute(q, (bsid,)) res = t.fetchall()
bset_obj = rpc.RpcProxy('software_dev.commit') res = bset_obj.read(bsid, ['external_idstring', 'reason', 'complete', 'results'])
def get_buildset_info(self, bsid): return self.runInteractionNow(self._txn_get_buildset_info, bsid)
(external, reason, ssid, complete, results) = res[0] external_idstring = str_or_none(external) reason = str_or_none(reason) complete = bool(complete) return (external_idstring, reason, ssid, complete, results)
external_idstring = res['external_idstring'] or None reason = res['reason'] or None complete = bool(res['complete']) return (external_idstring, reason, bsid, complete, res['results'])
def _txn_get_buildset_info(self, t, bsid): raise NotImplementedError q = self.quoteq("SELECT external_idstring, reason, sourcestampid," " complete, results" " FROM buildsets WHERE id=?") t.execute(q, (bsid,)) res = t.fetchall() if res: (external, reason, ssid, complete, results) = res[0] external_idstring = str_o...
raise NotImplementedError return self.runInteractionNow(self._txn_get_pending_brids_for_builder, buildername) def _txn_get_pending_brids_for_builder(self, t, buildername): raise NotImplementedError t.execute(self.quoteq("SELECT id FROM buildrequests" " WHERE buildername=? AND" " complete=0 AND claimed_at=0"), (buil...
breq_obj = rpc.RpcProxy('software_dev.commit') bids = breq_obj.search([('buildername', '=', buildername), ('complete', '=', False), ('claimed_at', '=', False)]) return list(bids)
def get_pending_brids_for_builder(self, buildername): print "Get pending brids" raise NotImplementedError return self.runInteractionNow(self._txn_get_pending_brids_for_builder, buildername)
for sres in sbuild.getTestResults(): if sres.getName() != 'OpenERP-Test':
for sres in sbuild.getTestResults().values(): if sres.results == SUCCESS:
def start(self): #TODO FIX: # need to change the static slave path self.logfiles = {} # builddir = self.build.builder.builddir if not self.args.get('addonsdir'): if self.build.builder.properties.get('addons_dir'): self.args['addonsdir'] = self.build.builder.properties['addons_dir'] else: self.args['addonsdir'] = '../a...
if sres.results == SUCCESS: continue olmods_found.append(sres.name[0]) if len(olmods_found): log.msg("Found these modules that failed last time: %s" % \ ','.join(olmods_found)) more_mods.extend(olmods_found) break
olmods_found.append(sres.name[0])
def start(self): #TODO FIX: # need to change the static slave path self.logfiles = {} # builddir = self.build.builder.builddir if not self.args.get('addonsdir'): if self.build.builder.properties.get('addons_dir'): self.args['addonsdir'] = self.build.builder.properties['addons_dir'] else: self.args['addonsdir'] = '../a...
break
more_mods.extend(olmods_found) log.msg("Found these modules that failed last time: %s" % \ ','.join(olmods_found)) break
def start(self): #TODO FIX: # need to change the static slave path self.logfiles = {} # builddir = self.build.builder.builddir if not self.args.get('addonsdir'): if self.build.builder.properties.get('addons_dir'): self.args['addonsdir'] = self.build.builder.properties['addons_dir'] else: self.args['addonsdir'] = '../a...
if self.args['test_mode'] not in ('install',):
if self.args['test_mode'] == 'check-quality':
def start(self): #TODO FIX: # need to change the static slave path self.logfiles = {} # builddir = self.build.builder.builddir if not self.args.get('addonsdir'): if self.build.builder.properties.get('addons_dir'): self.args['addonsdir'] = self.build.builder.properties['addons_dir'] else: self.args['addonsdir'] = '../a...
def evaluateCommand_old(self, cmd):
def evaluateCommand(self, cmd):
def evaluateCommand_old(self, cmd): # FIXME: remove it, possibly res = SUCCESS if cmd.rc != 0 or self.build_result == FAILURE: # TODO: more results from b-q-i, it has discrete exit codes. res = FAILURE return res
if cmd.rc != 0 or self.build_result == FAILURE:
if cmd.rc != 0:
def evaluateCommand_old(self, cmd): # FIXME: remove it, possibly res = SUCCESS if cmd.rc != 0 or self.build_result == FAILURE: # TODO: more results from b-q-i, it has discrete exit codes. res = FAILURE return res
"""Step to perform lint-check on changed files
"""Step to gather statistics of changed files
def start(self): self.args['command']=["../../../file-lint.sh",] self.args['command'] += [ str(x) for x in self.build.allFiles()]
elif key in ('addons_path', 'root_path', 'xml_log', 'txt_log', 'mach_log'):
elif key in ('addons_path', 'root_path', 'xml_log', 'txt_log', 'mach_log', 'inter_history'):
def parse_option_section(conf, items, allow_include=True): global opt, copt, args global config_stray_opts nonopts = ('conffile', 'have_bqirc', 'bqirc_section', 'include') default_section = None for key, val in items: if key == 'include' and allow_include: for inc in val.split(' '): parse_option_section(conf, conf.item...
logger.info("Interactive mode. Not implemented yet!") ret = False
logger.info("Interactive mode. Enjoy!") cmdp = CmdPrompt(client) try: while True and server.is_running: r = cmdp.handle() if not r: break except KeyboardInterrupt: log.info("Keyboard interrupt, exiting") cmdp.finish()
def load_mod_info(mdir, module): """ :param module: The name of the module (sale, purchase, ...) """ for filename in ['__openerp__.py', '__terp__.py']: description_file = os.path.join(mdir, module, filename) # Broken for zip modules. if description_file and os.path.isfile(description_file): return eval(open(description...
summaries = {self.name:{}}
summaries = {self.name:{'log': []}}
def createSummary(self, log): io = StringIO(log.getText()).readlines() summaries = {self.name:{}} counts = {"log": 0} for line in io: if line.find("ERROR") != -1: pos = line.find("ERROR") + len("ERROR") line = line[pos:] summaries[self.name]["log"].append(line) counts["log"] += 1 else: pass self.summaries = summaries i...
self.connection = None
self.allow_xmlrpc2 = True
def __init__(self): self.open = False self.url = None #self.password = None self.uid = None self.context = {} self.userName = None self.databaseName = None self.connection = None self.threads = [] self.server_options = [] self._log = logging.getLogger('RPC.Session')
value = self.connection.call(obj, method, args)
conn = self.connections.borrow(self.conn_timeout) try: value = conn.call(obj, method, args) finally: self.connections.free(conn)
def call(self, obj, method, *args): if not self.open: raise RpcException(_('Not logged in')) value = self.connection.call(obj, method, args) return value
self.connection = createConnection(url, allow_xmlrpc2=True )
if self.url and url != self.url: self.allow_xmlrpc2 = True conn = createConnection(url, allow_xmlrpc2=self.allow_xmlrpc2 )
def login(self, url): """Logs in the given server with specified name and password. @param url dictionary of connection parameters Returns Session.Exception, Session.InvalidCredentials or Session.LoggedIn """ self.connection = createConnection(url, allow_xmlrpc2=True ) user = url['user'] password = url['passwd'] db = u...
res = self.connection.login(db, user, password)
res = conn.login(db, user, password)
def login(self, url): """Logs in the given server with specified name and password. @param url dictionary of connection parameters Returns Session.Exception, Session.InvalidCredentials or Session.LoggedIn """ self.connection = createConnection(url, allow_xmlrpc2=True ) user = url['user'] password = url['passwd'] db = u...
if e.errcode == 404 and isinstance(self.connection, XmlRpc2Connection): self.connection = createConnection( _url, allow_xmlrpc2=False)
if e.errcode == 404 and isinstance(conn, XmlRpc2Connection): conn = createConnection( _url, allow_xmlrpc2=False) self.allow_xmlrpc2 = False
def login(self, url): """Logs in the given server with specified name and password. @param url dictionary of connection parameters Returns Session.Exception, Session.InvalidCredentials or Session.LoggedIn """ self.connection = createConnection(url, allow_xmlrpc2=True ) user = url['user'] password = url['passwd'] db = u...
try: self.server_options = self.connection.call('/common', 'get_options', args=[], auth_level='pub')
conn = self.connections.borrow(self.conn_timeout) try: self.server_options = conn.call('/common', 'get_options', args=[], auth_level='pub')
def reloadContext(self): self.context = self.execute('/object', 'execute', 'res.users', 'context_get') or {} try: self.server_options = self.connection.call('/common', 'get_options', args=[], auth_level='pub') self._log.debug("got server options: %r", self.server_options) if 'xmlrpc-gzip' in self.server_options \ and ...
and isinstance(self.connection, (XmlRpcConnection, XmlRpc2Connection)): self.connection._send_gzip = True
and isinstance(conn, (XmlRpcConnection, XmlRpc2Connection)): conn._send_gzip = True
def reloadContext(self): self.context = self.execute('/object', 'execute', 'res.users', 'context_get') or {} try: self.server_options = self.connection.call('/common', 'get_options', args=[], auth_level='pub') self._log.debug("got server options: %r", self.server_options) if 'xmlrpc-gzip' in self.server_options \ and ...
self.connection = None
self.connections.clear()
def logout(self): if self.open: self.open = False #self.userName = None self.uid = None #self.password = None self.connection = None
new.connection = self.connection.copy()
new.allow_xmlrpc2 = self.allow_xmlrpc2 new.server_options = self.server_options
def copy(self): new = Session() new.open = self.open new.url = self.url # new.password = self.password new.uid = self.uid new.context = self.context new.userName = self.userName new.databaseName = self.databaseName new.connection = self.connection.copy() return new
if debug:
if opt.debug_sql: self.args += [ '--log-level=debug_sql' ] elif debug:
def __init__(self, root_path, port, netport, addons_path, pyver=None, srv_mode='v600', timed=False, debug=False, do_warnings=False, ftp_port=None, defines=False, pyargs=False, config=None): threading.Thread.__init__(self) self.root_path = root_path self.port = port # self.addons_path = addons_path self.args = [ 'python...
if m and m.group(2) in ('DEBUG', 'DEBUG_RPC', 'DEBUG_SQL'):
if m and m.group(2) in ('DEBUG', 'DEBUG_RPC', 'DEBUG_SQL', 'DEBUG_RPC_ANSWER'):
def _io_flush(self): """ Process any remaining data in _io_bufs """
if args[1] == 'pgmode':
elif args[1] == 'pgmode':
def _cmd_server(self, *args): """Server-level operations or info This command has several sub-commands: set loglevel <num|name> Set the logging level. Name may only be supported at certain server versions set loggerlevel <logger> <num|name> Set lever for some logger check Perform the "chec...
if e.faultCode == 'wizard.module.upgrade.simple\\':
if e.faultCode == 'wizard.module.upgrade.simple':
def _modules_upgrade(self, uid): """ Perform the modules upgrade wizard, for ones previously selected """ obj_conn = xmlrpclib.ServerProxy(self.uri + '/xmlrpc/object') wizard_conn = xmlrpclib.ServerProxy(self.uri + '/xmlrpc/wizard')
form_presses = { 'init':'config', 'config': 'end', 'start': 'end'}
form_presses = { 'init': 'start', 'next': 'start', 'config': 'end', 'start': 'end'}
def upgrade_module(self, modules): uid = self._login() if not uid: return False server.state_dict['module-mode'] = 'upgrade' obj_conn = xmlrpclib.ServerProxy(self.uri + '/xmlrpc/object') wizard_conn = xmlrpclib.ServerProxy(self.uri + '/xmlrpc/wizard') module_ids = self._execute(obj_conn, 'execute', self.dbname, uid, se...
parser.add_option("--black-modules", dest="black_modules", default=False,
parser.add_option("--black-modules", dest="black_modules", default=None,
def _cmd_test(self, cmd, *args): """Perform some predefined test Available ones are: account-moves <N> Generate N account moves """ try: if cmd == 'account-moves': client.gen_account_moves(args[0]) else: print "Unknown sub-command: test %s" % cmd except xmlrpclib.Fault, e: print 'xmlrpc exception: %s' % redu...
if command not in ('start-server','create-db','drop-db',
if command == '--': args = args[1:] continue if command[0] in ('-', '+'): cmd2 = command[1:] else: cmd2 = command if cmd2 not in ('start-server','create-db','drop-db',
def parse_cmdargs(args): """Parse the non-option arguments into an array of commands The array has entries like ('cmd', [args...]) Multiple commands may be specified either with the 'multi' command or with the '--' separator from the last cmd. """ global parser ret = [] while len(args): command = args[0] #if command.s...
'install-translation', 'multi', '--'):
'install-translation', 'multi'):
def parse_cmdargs(args): """Parse the non-option arguments into an array of commands The array has entries like ('cmd', [args...]) Multiple commands may be specified either with the 'multi' command or with the '--' separator from the last cmd. """ global parser ret = [] while len(args): command = args[0] #if command.s...
elif command == 'multi':
elif cmd2 == 'multi':
def parse_cmdargs(args): """Parse the non-option arguments into an array of commands The array has entries like ('cmd', [args...]) Multiple commands may be specified either with the 'multi' command or with the '--' separator from the last cmd. """ global parser ret = [] while len(args): command = args[0] #if command.s...
elif command in ('install-module', 'upgrade-module', 'check-quality',
elif cmd2 in ('install-module', 'upgrade-module', 'check-quality',
def parse_cmdargs(args): """Parse the non-option arguments into an array of commands The array has entries like ('cmd', [args...]) Multiple commands may be specified either with the 'multi' command or with the '--' separator from the last cmd. """ global parser ret = [] while len(args): command = args[0] #if command.s...
if cmd == 'create-db': ret = client.create_db() elif cmd == 'drop-db': ret = client.drop_db() elif cmd == 'install-module': ret = client.install_module(mods + args) elif cmd == 'upgrade-module': ret = client.upgrade_module(mods+args) elif cmd == 'check-quality': ret = client.check_quality(mods+args, options['quality-lo...
try: if (not ret) and not cmd.startswith('+'): continue ign_result = cmd.startswith('-') if cmd[0] in ['-', '+']: cmd = cmd[1:] if cmd == 'create-db': ret = client.create_db() elif cmd == 'drop-db': ret = client.drop_db() elif cmd == 'install-module': ret = client.install_module(mods + args) elif cmd == 'upgrade-modul...
def parse_cmdargs(args): """Parse the non-option arguments into an array of commands The array has entries like ('cmd', [args...]) Multiple commands may be specified either with the 'multi' command or with the '--' separator from the last cmd. """ global parser ret = [] while len(args): command = args[0] #if command.s...
logger.error("Stopping tests because %s failed", cmd) break
logger.error("Command %s failed, stopping tests.", cmd)
def parse_cmdargs(args): """Parse the non-option arguments into an array of commands The array has entries like ('cmd', [args...]) Multiple commands may be specified either with the 'multi' command or with the '--' separator from the last cmd. """ global parser ret = [] while len(args): command = args[0] #if command.s...
ret = []
def _get_change_num(self, trans, changeid): change_obj = rpc.RpcProxy('software_dev.commit') if isinstance(changeid, (list, tuple)): cids = changeid else: cids = [changeid,] if not cids: return [] res = change_obj.getChanges(cids) ret = [] props = self.get_properties_from_db(change_obj, cids) for cdict in res: c = Ope...
'orm': ['help', 'obj_info', 'do', 'res_id', 'print','with', 'exit', ], 'orm_id': [ 'help', 'do', 'print', 'with', 'exit', ]
'orm': ['help', 'obj_info', 'do', 'res_id', 'print', 'with', 'debug', 'exit', ], 'orm_id': [ 'help', 'do', 'print', 'with', 'debug', 'exit', ]
def _complete_print(self, text, state): pos = [] if self._last_res: if 'this'.startswith(text): pos.append('this') if isinstance(self._last_res, dict): for k in self._last_res.keys(): if k.startswith(text): pos.append(k) if (not text) and isinstance(self._last_res, (list, tuple)): pos.append('@')
sub_commands = { 'debug': ['on', 'off', 'server on', 'server off', 'console on', 'console off'],
sub_commands = { 'debug': ['on', 'off', 'server on', 'server off', 'console on', 'console off', 'console silent', 'object on', 'object off',],
def _complete_print(self, text, state): pos = [] if self._last_res: if 'this'.startswith(text): pos.append('this') if isinstance(self._last_res, dict): for k in self._last_res.keys(): if k.startswith(text): pos.append(k) if (not text) and isinstance(self._last_res, (list, tuple)): pos.append('@')
if self.cur_orm: if server.server_series == 'pg84':
args = args[1:] if argo == 'object': if not self.cur_orm: print "Command 'debug object ...' is only available at orm level!" return argo = args and args[0] or 'on' if client.series in ('pg84',):
def _cmd_debug(self, *args): argo = args and args[0] or 'on' if self.cur_orm: if server.server_series == 'pg84': self._client.execute_common('root', 'set_obj_debug', self.cur_orm, (argo == 'on') and 1 or 0) else: print "Cannot change the ORM log level for %s server" % server.server_series return print "Set debug to %s"...
print "Cannot change the ORM log level for %s server" % server.server_series
print "Cannot change the ORM log level for %s server" % client.series
def _cmd_debug(self, *args): argo = args and args[0] or 'on' if self.cur_orm: if server.server_series == 'pg84': self._client.execute_common('root', 'set_obj_debug', self.cur_orm, (argo == 'on') and 1 or 0) else: print "Cannot change the ORM log level for %s server" % server.server_series return print "Set debug to %s"...
elif argo == 'off': log.setLevel(logging.INFO) self._client.execute_common('root', 'set_loglevel', 20)
def _cmd_debug(self, *args): argo = args and args[0] or 'on' if self.cur_orm: if server.server_series == 'pg84': self._client.execute_common('root', 'set_obj_debug', self.cur_orm, (argo == 'on') and 1 or 0) else: print "Cannot change the ORM log level for %s server" % server.server_series return print "Set debug to %s"...
def _cmd_db(self, dbname):
def _cmd_db(self, *args):
def _cmd_db(self, dbname): """Connect to database """ try: uid = self._client._login() self.dbname = dbname self.__cmdlevel = 'db' except KeyError: print "Cannot connect to database %s" % dbname
self.dbname = dbname self.__cmdlevel = 'db'
def _cmd_db(self, dbname): """Connect to database """ try: uid = self._client._login() self.dbname = dbname self.__cmdlevel = 'db' except KeyError: print "Cannot connect to database %s" % dbname
has_stderr = True
def init_log(): global opt log = logging.getLogger() if opt.debug or opt.debug_bqi: log.setLevel(logging.DEBUG) else: log.setLevel(logging.INFO) has_stdout = has_stderr = False if not (opt.xml_log or opt.txt_log or opt.mach_log): # Default to a txt logger opt.txt_log = 'stderr' if opt.xml_log: hnd = XMLStreamHandler(...
has_stdout = True
def init_log(): global opt log = logging.getLogger() if opt.debug or opt.debug_bqi: log.setLevel(logging.DEBUG) else: log.setLevel(logging.INFO) has_stdout = has_stderr = False if not (opt.xml_log or opt.txt_log or opt.mach_log): # Default to a txt logger opt.txt_log = 'stderr' if opt.xml_log: hnd = XMLStreamHandler(...
if has_stdout:
if console_log_handler is not None:
def init_log(): global opt log = logging.getLogger() if opt.debug or opt.debug_bqi: log.setLevel(logging.DEBUG) else: log.setLevel(logging.INFO) has_stdout = has_stderr = False if not (opt.xml_log or opt.txt_log or opt.mach_log): # Default to a txt logger opt.txt_log = 'stderr' if opt.xml_log: hnd = XMLStreamHandler(...
has_stdout = True
console_log_handler = hnd3
def init_log(): global opt log = logging.getLogger() if opt.debug or opt.debug_bqi: log.setLevel(logging.DEBUG) else: log.setLevel(logging.INFO) has_stdout = has_stderr = False if not (opt.xml_log or opt.txt_log or opt.mach_log): # Default to a txt logger opt.txt_log = 'stderr' if opt.xml_log: hnd = XMLStreamHandler(...
olog.info(r)
if m and m.group(2) in ('DEBUG', 'DEBUG_RPC', 'DEBUG_SQL'): olog.debug(r) else: olog.info(r)
def _io_flush(self): """ Process any remaining data in _io_bufs """
olog.info(rl)
if mmatch.group(2) in ('DEBUG', 'DEBUG_RPC', 'DEBUG_SQL'): olog.debug(rl) else: olog.info(rl)
def _io_read(self, fd, fd_obj): """ Read data from fd_obj into _io_bufs[fd] and process """ rl = fd_obj.readline() if not rl: return mmatch = ematch = None if fd_obj is self.proc.stderr: ematch = self.linewere.match(rl) else: mmatch = self.linere.match(rl) if mmatch: # we don't append this line, but process the previo...
conn = createConnection( _url, allow_xmlrpc2=False)
conn = createConnection(url, allow_xmlrpc2=False)
def login(self, url): """Logs in the given server with specified name and password. @param url dictionary of connection parameters Returns Session.Exception, Session.InvalidCredentials or Session.LoggedIn """ if self.url and url != self.url: # perhaps a different server, retry for XML-RPC v2 self.allow_xmlrpc2 = True
funct(m.group(3), m.group(2), m.group(4))
if callable(funct): funct(m.group(3), m.group(2), m.group(4)) elif isinstance(funct, tuple): logger = logging.getLogger('bqi.'+ funct[0]) level = funct[1] logger.log(level, funct[2]) else: self.log.info(funct)
def run(self): try: self.log.info("will run: %s", ' '.join(self.args)) self.proc = subprocess.Popen(self.args, shell=False, cwd=None, stdout=subprocess.PIPE, stderr=subprocess.PIPE) self.is_running = True self.log.info("server running at pid: %d", self.proc.pid) pob = select.poll() pob.register(self.proc.stdout) pob.re...
funct(m.group(3), m.group(3), mm)
if callable(funct): funct(m.group(3), m.group(3), mm) elif isinstance(funct, tuple): logger = logging.getLogger('bqi.'+ funct[0]) level = funct[1] log_args = mm.groups('') logger.log(level, funct[2], *log_args) else: self.log.info(funct, *log_args)
def run(self): try: self.log.info("will run: %s", ' '.join(self.args)) self.proc = subprocess.Popen(self.args, shell=False, cwd=None, stdout=subprocess.PIPE, stderr=subprocess.PIPE) self.is_running = True self.log.info("server running at pid: %d", self.proc.pid) pob = select.poll() pob.register(self.proc.stdout) pob.re...
uid = self._login(self.uri, self.dbname, self.user, self.pwd)
uid = self._login()
def check_quality(self, modules, quality_logs): uid = self._login(self.uri, self.dbname, self.user, self.pwd) quality_logs += 'quality-logs' if not uid: return False conn = xmlrpclib.ServerProxy(self.uri + '/xmlrpc/object') final = {} for module in modules: qualityresult = {} test_detail = {} quality_result = self._exe...
wiz_id = self._execute(wizard_conn, 'create', self._dbname, uid, self.pwd,
wiz_id = self._execute(wizard_conn, 'create', self.dbname, uid, self.pwd,
def install_module(self, modules): uid = self._login() if not uid: return False # what buttons to press at each state: form_presses = { 'init': 'start', 'next': 'start', 'start': 'end' } obj_conn = xmlrpclib.ServerProxy(self.uri + '/xmlrpc/object') wizard_conn = xmlrpclib.ServerProxy(self.uri + '/xmlrpc/wizard') modu...
logger.exception('')
logger.exception('exc:')
def parse_cmdargs(args): """Parse the non-option arguments into an array of commands The array has entries like ('cmd', [args...]) Multiple commands may be specified either with the 'multi' command or with the '--' separator from the last cmd. """ global parser ret = [] while len(args): command = args[0] if command ==...
def doClobber(self, dummy, dirname, chmodDone=False):
def doClobber(self, dummy, dirname, **kwargs):
def doClobber(self, dummy, dirname, chmodDone=False): # Bzr class wouldn't check that, because it assumes dirname == workdir, # so already created. d = os.path.join(self.builder.basedir, dirname) if not os.path.exists(d): return defer.succeed(0) return Bzr.doClobber(self, dummy, dirname, chmodDone=chmodDone)
return Bzr.doClobber(self, dummy, dirname, chmodDone=chmodDone)
return Bzr.doClobber(self, dummy, dirname, **kwargs)
def doClobber(self, dummy, dirname, chmodDone=False): # Bzr class wouldn't check that, because it assumes dirname == workdir, # so already created. d = os.path.join(self.builder.basedir, dirname) if not os.path.exists(d): return defer.succeed(0) return Bzr.doClobber(self, dummy, dirname, chmodDone=chmodDone)
'orm', 'module', 'translation', 'server' ],
'orm', 'module', 'translation', 'server', 'test' ],
def _complete_print(self, text, state): pos = [] if self._last_res: if 'this'.startswith(text): pos.append('this') if isinstance(self._last_res, dict): for k in self._last_res.keys(): if k.startswith(text): pos.append(k) if (not text) and isinstance(self._last_res, (list, tuple)): pos.append('@')
def setupUsualPages(self, *args, **kargs): WebStatus.setupUsualPages(self)
def setupUsualPages(self, *args, **kwargs): WebStatus.setupUsualPages(self, *args, **kwargs)
def setupUsualPages(self, *args, **kargs): WebStatus.setupUsualPages(self) self.putChild("buggraph", BugGraph()) self.putChild("latestbuilds", LatestBuilds()) self.putChild("buildersresource", OpenObjectBuildersResource())
srv_mode='v600', timed=False):
srv_mode='v600', timed=False, debug=False):
def __init__(self, root_path, port, netport, addons_path, pyver=None, srv_mode='v600', timed=False): threading.Thread.__init__(self) self.root_path = root_path self.port = port # self.addons_path = addons_path self.args = [ 'python%s' %(pyver or ''), '%sopenerp-server.py' % root_path, ] if addons_path: self.args += [ '...
log.debug("Wizard ended in %d steps", i)
log.info("Wizard ended in %d steps", i)
def run_wizard(self, wizard_conn, uid, wiz_id, form_presses, datas): """ Simple Execute of a wizard, press form_presses until end. This tries to go through a wizard, by trying the states found in form_presses. If form_presses = { 'start': 'foo', 'foo': 'end'} then the 'foo' button(=state) will be pressed at 'start', t...
log.setLevel(logging.DEBUG)
if opt.debug: log.setLevel(logging.DEBUG) else: log.setLevel(logging.INFO)
def init_log(): global opt log = logging.getLogger() log.setLevel(logging.DEBUG) has_stdout = has_stderr = False if not (opt.xml_log or opt.txt_log or opt.mach_log): # Default to a txt logger opt.txt_log = 'stderr' if opt.xml_log: hnd = XMLStreamHandler(opt.xml_log) log.addHandler(hnd) if opt.txt_log: if opt.txt_log...
srv_mode=options['server_series'])
srv_mode=options['server_series'], debug=opt.debug)
def parse_cmdargs(args): """Parse the non-option arguments into an array of commands The array has entries like ('cmd', [args...]) Multiple commands may be specified either with the 'multi' command or with the '--' separator from the last cmd. """ global parser ret = [] while len(args): command = args[0] if command ==...
branch = bld['branch_url'],
change_filter=cfilt,
def reset(self): """ Reload the configuration """ print "Keeper reset" c = self.bmconfig c['slaves'] = [] c['schedulers'] = [] c['builders'] = [] c['change_source']=[] bbot_attr_obj = rpc.RpcProxy('software_dev.battr') bids = bbot_attr_obj.search([('bbot_id','=', self.bbot_id)]) if bids: for attr in bbot_attr_obj.read...
for mc in mods_changed: self.args['command'] += [ '-m', str(mc) ]
def start(self): #TODO FIX: # need to change the static slave path self.logfiles = {} builddir = self.build.builder.builddir full_addons = os.path.normpath(os.getcwd() + '../../openerp_buildbot_slave/build/%s/openerp-addons/'%(builddir)) try: raise NotImplementedError # TODO for module in os.listdir(full_addons): if mo...
self.args['command'] += ['--', 'install-module']
def start(self): #TODO FIX: # need to change the static slave path self.logfiles = {} builddir = self.build.builder.builddir full_addons = os.path.normpath(os.getcwd() + '../../openerp_buildbot_slave/build/%s/openerp-addons/'%(builddir)) try: raise NotImplementedError # TODO for module in os.listdir(full_addons): if mo...
if 'module' in blame_dict and 'module-mode' in blame_dict:
if 'context' in blame_dict: sumk = blame_dict['context'] elif 'module' in blame_dict and 'module-mode' in blame_dict:
def createSummary(self, plog): global log logs = self.cmd.logs buildbotURL = self.build.builder.botmaster.parent.buildbotURL bqi_re = re.compile(r'([^\>\|]+)(\|[^\>]+)?\> (.*)$')
if not sumk: sumk = 'bqi.rest'
def createSummary(self, plog): global log logs = self.cmd.logs buildbotURL = self.build.builder.botmaster.parent.buildbotURL bqi_re = re.compile(r'([^\>\|]+)(\|[^\>]+)?\> (.*)$')
self._client.execute_common('root', 'set_obj_debug', self.cur_orm, (argo == 'on') and 1 or 0)
self._client.execute_common('root', 'set_obj_debug', client.dbname, self.cur_orm, (argo == 'on') and 1 or 0)
def _cmd_debug(self, *args): argo = args and args[0] or 'on' args = args[1:] if argo == 'object': if not self.cur_orm: print "Command 'debug object ...' is only available at orm level!" return argo = args and args[0] or 'on' if client.series in ('pg84',): self._client.execute_common('root', 'set_obj_debug', self.cur_or...
if argo not in ('on', 'off'):
if argo not in ('on', 'off', 'silent'):
def _cmd_debug(self, *args): argo = args and args[0] or 'on' args = args[1:] if argo == 'object': if not self.cur_orm: print "Command 'debug object ...' is only available at orm level!" return argo = args and args[0] or 'on' if client.series in ('pg84',): self._client.execute_common('root', 'set_obj_debug', self.cur_or...
if self.revision: return True return os.path.isdir(os.path.join(self.builder.basedir,self.srcdir, ".bzr"))
return Bzr.sourcedirIsUpdateable(self)
def sourcedirIsUpdateable(self): if os.path.exists(os.path.join(self.builder.basedir, self.srcdir, ".buildbot-patched")): return False if self.revision: return True return os.path.isdir(os.path.join(self.builder.basedir,self.srcdir, ".bzr"))
'state': fields.function(_get_test_result, method=True, type='selection', size=8, string="Test Result",
'state': fields.function(_get_test_result, method=True, type='selection', string="Test Result",
def _get_test_ids(self, cr, uid, ids, context=None): if context is None: context = {} result = {} for step in self.pool.get('buildbot.test.step').browse(cr, uid, ids, context=context): result[step.test_id.id] = True return result.keys()
assert args['addonsdir'] is not None
def start(self): args = self.args assert args['workdir'] is not None assert args['addonsdir'] is not None workdir = os.path.join(self.builder.basedir, args['workdir']) addonsdir = args['addonsdir'] dirs = [] if 'stable_openobject_server' in args['addonsdir'].split('/'): dirs.append('base') else: for dir in os.listdir(w...
addonsdir = args['addonsdir'] dirs = [] if 'stable_openobject_server' in args['addonsdir'].split('/'): dirs.append('base') else: for dir in os.listdir(workdir): if dir not in ['.buildbot-sourcedata','.bzrignore','.bzr','.svn','README.txt']: if dir == 'base': continue dirs.append(dir)
addonsdir = args.get('addonsdir', False) if addonsdir: dirs = [] if 'stable_openobject_server' in args['addonsdir'].split('/'): dirs.append('base') else: for dir in os.listdir(workdir): if dir not in ['.buildbot-sourcedata','.bzrignore','.bzr','.svn','README.txt']: if dir == 'base': continue dirs.append(dir)
def start(self): args = self.args assert args['workdir'] is not None assert args['addonsdir'] is not None workdir = os.path.join(self.builder.basedir, args['workdir']) addonsdir = args['addonsdir'] dirs = [] if 'stable_openobject_server' in args['addonsdir'].split('/'): dirs.append('base') else: for dir in os.listdir(w...
commandline += dirs commandline += [addonsdir]
if addonsdir: commandline += dirs commandline += [addonsdir]
def start(self): args = self.args assert args['workdir'] is not None assert args['addonsdir'] is not None workdir = os.path.join(self.builder.basedir, args['workdir']) addonsdir = args['addonsdir'] dirs = [] if 'stable_openobject_server' in args['addonsdir'].split('/'): dirs.append('base') else: for dir in os.listdir(w...
self.args['command'].extend(['--black-modules', self.args['black_modules']])
self.args['command'].extend(['--black-modules', ' '.join(self.args['black_modules'])])
def start(self): self.logfiles = {} global ports_pool builder_props = self.build.getProperties() if not ports_pool: # Effectively, the range of these ports will limit the number of # simultaneous databases that can be tested min_port = builder_props.getProperty('min_port',8200) max_port = builder_props.getProperty('max...
do_warnings=None, lang=None,
do_warnings=None, lang=None, debug=False,
def __init__(self, workdir=None, dbname=False, addonsdir=None, netport=None, port=None, ftp_port=None, force_modules=None, black_modules=None, test_mode='full', do_warnings=None, lang=None, repo_mode=WithProperties('%(repo_mode)s'), **kwargs): LoggingBuildStep.__init__(self, **kwargs) if isinstance(black_modules, bases...
'repo_mode': repo_mode }
'repo_mode': repo_mode, 'debug': debug }
def __init__(self, workdir=None, dbname=False, addonsdir=None, netport=None, port=None, ftp_port=None, force_modules=None, black_modules=None, test_mode='full', do_warnings=None, lang=None, repo_mode=WithProperties('%(repo_mode)s'), **kwargs): LoggingBuildStep.__init__(self, **kwargs) if isinstance(black_modules, bases...