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
Showing
- .gitlab-ci.yml 13 additions, 1 deletion.gitlab-ci.yml
- ci/prepare-rhgitaly 12 additions, 0 deletionsci/prepare-rhgitaly
- tests_with_gitaly/comparison.py 17 additions, 2 deletionstests_with_gitaly/comparison.py
- tests_with_gitaly/conftest.py 23 additions, 0 deletionstests_with_gitaly/conftest.py
- tests_with_gitaly/rhgitaly.py 48 additions, 0 deletionstests_with_gitaly/rhgitaly.py
- tests_with_gitaly/test_repository_service.py 9 additions, 2 deletionstests_with_gitaly/test_repository_service.py
- tests_with_gitaly/test_rhgitaly_server.py 28 additions, 0 deletionstests_with_gitaly/test_rhgitaly_server.py
Loading
Please register or sign in to comment