mirror of
https://github.com/odoo/runbot.git
synced 2025-03-15 23:45:44 +07:00

- don't *fail* in `_compute_identity`, it causes issues when the token is valid but doesn't have `user:email` access as the request is aborted and saving doesn't work - make `github_name` and `github_email` required rather than ad-hoc requiring them in `_compute_identity` (which doesn't work correctly) - force copy of `github_name` and `github_email`, with o2ms being !copy this means duplicating projects now works out of the box (or should...) Currently errors in `_compute_identity` are reported via logging which is not great as it's not UI visible, should probably get moved to chatter eventually but that's not currently enabled on projects. Fixes #990
44 lines
1.2 KiB
Python
44 lines
1.2 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',
|
|
'github_name': config['github']['name'],
|
|
'github_email': "foo@example.org",
|
|
'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')
|