[IMP] mergebot: allow running tests without verbose github logging

Mergebot & forwardbot have ultra-verbose logging of all github
interactions in order to better understand what happens exactly when
there are issues with gh integration (and/or provide to GH support).

However in most cases this is a pain in the ass when reviewing test
logs. So suppress these github_requests logs by default when testing.
This commit is contained in:
Xavier Morel 2020-01-27 12:44:41 +01:00
parent 1b9bd67776
commit bb2582ec29

View File

@ -67,6 +67,7 @@ NGROK_CLI = [
def pytest_addoption(parser):
parser.addoption('--addons-path')
parser.addoption("--no-delete", action="store_true", help="Don't delete repo after a failed run")
parser.addoption('--log-github', action='store_true')
parser.addoption(
'--tunnel', action="store", type="choice", choices=['ngrok', 'localtunnel'], default='ngrok',
@ -290,10 +291,14 @@ def port():
@pytest.fixture
def server(request, db, port, module):
opts = ['--log-handler', 'github_requests:WARNING']
if request.config.getoption('--log-github'):
opts = []
p = subprocess.Popen([
'odoo', '--http-port', str(port),
'--addons-path', request.config.getoption('--addons-path'),
'-d', db,
'-d', db, *opts,
'--max-cron-threads', '0', # disable cron threads (we're running crons by hand)
])