From 597a6b6205c3455ac92d816ad5e85af9615f6063 Mon Sep 17 00:00:00 2001 From: Florian Klink Date: Sun, 31 Dec 2023 23:33:41 +0200 Subject: refactor(tvix/castore/tests): let gen_*_service return Boxes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Only convert to and reuse an Arc<…> where needed. Change-Id: I2c1bc69cca5a4a3ebd3bdb33d6e28e1f5fb86cb9 Reviewed-on: https://cl.tvl.fyi/c/depot/+/10514 Tested-by: BuildkiteCI Autosubmit: flokli Reviewed-by: raitobezarius --- tvix/store/src/pathinfoservice/from_addr.rs | 7 ++++++- tvix/store/src/pathinfoservice/grpc.rs | 4 ++-- 2 files changed, 8 insertions(+), 3 deletions(-) (limited to 'tvix/store/src/pathinfoservice') diff --git a/tvix/store/src/pathinfoservice/from_addr.rs b/tvix/store/src/pathinfoservice/from_addr.rs index 922cd33515..73bb61bf2c 100644 --- a/tvix/store/src/pathinfoservice/from_addr.rs +++ b/tvix/store/src/pathinfoservice/from_addr.rs @@ -170,7 +170,12 @@ mod tests { #[test_case("grpc+http://localhost/some-path", false; "grpc valid invalid host and path")] #[tokio::test] async fn test_from_addr_tokio(uri_str: &str, is_ok: bool) { - let resp = from_addr(uri_str, gen_blob_service(), gen_directory_service()).await; + let resp = from_addr( + uri_str, + gen_blob_service().into(), + gen_directory_service().into(), + ) + .await; assert_eq!(resp.is_ok(), is_ok); } diff --git a/tvix/store/src/pathinfoservice/grpc.rs b/tvix/store/src/pathinfoservice/grpc.rs index 9a8599bce2..f05fe2c04d 100644 --- a/tvix/store/src/pathinfoservice/grpc.rs +++ b/tvix/store/src/pathinfoservice/grpc.rs @@ -151,8 +151,8 @@ mod tests { let router = server.add_service( crate::proto::path_info_service_server::PathInfoServiceServer::new( GRPCPathInfoServiceWrapper::new(Box::new(MemoryPathInfoService::new( - gen_blob_service(), - gen_directory_service(), + gen_blob_service().into(), + gen_directory_service().into(), )) as Box), ), -- cgit 1.4.1