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

Blob/Tree Gitaly Comparison test: switch to RpcHelper

The tests for `TreeEntry` and `GetTreeEntries` predate the
introduction of the `RpcHelper` class by a few months, and were
probably important in defining what we wanted to mutualize.

Switching these tests to `RpcHelper` makes them directly applicable to
`RHGitaly` when the time comes. The Blob/Tree methods are natural
candidates for oxidation, as it is obvious that they are too slow
in the Python implementation.

We had to overcome two challenges for this:

- Gitaly chunking being a bit non-deterministic in `TreeEntry`,
  we needed a way to compare streaming requests without comparing
  response by response. This now done by `RpcHelper.assert_compare_aggregated`,
  which takes care of the small data fields (`oid` and `mode` in the case
  of `TreeEntry`) with the common Gitaly pattern of providing them in
  the first response only. Two new hooks are to be registered in `RpcHelper`
  for this: one for the concatenation, one to remove the main data so that
  the small fields can be compared.
- To take pagination into account, we needed a way to expose the first
  response of each backend as they were before normalization removed
  the cursor information (which is backend-specific). Since the pagination
  subprotocol is meant to be used in several streaming gRPC methods,
  we'll probably provide this in `RpcHelper` itself in a second move.

In the process we're doing a more thorough job of comparing the `oid`
response fields, thanks to a normalizer that knows the mapping between
HGitaly and Gitaly OIDs.
parent eb5ffde1
No related branches found
No related tags found
1 merge request!141Better error compliance and comparison tests refactor
Pipeline #66403 failed
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