diff options
author | Yureka <tvl@yuka.dev> | 2024-07-23T13·32+0200 |
---|---|---|
committer | clbot <clbot@tvl.fyi> | 2024-07-23T14·04+0000 |
commit | 94a0e21e68e75c758d1df055890bde8b843fb5ef (patch) | |
tree | 73c2b574798ec6701c65851318cfed8ac32846a8 /tvix/castore/src/directoryservice/tests/mod.rs | |
parent | b9aa6456e22c562fbf849609112194d7ae7c1447 (diff) |
fix(tvix/directoryservice): clarify get_recursive not found r/8407
Change-Id: I47f21b4b7db9304eadb04094d41bf04d443fcc3b Reviewed-on: https://cl.tvl.fyi/c/depot/+/12025 Tested-by: BuildkiteCI Reviewed-by: flokli <flokli@flokli.de> Autosubmit: yuka <yuka@yuka.dev>
Diffstat (limited to 'tvix/castore/src/directoryservice/tests/mod.rs')
-rw-r--r-- | tvix/castore/src/directoryservice/tests/mod.rs | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/tvix/castore/src/directoryservice/tests/mod.rs b/tvix/castore/src/directoryservice/tests/mod.rs index cc3c5b788a2c..4d14fbea1a92 100644 --- a/tvix/castore/src/directoryservice/tests/mod.rs +++ b/tvix/castore/src/directoryservice/tests/mod.rs @@ -30,12 +30,25 @@ use self::utils::make_grpc_directory_service_client; #[cfg_attr(all(feature = "cloud", feature = "integration"), case::bigtable(directoryservice::from_addr("bigtable://instance-1?project_id=project-1&table_name=table-1&family_name=cf1").await.unwrap()))] pub fn directory_services(#[case] directory_service: impl DirectoryService) {} -/// Ensures asking for a directory that doesn't exist returns a Ok(None). +/// Ensures asking for a directory that doesn't exist returns a Ok(None), and a get_recursive +/// returns an empty stream. #[apply(directory_services)] #[tokio::test] async fn test_non_exist(directory_service: impl DirectoryService) { - let resp = directory_service.get(&DIRECTORY_A.digest()).await; - assert!(resp.unwrap().is_none()) + // single get + assert_eq!( + Ok(None), + directory_service.get(&DIRECTORY_A.digest()).await + ); + + // recursive get + assert_eq!( + Vec::<Result<proto::Directory, crate::Error>>::new(), + directory_service + .get_recursive(&DIRECTORY_A.digest()) + .collect::<Vec<Result<proto::Directory, crate::Error>>>() + .await + ); } /// Putting a single directory into the store, and then getting it out both via |