Skip to content
Snippets Groups Projects
Commit 69cb7195 authored by Georges Racinet's avatar Georges Racinet
Browse files

RHGitaly: Gitaly comparison tests

We chose to compare RHGitaly with Gitaly rather than with HGitaly
because it's not impossible that we stop at some point maintaining
some methods in the Python code (time will tell).

It is likely that we'll end up implementing some of the HGitaly-specific
methods in RHGitaly (e.g. reading phases, topics and whatnot). In that
case we'll need comparison between HGitaly and RHGitaly, but that
will be some much simpler (no correspondence of Git content) that we
will provide it directly.

This fully hooked in CI/CD. We had to anyway: otherwise the new test would
not pass.

Implementation details
----------------------

We add the capability to start RHGitaly, with a simple `cargo run`.
This is validated independently by `test_rhgitaly_server` (homologous
to `test_gitaly_server`).

The `GitalyComparison` class (of which the `gitaly_comparison` fixture
is an instance) now gains an optional `rhgitaly_channel`, which is set
and exposed in the new `gitaly_rhgitaly_comparison` fixture.

Finally, using `rhgitaly_channel` rather than `hgitaly_channel` is
left to the `RPCHelper` class, with its `hg_server` argument.
Since it is instantiated from inside the tests, it is easy to
pass `hg_server` down from a parametrization, reaching the end goal: the
very same test is run for HGitaly and RHGitaly, compared in both
cases with Gitaly. This is illustrated in the test for `RepositoryExists`.

Two annoyances had to be taken care of:

- we need to ignore the `rust/` directory in `run-all-tests` because
  it makes pytest collection crazy (hangs forever) due at least in part
  to Mercurial full source being present by default in `rust/dependencies`
- Tonic seems to add trailing metadata that Gitaly does not. We had
  to remove them in `assert_compare_errors()`.

CI/CD assumptions
-----------------

The base image `heptapod-gitaly` is now expected to provide
- the Rust toolchain
- a clone of Mercurial sources. It can be daily or weekly, we
  make a share and update it
- `rust-protobuf`: could be trimmed, as we only need
  the protocol files and don't need to update them for each build
parent d6853d85
No related branches found
No related tags found
3 merge requests!151heptapod#743: making 0.36 the new stable,!144RHGitaly: implement CommitService.ListCommitsByOid,!140Bootstrapping RHGitaly
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment