[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:
Xavier Morel 2024-08-02 09:13:19 +02:00
parent 3ee3e9cc81
commit 157657af49
3 changed files with 4 additions and 18 deletions

View File

@ -540,8 +540,8 @@ def server(request, db, port, module, addons_path, tmpdir):
p.wait(timeout=30)
@pytest.fixture
def env(request, port, server, db, default_crons):
yield Environment(port, db, default_crons)
def env(request, port, server, db):
yield Environment(port, db)
if request.node.get_closest_marker('expect_log_errors'):
if b"Traceback (most recent call last):" not in server[1]:
pytest.fail("should have found error in logs.")
@ -1229,11 +1229,10 @@ class LabelsProxy(collections.abc.MutableSet):
assert r.ok, r.text
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._object = xmlrpc.client.ServerProxy('http://localhost:{}/xmlrpc/2/object'.format(port))
self._db = db
self._default_crons = default_crons
def __call__(self, model, method, *args, **kwargs):
return self._object.execute_kw(
@ -1255,7 +1254,7 @@ class Environment:
def run_crons(self, *xids, **kw):
crons = xids or self._default_crons
crons = xids or ['runbot_merge.check_linked_prs_status']
cron_ids = []
for xid in crons:
if xid is None:

View File

@ -4,12 +4,6 @@ import re
import pytest
import requests
@pytest.fixture
def default_crons():
return [
'runbot_merge.check_linked_prs_status',
]
# public_repo — necessary to leave comments
# admin:repo_hook — to set up hooks (duh)
# delete_repo — to cleanup repos created under a user

View File

@ -4,13 +4,6 @@ import pytest
def module():
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
def project(env, config):
return env['runbot_merge.project'].create({