mirror of
https://github.com/odoo/runbot.git
synced 2025-03-15 15:35:46 +07:00
[IMP] *: rely only on triggers to run statuses propagation
The cron had been converted to using mostly triggers in
7cd9afe7f2
but I forgot to update
the *tests* to avoid explicitly triggering it.
This commit is contained in:
parent
dd17730f4c
commit
57a82235d9
@ -7,7 +7,6 @@ import requests
|
||||
@pytest.fixture
|
||||
def default_crons():
|
||||
return [
|
||||
'runbot_merge.process_updated_commits',
|
||||
'runbot_merge.merge_cron',
|
||||
'runbot_merge.staging_cron',
|
||||
'forwardport.port_forward',
|
||||
|
@ -597,7 +597,7 @@ def test_disapproval(env, config, make_repo, users):
|
||||
prod.post_status(pr2_id.head, 'success')
|
||||
pr2.post_comment('hansen r+', token=config['role_other']['token'])
|
||||
# no point creating staging for our needs, just propagate statuses
|
||||
env.run_crons('runbot_merge.process_updated_commits')
|
||||
env.run_crons(None)
|
||||
assert pr1_id.state == 'ready'
|
||||
assert pr2_id.state == 'ready'
|
||||
|
||||
|
@ -70,8 +70,8 @@
|
||||
<field name="model_id" ref="model_runbot_merge_commit"/>
|
||||
<field name="state">code</field>
|
||||
<field name="code">model._notify()</field>
|
||||
<field name="interval_number">30</field>
|
||||
<field name="interval_type">minutes</field>
|
||||
<field name="interval_number">6</field>
|
||||
<field name="interval_type">hours</field>
|
||||
<field name="numbercall">-1</field>
|
||||
<field name="doall" eval="False"/>
|
||||
<field name="priority">20</field>
|
||||
|
@ -9,8 +9,6 @@ def default_crons():
|
||||
return [
|
||||
# env['runbot_merge.project']._check_fetch()
|
||||
'runbot_merge.fetch_prs_cron',
|
||||
# env['runbot_merge.commit']._notify()
|
||||
'runbot_merge.process_updated_commits',
|
||||
# env['runbot_merge.project']._check_stagings()
|
||||
'runbot_merge.merge_cron',
|
||||
# env['runbot_merge.project']._create_stagings()
|
||||
|
@ -607,7 +607,7 @@ def test_timeout_bump_on_pending(env, repo, config):
|
||||
st.timeout_limit = old_timeout
|
||||
with repo:
|
||||
repo.post_status('staging.master', 'pending', 'ci/runbot')
|
||||
env.run_crons('runbot_merge.process_updated_commits')
|
||||
env.run_crons(None)
|
||||
assert st.timeout_limit > old_timeout
|
||||
|
||||
def test_staging_ci_failure_single(env, repo, users, config, page):
|
||||
@ -2463,7 +2463,7 @@ class TestPRUpdate(object):
|
||||
|
||||
env.run_crons()
|
||||
pr_id = to_pr(env, pr)
|
||||
env.run_crons('runbot_merge.process_updated_commits')
|
||||
env.run_crons(None)
|
||||
assert pr_id.message == 'title\n\nbody'
|
||||
assert pr_id.state == 'ready'
|
||||
old_reviewer = pr_id.reviewed_by
|
||||
@ -3008,7 +3008,7 @@ class TestBatching(object):
|
||||
reviewer=None,
|
||||
)
|
||||
pr02.post_comment('hansen alone r+', config['role_reviewer']['token'])
|
||||
env.run_crons('runbot_merge.process_updated_commits')
|
||||
env.run_crons(None)
|
||||
pr01_id = to_pr(env, pr01)
|
||||
assert pr01_id.blocked is False
|
||||
pr02_id = to_pr(env, pr02)
|
||||
@ -3077,7 +3077,7 @@ class TestBatching(object):
|
||||
with repo:
|
||||
repo.post_status('staging.master', 'success', 'ci/runbot')
|
||||
repo.post_status('staging.master', 'success', 'legal/cla')
|
||||
env.run_crons('runbot_merge.process_updated_commits', 'runbot_merge.merge_cron', 'runbot_merge.staging_cron')
|
||||
env.run_crons('runbot_merge.merge_cron', 'runbot_merge.staging_cron')
|
||||
assert pr2.state == 'merged'
|
||||
|
||||
class TestReviewing:
|
||||
|
@ -34,15 +34,15 @@ def test_status_applies(env, repo, config):
|
||||
|
||||
with repo:
|
||||
repo.post_status(c, 'success', 'ci')
|
||||
env.run_crons('runbot_merge.process_updated_commits')
|
||||
env.run_crons(None)
|
||||
assert pr_id.state == 'opened'
|
||||
with repo:
|
||||
repo.post_status(c, 'success', 'pr')
|
||||
env.run_crons('runbot_merge.process_updated_commits')
|
||||
env.run_crons(None)
|
||||
assert pr_id.state == 'opened'
|
||||
with repo:
|
||||
repo.post_status(c, 'success', 'lint')
|
||||
env.run_crons('runbot_merge.process_updated_commits')
|
||||
env.run_crons(None)
|
||||
assert pr_id.state == 'validated'
|
||||
|
||||
with repo:
|
||||
@ -53,15 +53,15 @@ def test_status_applies(env, repo, config):
|
||||
assert st.state == 'pending'
|
||||
with repo:
|
||||
repo.post_status('staging.master', 'success', 'ci')
|
||||
env.run_crons('runbot_merge.process_updated_commits')
|
||||
env.run_crons(None)
|
||||
assert st.state == 'pending'
|
||||
with repo:
|
||||
repo.post_status('staging.master', 'success', 'lint')
|
||||
env.run_crons('runbot_merge.process_updated_commits')
|
||||
env.run_crons(None)
|
||||
assert st.state == 'pending'
|
||||
with repo:
|
||||
repo.post_status('staging.master', 'success', 'staging')
|
||||
env.run_crons('runbot_merge.process_updated_commits')
|
||||
env.run_crons(None)
|
||||
assert st.state == 'success'
|
||||
|
||||
@pytest.mark.usefixtures('_setup_statuses')
|
||||
@ -84,11 +84,11 @@ def test_status_skipped(env, project, repo, config):
|
||||
|
||||
with repo:
|
||||
repo.post_status(c, 'success', 'ci')
|
||||
env.run_crons('runbot_merge.process_updated_commits')
|
||||
env.run_crons(None)
|
||||
assert pr_id.state == 'opened'
|
||||
with repo:
|
||||
repo.post_status(c, 'success', 'pr')
|
||||
env.run_crons('runbot_merge.process_updated_commits')
|
||||
env.run_crons(None)
|
||||
assert pr_id.state == 'validated'
|
||||
|
||||
with repo:
|
||||
@ -99,11 +99,11 @@ def test_status_skipped(env, project, repo, config):
|
||||
assert st.state == 'pending'
|
||||
with repo:
|
||||
repo.post_status('staging.maintenance', 'success', 'staging')
|
||||
env.run_crons('runbot_merge.process_updated_commits')
|
||||
env.run_crons(None)
|
||||
assert st.state == 'pending'
|
||||
with repo:
|
||||
repo.post_status('staging.maintenance', 'success', 'ci')
|
||||
env.run_crons('runbot_merge.process_updated_commits')
|
||||
env.run_crons(None)
|
||||
assert st.state == 'success'
|
||||
|
||||
def test_pseudo_version_tag(env, project, make_repo, setreviewers, config):
|
||||
|
@ -101,7 +101,7 @@ def test_staging_priority(env, project, repo, config, mode, cutoff, second):
|
||||
for pr, pr_id in zip(prs[cutoff:], pr_ids[cutoff:]):
|
||||
pr.post_comment('hansen r+', config['role_reviewer']['token'])
|
||||
repo.post_status(pr_id.head, 'success')
|
||||
env.run_crons('runbot_merge.process_updated_commits')
|
||||
env.run_crons(None)
|
||||
assert not pr_ids.filtered(lambda p: p.blocked)
|
||||
|
||||
# trigger a split
|
||||
@ -114,7 +114,7 @@ def test_staging_priority(env, project, repo, config, mode, cutoff, second):
|
||||
env[model].browse([cron_id]).write({
|
||||
'nextcall': (datetime.datetime.utcnow() + datetime.timedelta(minutes=10)).isoformat(" ", "seconds")
|
||||
})
|
||||
env.run_crons('runbot_merge.process_updated_commits', 'runbot_merge.merge_cron')
|
||||
env.run_crons('runbot_merge.merge_cron')
|
||||
assert not staging.active
|
||||
assert not env['runbot_merge.stagings'].search([]).active
|
||||
assert env['runbot_merge.split'].search_count([]) == 2
|
||||
|
Loading…
Reference in New Issue
Block a user