mirror of
https://github.com/odoo/runbot.git
synced 2025-03-19 01:15:48 +07:00
![]() Previously, runbot_merge assumed github would return commits in topological order (from base to head of PR). However as in the UI github sorts commits using the author's date field, so depending on rebasing/cherrypick/... it's possible to have the head of the commit be "younger" than the rest. In that case robodoo will try to merge it *first*, then attempt to merge the rest on top of it (-ish, it'd probably make a hash of it if that worked), at which point github replies with a 204 (nothing to merge) because the PR head has already included everything which topologically precedes it. Fix: re-sort commits topologically when fetching the PR's log. That way they're rebased in the proper order and correctly linked to one another. Example problematic PR: odoo/enterprise#2794, the commits are 773aef03a59d50b33221d7cdcdf54cd0cbe0c914 author.date: 2018-10-01T14:58:38Z 879547c8dd37e7f413a97393a82f92377785b50b (parent: 773aef03) author.date: 2018-10-01T12:02:08Z Because 879547c8 is "older" than 773aef03, github returns it first, both in the UI and via the API. Also fixed up support for committer & author metadata in fake_github so the local tests would both expose the issue properly and allow fixing it. |
||
---|---|---|
.. | ||
fake_github | ||
conftest.py | ||
local.py | ||
README.rst | ||
remote.py | ||
test_basic.py | ||
test_multirepo.py | ||
test_utils.py |
Execute this test suite using pytest. The default mode is to run tests locally using a mock github.com. See the docstring of remote.py for instructions to run against github "actual" (including remote-specific options) and the end of this file for a sample. Shared properties running tests, regardless of the github implementation: * test should be run from the root of the runbot repository providing the name of this module aka ``pytest runbot_merge`` or ``python -mpytest runbot_merge`` * a database name to use must be provided using ``--db``, the database should not exist beforehand * the addons path must be specified using ``--addons-path``, both "runbot" and the standard addons (odoo/addons) must be provided explicitly See pytest's documentation for other options, I would recommend ``-rXs``, ``-v`` and ``--showlocals``. When running "remote" tests as they take a very long time (hours) ``-x`` (aka ``--maxfail=1``) and ``--ff`` (run previously failed first) is also recommended unless e.g. you run the tests overnight. ``pytest.ini`` sample --------------------- .. code:: ini [github] owner = test-org token = aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa [role_reviewer] name = Dick Bong user = loginb token = bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb [role_self_reviewer] name = Fanny Chmelar user = loginc token = cccccccccccccccccccccccccccccccccccccccc [role_other] name = Harry Baals user = logind token = dddddddddddddddddddddddddddddddddddddddd