[FIX] mergebot coverage

- add context, in case that allows tracking overlap between tests
  eventually
- use `-m` to run odoo, requires backporting `odoo/__main__.py`
  but I'm not quite sure how I was running it previously, possibly
  via odoo-bin? It certainly doesn't seem to work out with a global
  `odoo` helper
This commit is contained in:
Xavier Morel 2024-07-30 11:04:45 +02:00
parent cabab210de
commit 48d22b920a

View File

@ -451,7 +451,13 @@ def server(request, db, port, module, addons_path, tmpdir):
cov = []
if request.config.getoption('--coverage'):
cov = ['coverage', 'run', '-p', '--source=odoo.addons.runbot_merge,odoo.addons.forwardport', '--branch']
cov = [
'coverage', 'run',
'-p', '--branch',
'--source=odoo.addons.runbot_merge,odoo.addons.forwardport',
'--context', request.node.nodeid,
'-m',
]
r, w = os.pipe2(os.O_NONBLOCK)
buf = bytearray()