mirror of
https://github.com/odoo/runbot.git
synced 2025-03-16 16:05:42 +07:00

With the trigger-ification pretty much complete the only cron that's still routinely triggered explicitly is the cross-pr check, and it's that in all modules, so there's no cause to keep an overridable fixture.
42 lines
1.1 KiB
Python
42 lines
1.1 KiB
Python
import pytest
|
|
|
|
@pytest.fixture()
|
|
def module():
|
|
return 'runbot_merge'
|
|
|
|
@pytest.fixture
|
|
def project(env, config):
|
|
return env['runbot_merge.project'].create({
|
|
'name': 'odoo',
|
|
'github_token': config['github']['token'],
|
|
'github_prefix': 'hansen',
|
|
'branch_ids': [(0, 0, {'name': 'master'})],
|
|
})
|
|
|
|
|
|
@pytest.fixture
|
|
def make_repo2(env, project, make_repo, users, setreviewers):
|
|
"""Layer over ``make_repo`` which also:
|
|
|
|
- adds the new repo to ``project`` (with no group and the ``'default'`` status required)
|
|
- sets the standard reviewers on the repo
|
|
- and creates an event source for the repo
|
|
"""
|
|
def mr(name):
|
|
r = make_repo(name)
|
|
rr = env['runbot_merge.repository'].create({
|
|
'project_id': project.id,
|
|
'name': r.name,
|
|
'group_id': False,
|
|
'required_statuses': 'default',
|
|
})
|
|
setreviewers(rr)
|
|
env['runbot_merge.events_sources'].create({'repository': r.name})
|
|
return r
|
|
return mr
|
|
|
|
|
|
@pytest.fixture
|
|
def repo(make_repo2):
|
|
return make_repo2('repo')
|