runbot/runbot_merge/tests
Xavier Morel f900eb68b6 [FIX] runbot_merge: my pager lied to me
Hopefully this is the last fix to the patcher. From the start of the
implementation I relied on the idea that `git show` was adding a line
composed of a single space (and a newline) before and after the patch
message, as that is what I observed in my terminal, and it's
consistent with RFC 3676 signatures (two dashes, a space, and a
newline).

Turns out that single space, while present in my terminal indeed, was
completely made up by `less(1)`. `git show` itself doesn't generate
that, neither does it appear when using most pagers, or even when
piping the output of `less` into something (a file, an other pager,
...). It's pretty much just something `less(1)` sends to a terminal
during interactive sessions to fuck with you.

Fixes #1037
2025-01-15 08:51:28 +01:00
..
conftest.py [FIX] project creation: handling of mergebot info 2024-12-02 16:32:53 +01:00
README.rst [IMP] runbot_merge: test readme & remove leftover pass 2018-09-03 13:16:36 +02:00
test_basic.py [IMP] *: modernise tests via to_pr 2024-12-02 16:32:53 +01:00
test_batch_consistency.py [IMP] runbot_merge: a PR can't be reopened if its batch is merged 2024-12-09 16:02:28 +01:00
test_by_branch.py [IMP] runbot_merge: minor simplification of test_by_branch 2024-12-09 16:02:28 +01:00
test_dfm.py [ADD] runbot_merge: rendering of PR descriptions 2024-07-15 10:28:28 +02:00
test_disabled_branch.py [IMP] *: modernise tests via to_pr 2024-12-02 16:32:53 +01:00
test_multirepo.py [FIX] project creation: handling of mergebot info 2024-12-02 16:32:53 +01:00
test_nondeterministic_failures.py [ADD] runbot_merge: basic support for false positive detection 2024-12-09 16:02:28 +01:00
test_oddities.py [ADD] runbot_merge: closing linked issues on merge 2024-12-09 16:02:28 +01:00
test_patching.py [FIX] runbot_merge: my pager lied to me 2025-01-15 08:51:28 +01:00
test_project_toggles.py [IMP] *: trigger-ify staging cron 2024-08-02 15:14:50 +02:00
test_provisioning.py [IMP] runbot_merge, forwardport: minor cleanups 2023-08-10 13:33:16 +02:00
test_staging.py [FIX] *: unstage on status going from success to failure 2024-09-18 15:19:13 +02:00
test_status_overrides.py [IMP] *: modernise tests via to_pr 2024-12-02 16:32:53 +01:00

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