mirror of
https://github.com/odoo/runbot.git
synced 2025-03-15 15:35:46 +07:00
Allow some builds to determine which modules to test
OCA addon repos will only want to test modules at root Glob before retrieving dependencies and store in build object Signed-off-by: Sandy Carter <sandy.carter@savoirfairelinux.com>
This commit is contained in:
parent
83029e48f5
commit
0fb5ef92c4
@ -173,7 +173,7 @@ class runbot_repo(osv.osv):
|
||||
'auto': fields.boolean('Auto'),
|
||||
'duplicate_id': fields.many2one('runbot.repo', 'Repository for finding duplicate builds'),
|
||||
'fallback_id': fields.many2one('runbot.repo', 'Fallback repo'),
|
||||
'modules': fields.char("Modules to Install"),
|
||||
'modules': fields.char("Modules to Install", help="Comma-separated list of modules to install and test."),
|
||||
'token': fields.char("Github token"),
|
||||
}
|
||||
_defaults = {
|
||||
@ -277,7 +277,8 @@ class runbot_repo(osv.osv):
|
||||
'name': sha,
|
||||
'author': author,
|
||||
'subject': subject,
|
||||
'date': dateutil.parser.parse(date[:19])
|
||||
'date': dateutil.parser.parse(date[:19]),
|
||||
'modules': branch.repo_id.modules,
|
||||
}
|
||||
Build.create(cr, uid, build_info)
|
||||
|
||||
@ -449,6 +450,7 @@ class runbot_build(osv.osv):
|
||||
'author': fields.char('Author'),
|
||||
'subject': fields.text('Subject'),
|
||||
'sequence': fields.integer('Sequence', select=1),
|
||||
'modules': fields.char("Modules to Install"),
|
||||
'result': fields.char('Result'), # ok, ko, warn, skipped, killed
|
||||
'pid': fields.integer('Pid'),
|
||||
'state': fields.char('Status'), # pending, testing, running, done, duplicate
|
||||
@ -544,8 +546,10 @@ class runbot_build(osv.osv):
|
||||
|
||||
# fallback for addons-only community/projet branches
|
||||
if not os.path.isfile(build.server('__init__.py')):
|
||||
l = glob.glob(build.path('*/__openerp__.py'))
|
||||
for i in l:
|
||||
# Find modules to test and store in build
|
||||
modules_to_test = glob.glob(build.path('*/__openerp__.py'))
|
||||
build.write({'modules': ','.join(modules_to_test)})
|
||||
for i in modules_to_test:
|
||||
shutil.move(os.path.dirname(i), build.server('addons'))
|
||||
name = build.branch_id.branch_name.split('-',1)[0]
|
||||
if build.repo_id.fallback_id:
|
||||
@ -582,8 +586,8 @@ class runbot_build(osv.osv):
|
||||
server_path = build.path("bin/openerp-server.py")
|
||||
|
||||
# modules
|
||||
if build.repo_id.modules:
|
||||
modules = build.repo_id.modules
|
||||
if build.modules:
|
||||
modules = build.modules
|
||||
else:
|
||||
l = glob.glob(build.server('addons', '*', '__init__.py'))
|
||||
modules = set(os.path.basename(os.path.dirname(i)) for i in l)
|
||||
|
Loading…
Reference in New Issue
Block a user