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
Loading
Please register or sign in to comment