about summary refs log tree commit diff
path: root/tvix/store/src/proto/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tvix/store/src/proto/tests')
-rw-r--r--tvix/store/src/proto/tests/grpc_blobservice.rs12
-rw-r--r--tvix/store/src/proto/tests/grpc_directoryservice.rs29
-rw-r--r--tvix/store/src/proto/tests/grpc_pathinfoservice.rs9
3 files changed, 3 insertions, 47 deletions
diff --git a/tvix/store/src/proto/tests/grpc_blobservice.rs b/tvix/store/src/proto/tests/grpc_blobservice.rs
index b409fc3ea3c0..4ea367cbdc86 100644
--- a/tvix/store/src/proto/tests/grpc_blobservice.rs
+++ b/tvix/store/src/proto/tests/grpc_blobservice.rs
@@ -3,21 +3,11 @@ 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::fixtures::{BLOB_A, BLOB_A_DIGEST, BLOB_B, BLOB_B_DIGEST};
 use crate::tests::utils::{gen_blob_service, gen_chunk_service};
-use lazy_static::lazy_static;
 use std::path::Path;
 use tempfile::TempDir;
 
-lazy_static! {
-    // 2 bytes
-    static ref BLOB_A: Vec<u8> = vec![0x00, 0x01];
-    static ref BLOB_A_DIGEST: Vec<u8> = blake3::hash(&BLOB_A).as_bytes().to_vec();
-
-    // 1MB
-    static ref BLOB_B: Vec<u8> = (0..255).collect::<Vec<u8>>().repeat(4 * 1024);
-    static ref BLOB_B_DIGEST: Vec<u8> = blake3::hash(&BLOB_B).as_bytes().to_vec();
-}
-
 fn gen_grpc_blob_service(
     p: &Path,
 ) -> GRPCBlobServiceWrapper<
diff --git a/tvix/store/src/proto/tests/grpc_directoryservice.rs b/tvix/store/src/proto/tests/grpc_directoryservice.rs
index b004c47c2d22..6d9851111f17 100644
--- a/tvix/store/src/proto/tests/grpc_directoryservice.rs
+++ b/tvix/store/src/proto/tests/grpc_directoryservice.rs
@@ -3,40 +3,13 @@ use crate::proto::directory_service_server::DirectoryService as GRPCDirectorySer
 use crate::proto::get_directory_request::ByWhat;
 use crate::proto::{Directory, DirectoryNode, SymlinkNode};
 use crate::proto::{GRPCDirectoryServiceWrapper, GetDirectoryRequest};
+use crate::tests::fixtures::{DIRECTORY_A, DIRECTORY_B, DIRECTORY_C};
 use crate::tests::utils::gen_directory_service;
-use lazy_static::lazy_static;
 use std::path::Path;
 use tempfile::TempDir;
 use tokio_stream::StreamExt;
 use tonic::Status;
 
-lazy_static! {
-    static ref DIRECTORY_A: Directory = Directory::default();
-    static ref DIRECTORY_B: Directory = Directory {
-        directories: vec![DirectoryNode {
-            name: "a".to_string(),
-            digest: DIRECTORY_A.digest(),
-            size: DIRECTORY_A.size(),
-        }],
-        ..Default::default()
-    };
-    static ref DIRECTORY_C: Directory = Directory {
-        directories: vec![
-            DirectoryNode {
-                name: "a".to_string(),
-                digest: DIRECTORY_A.digest(),
-                size: DIRECTORY_A.size(),
-            },
-            DirectoryNode {
-                name: "a'".to_string(),
-                digest: DIRECTORY_A.digest(),
-                size: DIRECTORY_A.size(),
-            }
-        ],
-        ..Default::default()
-    };
-}
-
 fn gen_grpc_service(
     p: &Path,
 ) -> GRPCDirectoryServiceWrapper<impl DirectoryService + Send + Sync + Clone + 'static> {
diff --git a/tvix/store/src/proto/tests/grpc_pathinfoservice.rs b/tvix/store/src/proto/tests/grpc_pathinfoservice.rs
index a6a1de9dc4da..ce74711cb555 100644
--- a/tvix/store/src/proto/tests/grpc_pathinfoservice.rs
+++ b/tvix/store/src/proto/tests/grpc_pathinfoservice.rs
@@ -5,21 +5,14 @@ use crate::proto::path_info_service_server::PathInfoService as GRPCPathInfoServi
 use crate::proto::GRPCPathInfoServiceWrapper;
 use crate::proto::PathInfo;
 use crate::proto::{GetPathInfoRequest, Node, SymlinkNode};
+use crate::tests::fixtures::DUMMY_OUTPUT_HASH;
 use crate::tests::utils::{
     gen_blob_service, gen_chunk_service, gen_directory_service, gen_pathinfo_service,
 };
-use lazy_static::lazy_static;
 use std::path::Path;
 use tempfile::TempDir;
 use tonic::Request;
 
-lazy_static! {
-    static ref DUMMY_OUTPUT_HASH: Vec<u8> = vec![
-        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-        0x00, 0x00, 0x00, 0x00, 0x00
-    ];
-}
-
 /// generates a GRPCPathInfoService out of blob, chunk, directory and pathinfo services.
 ///
 /// We only interact with it via the PathInfo GRPC interface.