2019-09-23 18:54:42 +07:00
|
|
|
import pytest
|
2019-10-10 14:22:12 +07:00
|
|
|
import requests
|
2018-03-14 16:37:46 +07:00
|
|
|
|
2020-01-21 20:56:57 +07:00
|
|
|
@pytest.fixture()
|
2019-09-23 18:54:42 +07:00
|
|
|
def module():
|
|
|
|
return 'runbot_merge'
|
2019-10-10 14:22:12 +07:00
|
|
|
|
|
|
|
@pytest.fixture
|
|
|
|
def page(port):
|
|
|
|
s = requests.Session()
|
|
|
|
def get(url):
|
|
|
|
r = s.get('http://localhost:{}{}'.format(port, url))
|
|
|
|
r.raise_for_status()
|
|
|
|
return r.content
|
|
|
|
return get
|
|
|
|
|
|
|
|
@pytest.fixture
|
|
|
|
def default_crons():
|
|
|
|
return [
|
|
|
|
# env['runbot_merge.project']._check_fetch()
|
2019-11-20 20:57:40 +07:00
|
|
|
'runbot_merge.fetch_prs_cron',
|
2019-10-10 14:22:12 +07:00
|
|
|
# env['runbot_merge.commit']._notify()
|
|
|
|
'runbot_merge.process_updated_commits',
|
2020-02-07 17:52:42 +07:00
|
|
|
# env['runbot_merge.project']._check_stagings()
|
2019-10-10 14:22:12 +07:00
|
|
|
'runbot_merge.merge_cron',
|
2020-02-07 17:52:42 +07:00
|
|
|
# env['runbot_merge.project']._create_stagings()
|
|
|
|
'runbot_merge.staging_cron',
|
2019-10-10 14:22:12 +07:00
|
|
|
# env['runbot_merge.pull_requests']._check_linked_prs_statuses()
|
|
|
|
'runbot_merge.check_linked_prs_status',
|
2021-11-10 19:13:34 +07:00
|
|
|
# env['runbot_merge.pull_requests.feedback']._send()
|
2019-10-10 14:22:12 +07:00
|
|
|
'runbot_merge.feedback_cron',
|
|
|
|
]
|
|
|
|
|
|
|
|
@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'})],
|
2019-11-20 20:57:40 +07:00
|
|
|
})
|