Commit ef083a78 authored by Georges Racinet's avatar Georges Racinet 🦑

WIP demo testhelpers: translating a half of test-revset.t

This corresponds to test-revset.t until this comment:
"Test smartset.slice() by first/last()"

On my workstation, the truncated test-revset.t takes 25-30 seconds to run:

    $ time ./ -l test-revset.t
    running 1 tests using 1 parallel processes
    # Ran 1 tests, 0 skipped, 0 failed.
    ./ -l test-revset.t  28.51s user 4.03s system 98% cpu 32.869 total

This translation runs in 0.3 seconds

    (venv3) ~/heptapod/hdk/default/py-heptapod $ pytest heptapod/tests/
    =========================== test session starts ===========================
    platform linux -- Python 3.8.6, pytest-3.10.1, py-1.9.0, pluggy-0.13.1
    rootdir: /home/gracinet/heptapod/hdk/default/py-heptapod, inifile: pytest.ini
    plugins: cov-2.6.0, grpc-0.8.0
    collected 1 item

    heptapod/tests/ .                    [100%]

    ============================ warnings summary =============================
      /home/gracinet/heptapod/hdk/default/venv3/lib/python3.8/site-packages/mercurial/utils/ DeprecationWarning: invalid escape sequence '\d'
        return codecs.escape_decode(s)[0]
      /home/gracinet/heptapod/hdk/default/venv3/lib/python3.8/site-packages/mercurial/utils/ DeprecationWarning: invalid escape sequence '\d'
        return codecs.escape_decode(s)[0]

    -- Docs:
    ================== 1 passed, 2 warnings in 0.28 seconds ===================

Remarks and caveats:

  - we're not making assertions about internal representation of the revsets,
    especially to check optimizations. Arguably, these could belong to another
    test case
  - ignored tests related to `r3232`. Don't expect them to be a problem.
  - time to run was almost the same with only a dozen assertions. Could mean
    that most of the time is spent in the fixture. On the other side, the
    truncated `test-revset.t` is faster than the whole (28s vs 59s).
parent 62c5b7e44fa5
Pipeline #13074 passed with stages
in 1 minute and 26 seconds