mirror of
https://github.com/odoo/runbot.git
synced 2025-03-15 23:45:44 +07:00
[IMP] runbot: faster batch prepare
This commit is contained in:
parent
833b4e29d0
commit
a0251f1b68
@ -632,6 +632,7 @@ class Repo(models.Model):
|
|||||||
'state': 'preparing',
|
'state': 'preparing',
|
||||||
})
|
})
|
||||||
bundle.last_batch = preparing
|
bundle.last_batch = preparing
|
||||||
|
preparing._process() # process in case we have a 0 wait on project
|
||||||
|
|
||||||
if bundle.last_batch.state == 'preparing':
|
if bundle.last_batch.state == 'preparing':
|
||||||
bundle.last_batch._new_commit(branch)
|
bundle.last_batch._new_commit(branch)
|
||||||
|
@ -104,6 +104,7 @@ class TestBuildParams(RunbotCaseMinimalSetup):
|
|||||||
branch_a_name = 'master-test-something'
|
branch_a_name = 'master-test-something'
|
||||||
self.push_commit(self.remote_server_dev, branch_a_name, 'nice subject', sha='d0d0caca')
|
self.push_commit(self.remote_server_dev, branch_a_name, 'nice subject', sha='d0d0caca')
|
||||||
# batch preparation
|
# batch preparation
|
||||||
|
self.repo_server.project_id.process_delay = 10
|
||||||
self.repo_server._update_batches()
|
self.repo_server._update_batches()
|
||||||
|
|
||||||
# create a custom config and a new trigger
|
# create a custom config and a new trigger
|
||||||
@ -118,6 +119,8 @@ class TestBuildParams(RunbotCaseMinimalSetup):
|
|||||||
'bundle_id': bundle.id,
|
'bundle_id': bundle.id,
|
||||||
'config_id': custom_config.id
|
'config_id': custom_config.id
|
||||||
})
|
})
|
||||||
|
|
||||||
|
self.repo_server.project_id.process_delay = 0
|
||||||
bundle.last_batch._process()
|
bundle.last_batch._process()
|
||||||
build_slot = bundle.last_batch.slot_ids.filtered(lambda rec: rec.trigger_id == self.trigger_server)
|
build_slot = bundle.last_batch.slot_ids.filtered(lambda rec: rec.trigger_id == self.trigger_server)
|
||||||
self.assertEqual(build_slot.build_id.params_id.config_id, custom_config)
|
self.assertEqual(build_slot.build_id.params_id.config_id, custom_config)
|
||||||
|
@ -86,6 +86,7 @@ class TestRepo(RunbotCaseMinimalSetup):
|
|||||||
self.commit_list[self.repo_server.id] = first_commit
|
self.commit_list[self.repo_server.id] = first_commit
|
||||||
|
|
||||||
self.patchers['github_patcher'].side_effect = github
|
self.patchers['github_patcher'].side_effect = github
|
||||||
|
self.repo_server.project_id.process_delay = 10
|
||||||
repos._update_batches()
|
repos._update_batches()
|
||||||
|
|
||||||
dev_branch = self.env['runbot.branch'].search([('remote_id', '=', self.remote_server_dev.id)])
|
dev_branch = self.env['runbot.branch'].search([('remote_id', '=', self.remote_server_dev.id)])
|
||||||
@ -252,6 +253,8 @@ class TestRepo(RunbotCaseMinimalSetup):
|
|||||||
return {}
|
return {}
|
||||||
|
|
||||||
self.patchers['github_patcher'].side_effect = github2
|
self.patchers['github_patcher'].side_effect = github2
|
||||||
|
|
||||||
|
self.repo_server.project_id.process_delay = 0
|
||||||
bundle.last_batch._process()
|
bundle.last_batch._process()
|
||||||
self.assertEqual(last_batch.commit_link_ids.commit_id.mapped('subject'), ['Server subject', 'Addons subject'])
|
self.assertEqual(last_batch.commit_link_ids.commit_id.mapped('subject'), ['Server subject', 'Addons subject'])
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user