about summary refs log tree commit diff
path: root/tvix/castore/src/proto/tests/grpc_directoryservice.rs
diff options
context:
space:
mode:
authorFlorian Klink <flokli@flokli.de>2023-10-08T09·31+0200
committerclbot <clbot@tvl.fyi>2023-10-08T21·53+0000
commitc847cc32d99d214a8454df0d0c17c5f6ad9e6bd8 (patch)
treef6704f18db8546d35bfdb1eb68945f12a6e76071 /tvix/castore/src/proto/tests/grpc_directoryservice.rs
parente778a33710c01d1320e2cd36c0ebcf668ea0fcc4 (diff)
refactor(tvix/castore): move tests to grpc client, rm tonic-mock r/6735
Similar to gen_directorysvc_grpc_client, introduce a
gen_blobsvc_grpc_client function that provides a gRPC client connected
to a blobservice.

The test is update to use that client to test against, rather than the
server trait, removing the last usage of tonic_mock, so it's removed
as well.

Fixes b/243.

Change-Id: If746e8600588da247eb53a63b70fe72f139e9e77
Reviewed-on: https://cl.tvl.fyi/c/depot/+/9564
Tested-by: BuildkiteCI
Reviewed-by: tazjin <tazjin@tvl.su>
Reviewed-by: Connor Brewster <cbrewster@hey.com>
Autosubmit: flokli <flokli@flokli.de>
Diffstat (limited to 'tvix/castore/src/proto/tests/grpc_directoryservice.rs')
-rw-r--r--tvix/castore/src/proto/tests/grpc_directoryservice.rs8
1 files changed, 3 insertions, 5 deletions
diff --git a/tvix/castore/src/proto/tests/grpc_directoryservice.rs b/tvix/castore/src/proto/tests/grpc_directoryservice.rs
index 4262ab6da750..e443b4b1916a 100644
--- a/tvix/castore/src/proto/tests/grpc_directoryservice.rs
+++ b/tvix/castore/src/proto/tests/grpc_directoryservice.rs
@@ -16,9 +16,7 @@ async fn get_directories(
     grpc_client: &mut DirectoryServiceClient<Channel>,
     get_directory_request: GetDirectoryRequest,
 ) -> Result<Vec<Directory>, Status> {
-    let resp = grpc_client
-        .get(tonic::Request::new(get_directory_request))
-        .await;
+    let resp = grpc_client.get(get_directory_request).await;
 
     // if the response is an error itself, return the error, otherwise unpack
     let stream = match resp {
@@ -39,10 +37,10 @@ async fn not_found() {
     let mut grpc_client = gen_directorysvc_grpc_client().await;
 
     let resp = grpc_client
-        .get(tonic::Request::new(GetDirectoryRequest {
+        .get(GetDirectoryRequest {
             by_what: Some(ByWhat::Digest(DIRECTORY_A.digest().into())),
             ..Default::default()
-        }))
+        })
         .await;
 
     let stream = resp.expect("must succeed").into_inner();