From ea257589d3e3fe4aa451bd5d7845b6feb456ae81 Mon Sep 17 00:00:00 2001 From: Florian Klink Date: Wed, 27 Mar 2024 12:18:06 +0100 Subject: refactor(tvix/store/pathinfo/from_addr): stop using gen_*_service Remove usage of the gen_{blob,directory}_service() helper functions from utils. We populate Memory{Blob,Directory}Services here directly, as test_case and rstest doesn't compose well. Change-Id: I0fb48aadb8c818f508b18ceb83c85eb91359442a Reviewed-on: https://cl.tvl.fyi/c/depot/+/11278 Reviewed-by: Connor Brewster Tested-by: BuildkiteCI --- tvix/store/src/pathinfoservice/from_addr.rs | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/tvix/store/src/pathinfoservice/from_addr.rs b/tvix/store/src/pathinfoservice/from_addr.rs index 142428768d..6109054d7a 100644 --- a/tvix/store/src/pathinfoservice/from_addr.rs +++ b/tvix/store/src/pathinfoservice/from_addr.rs @@ -121,9 +121,13 @@ pub async fn from_addr( mod tests { use super::from_addr; use lazy_static::lazy_static; + use std::sync::Arc; use tempfile::TempDir; use test_case::test_case; - use tvix_castore::utils::{gen_blob_service, gen_directory_service}; + use tvix_castore::{ + blobservice::{BlobService, MemoryBlobService}, + directoryservice::{DirectoryService, MemoryDirectoryService}, + }; lazy_static! { static ref TMPDIR_SLED_1: TempDir = TempDir::new().unwrap(); @@ -178,12 +182,11 @@ 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, exp_succeed: bool) { - let resp = from_addr( - uri_str, - gen_blob_service().into(), - gen_directory_service().into(), - ) - .await; + let blob_service: Arc = Arc::from(MemoryBlobService::default()); + let directory_service: Arc = + Arc::from(MemoryDirectoryService::default()); + + let resp = from_addr(uri_str, blob_service, directory_service).await; if exp_succeed { resp.expect("should succeed"); -- cgit 1.4.1