mirror of
https://github.com/odoo/runbot.git
synced 2025-03-27 13:25:47 +07:00
[REM] *: default_crons fixture
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.
This commit is contained in:
parent
3ee3e9cc81
commit
157657af49
@ -540,8 +540,8 @@ def server(request, db, port, module, addons_path, tmpdir):
|
|||||||
p.wait(timeout=30)
|
p.wait(timeout=30)
|
||||||
|
|
||||||
@pytest.fixture
|
@pytest.fixture
|
||||||
def env(request, port, server, db, default_crons):
|
def env(request, port, server, db):
|
||||||
yield Environment(port, db, default_crons)
|
yield Environment(port, db)
|
||||||
if request.node.get_closest_marker('expect_log_errors'):
|
if request.node.get_closest_marker('expect_log_errors'):
|
||||||
if b"Traceback (most recent call last):" not in server[1]:
|
if b"Traceback (most recent call last):" not in server[1]:
|
||||||
pytest.fail("should have found error in logs.")
|
pytest.fail("should have found error in logs.")
|
||||||
@ -1229,11 +1229,10 @@ class LabelsProxy(collections.abc.MutableSet):
|
|||||||
assert r.ok, r.text
|
assert r.ok, r.text
|
||||||
|
|
||||||
class Environment:
|
class Environment:
|
||||||
def __init__(self, port, db, default_crons=()):
|
def __init__(self, port, db):
|
||||||
self._uid = xmlrpc.client.ServerProxy('http://localhost:{}/xmlrpc/2/common'.format(port)).authenticate(db, 'admin', 'admin', {})
|
self._uid = xmlrpc.client.ServerProxy('http://localhost:{}/xmlrpc/2/common'.format(port)).authenticate(db, 'admin', 'admin', {})
|
||||||
self._object = xmlrpc.client.ServerProxy('http://localhost:{}/xmlrpc/2/object'.format(port))
|
self._object = xmlrpc.client.ServerProxy('http://localhost:{}/xmlrpc/2/object'.format(port))
|
||||||
self._db = db
|
self._db = db
|
||||||
self._default_crons = default_crons
|
|
||||||
|
|
||||||
def __call__(self, model, method, *args, **kwargs):
|
def __call__(self, model, method, *args, **kwargs):
|
||||||
return self._object.execute_kw(
|
return self._object.execute_kw(
|
||||||
@ -1255,7 +1254,7 @@ class Environment:
|
|||||||
|
|
||||||
|
|
||||||
def run_crons(self, *xids, **kw):
|
def run_crons(self, *xids, **kw):
|
||||||
crons = xids or self._default_crons
|
crons = xids or ['runbot_merge.check_linked_prs_status']
|
||||||
cron_ids = []
|
cron_ids = []
|
||||||
for xid in crons:
|
for xid in crons:
|
||||||
if xid is None:
|
if xid is None:
|
||||||
|
@ -4,12 +4,6 @@ import re
|
|||||||
import pytest
|
import pytest
|
||||||
import requests
|
import requests
|
||||||
|
|
||||||
@pytest.fixture
|
|
||||||
def default_crons():
|
|
||||||
return [
|
|
||||||
'runbot_merge.check_linked_prs_status',
|
|
||||||
]
|
|
||||||
|
|
||||||
# public_repo — necessary to leave comments
|
# public_repo — necessary to leave comments
|
||||||
# admin:repo_hook — to set up hooks (duh)
|
# admin:repo_hook — to set up hooks (duh)
|
||||||
# delete_repo — to cleanup repos created under a user
|
# delete_repo — to cleanup repos created under a user
|
||||||
|
@ -4,13 +4,6 @@ import pytest
|
|||||||
def module():
|
def module():
|
||||||
return 'runbot_merge'
|
return 'runbot_merge'
|
||||||
|
|
||||||
@pytest.fixture
|
|
||||||
def default_crons():
|
|
||||||
return [
|
|
||||||
# env['runbot_merge.pull_requests']._check_linked_prs_statuses()
|
|
||||||
'runbot_merge.check_linked_prs_status',
|
|
||||||
]
|
|
||||||
|
|
||||||
@pytest.fixture
|
@pytest.fixture
|
||||||
def project(env, config):
|
def project(env, config):
|
||||||
return env['runbot_merge.project'].create({
|
return env['runbot_merge.project'].create({
|
||||||
|
Loading…
Reference in New Issue
Block a user