diff options
author | Florian Klink <flokli@flokli.de> | 2023-02-27T07·59+0100 |
---|---|---|
committer | flokli <flokli@flokli.de> | 2023-03-10T10·58+0000 |
commit | 28a862976bd43912e0e5dc16e8919590c36f4cf0 (patch) | |
tree | f6e6fb7eac5145c9519ff8399a14ab1733a75c66 /tvix/store/src/proto/tests/grpc_blobservice.rs | |
parent | 0baaabc43e3027b1676874c536d5ade27abe14b8 (diff) |
refactor(tvix/store/tests): move gen_*_service() into helper r/5928
This allows hiding to tests what exact implementation we're using, when testing things that do something with a store, but don't care what's used for underlying storage. Change-Id: I7cdf60fd73c25d5050159cb31ec177db2bc2a7f1 Reviewed-on: https://cl.tvl.fyi/c/depot/+/8155 Tested-by: BuildkiteCI Reviewed-by: raitobezarius <tvl@lahfa.xyz>
Diffstat (limited to 'tvix/store/src/proto/tests/grpc_blobservice.rs')
-rw-r--r-- | tvix/store/src/proto/tests/grpc_blobservice.rs | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/tvix/store/src/proto/tests/grpc_blobservice.rs b/tvix/store/src/proto/tests/grpc_blobservice.rs index cd8ae3e2bf8b..b409fc3ea3c0 100644 --- a/tvix/store/src/proto/tests/grpc_blobservice.rs +++ b/tvix/store/src/proto/tests/grpc_blobservice.rs @@ -1,8 +1,9 @@ -use crate::blobservice::{BlobService, SledBlobService}; -use crate::chunkservice::{ChunkService, SledChunkService}; +use crate::blobservice::BlobService; +use crate::chunkservice::ChunkService; use crate::proto::blob_meta::ChunkMeta; use crate::proto::blob_service_server::BlobService as GRPCBlobService; use crate::proto::{BlobChunk, GRPCBlobServiceWrapper, ReadBlobRequest, StatBlobRequest}; +use crate::tests::utils::{gen_blob_service, gen_chunk_service}; use lazy_static::lazy_static; use std::path::Path; use tempfile::TempDir; @@ -23,8 +24,8 @@ fn gen_grpc_blob_service( impl BlobService + Send + Sync + Clone + 'static, impl ChunkService + Send + Sync + Clone + 'static, > { - let blob_service = SledBlobService::new(p.join("blobs")).unwrap(); - let chunk_service = SledChunkService::new(p.join("chunks")).unwrap(); + let blob_service = gen_blob_service(p); + let chunk_service = gen_chunk_service(p); GRPCBlobServiceWrapper::new(blob_service, chunk_service) } |