diff options
author | Florian Klink <flokli@flokli.de> | 2023-02-13T17·58+0100 |
---|---|---|
committer | flokli <flokli@flokli.de> | 2023-03-10T10·58+0000 |
commit | 7fe7e03df32977da2bea7531a5142b24af971cf8 (patch) | |
tree | d722c164bce492ef6986d5f86d7ee790903438b1 /tvix/store/src/tests/path_info_service.rs | |
parent | 6b91efa5cf6d09e65dc06dfc56376b678eafa033 (diff) |
chore(tvix/store): remove old implementations r/5923
These were implementing against the (more complicated) gRPC interface, for which we now have a wrapper. Change-Id: I0a8284493718ab99618a1d21a76df4d173edb899 Reviewed-on: https://cl.tvl.fyi/c/depot/+/8100 Reviewed-by: raitobezarius <tvl@lahfa.xyz> Tested-by: BuildkiteCI
Diffstat (limited to 'tvix/store/src/tests/path_info_service.rs')
-rw-r--r-- | tvix/store/src/tests/path_info_service.rs | 67 |
1 files changed, 0 insertions, 67 deletions
diff --git a/tvix/store/src/tests/path_info_service.rs b/tvix/store/src/tests/path_info_service.rs deleted file mode 100644 index 42e6db36ca88..000000000000 --- a/tvix/store/src/tests/path_info_service.rs +++ /dev/null @@ -1,67 +0,0 @@ -use tempfile::TempDir; -use tonic::Request; - -use crate::proto::get_path_info_request::ByWhat::ByOutputHash; -use crate::proto::node::Node::Symlink; -use crate::proto::path_info_service_server::PathInfoService; -use crate::proto::PathInfo; -use crate::proto::{GetPathInfoRequest, Node, SymlinkNode}; -use crate::sled_path_info_service::SledPathInfoService; - -use lazy_static::lazy_static; - -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 - ]; -} - -/// Trying to get a non-existent PathInfo should return a not found error. -#[tokio::test] -async fn not_found() -> anyhow::Result<()> { - let service = SledPathInfoService::new(TempDir::new()?.path().to_path_buf())?; - - let resp = service - .get(Request::new(GetPathInfoRequest { - by_what: Some(ByOutputHash(DUMMY_OUTPUT_HASH.to_vec())), - })) - .await; - - let resp = resp.expect_err("must fail"); - assert_eq!(resp.code(), tonic::Code::NotFound); - - Ok(()) -} - -/// Put a PathInfo into the store, get it back. -#[tokio::test] -async fn put_get() -> anyhow::Result<()> { - let service = SledPathInfoService::new(TempDir::new()?.path().to_path_buf())?; - - let path_info = PathInfo { - node: Some(Node { - node: Some(Symlink(SymlinkNode { - name: "00000000000000000000000000000000-foo".to_string(), - target: "doesntmatter".to_string(), - })), - }), - ..Default::default() - }; - - let resp = service.put(Request::new(path_info.clone())).await; - - assert!(resp.is_ok()); - assert_eq!(resp.expect("must succeed").into_inner(), path_info); - - let resp = service - .get(Request::new(GetPathInfoRequest { - by_what: Some(ByOutputHash(DUMMY_OUTPUT_HASH.to_vec())), - })) - .await; - - assert!(resp.is_ok()); - assert_eq!(resp.expect("must succeed").into_inner(), path_info); - - Ok(()) -} |