diff options
author | Florian Klink <flokli@flokli.de> | 2024-03-20T20·36+0200 |
---|---|---|
committer | flokli <flokli@flokli.de> | 2024-03-28T07·58+0000 |
commit | 74023a07a4b3d8e99645217b04683c0e54e23be8 (patch) | |
tree | e5c7f42540efe6dc94666e2694031b14ccd6715b /tvix/build/src | |
parent | 05d3f21eaf0834d44b6f32a49ae3276ebcb6571c (diff) |
refactor(tvix/castore/*): drop utils.rs and grpc directorysvc tests r/7795
This drops pretty much all of castore/utils.rs. There were only two things left in there, both a bit messy and only used for tests: Some `gen_*_service()` helper functions. These can be expressed by `from_addr("memory://")`. The other thing was some plumbing code to test the gRPC layer, by exposing a in-memory implementation via gRPC, and then connecting to that channel via a gRPC client again. Previous CLs moved the connection setup code to {directory,blob}service::tests::utils, close to where we exercise them, the new rstest-based tests. The tests interacting directly on the gRPC types are removed, all scenarios that were in there show now be covered through the rstest ones on the trait level. Change-Id: I450ccccf983b4c62145a25d81c36a40846664814 Reviewed-on: https://cl.tvl.fyi/c/depot/+/11223 Reviewed-by: Connor Brewster <cbrewster@hey.com> Tested-by: BuildkiteCI
Diffstat (limited to 'tvix/build/src')
-rw-r--r-- | tvix/build/src/buildservice/from_addr.rs | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/tvix/build/src/buildservice/from_addr.rs b/tvix/build/src/buildservice/from_addr.rs index ee2b4e50b4da..f5c4e6a490bb 100644 --- a/tvix/build/src/buildservice/from_addr.rs +++ b/tvix/build/src/buildservice/from_addr.rs @@ -51,7 +51,10 @@ mod tests { use super::from_addr; use test_case::test_case; - use tvix_castore::utils::{gen_blob_service, gen_directory_service}; + use tvix_castore::{ + blobservice::{BlobService, MemoryBlobService}, + directoryservice::{DirectoryService, MemoryDirectoryService}, + }; /// This uses an unsupported scheme. #[test_case("http://foo.example/test", false; "unsupported scheme")] @@ -71,14 +74,13 @@ mod tests { #[test_case("grpc+http://localhost/some-path", false; "grpc valid invalid host and path")] #[tokio::test] async fn test_from_addr(uri_str: &str, is_ok: bool) { + let blob_service: Arc<dyn BlobService> = Arc::from(MemoryBlobService::default()); + let directory_service: Arc<dyn DirectoryService> = + Arc::from(MemoryDirectoryService::default()); assert_eq!( - from_addr( - uri_str, - Arc::from(gen_blob_service()), - Arc::from(gen_directory_service()) - ) - .await - .is_ok(), + from_addr(uri_str, blob_service, directory_service) + .await + .is_ok(), is_ok ) } |