diff options
author | Florian Klink <flokli@flokli.de> | 2023-11-05T12·02+0200 |
---|---|---|
committer | flokli <flokli@flokli.de> | 2023-11-05T12·20+0000 |
commit | d660c5dec83e4eda9363bff924ebca171a49c82a (patch) | |
tree | 20dada36f0cb8d8de1029793ff2d21920a49e25a /tvix/store/src/tests/nar_renderer.rs | |
parent | 2546446d51bd42bf13ce4d17926742545813dc51 (diff) |
refactor(tvix/store/tests/nar_renderer): use castorepb consistently r/6947
Change-Id: I40f33044c838a7cfb9b3665fdea8e70e6886343e Reviewed-on: https://cl.tvl.fyi/c/depot/+/9953 Reviewed-by: raitobezarius <tvl@lahfa.xyz> Tested-by: BuildkiteCI
Diffstat (limited to 'tvix/store/src/tests/nar_renderer.rs')
-rw-r--r-- | tvix/store/src/tests/nar_renderer.rs | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/tvix/store/src/tests/nar_renderer.rs b/tvix/store/src/tests/nar_renderer.rs index b57b58ec52dd..b92739552ce7 100644 --- a/tvix/store/src/tests/nar_renderer.rs +++ b/tvix/store/src/tests/nar_renderer.rs @@ -5,9 +5,7 @@ use crate::tests::utils::*; use sha2::{Digest, Sha256}; use std::io; use tokio::io::sink; -use tvix_castore::proto::DirectoryNode; -use tvix_castore::proto::FileNode; -use tvix_castore::proto::{self as castorepb, SymlinkNode}; +use tvix_castore::proto as castorepb; #[tokio::test] async fn single_symlink() { @@ -15,7 +13,7 @@ async fn single_symlink() { write_nar( &mut buf, - &castorepb::node::Node::Symlink(SymlinkNode { + &castorepb::node::Node::Symlink(castorepb::SymlinkNode { name: "doesntmatter".into(), target: "/nix/store/somewhereelse".into(), }), @@ -34,7 +32,7 @@ async fn single_symlink() { async fn single_file_missing_blob() { let e = write_nar( sink(), - &castorepb::node::Node::File(FileNode { + &castorepb::node::Node::File(castorepb::FileNode { name: "doesntmatter".into(), digest: HELLOWORLD_BLOB_DIGEST.clone().into(), size: HELLOWORLD_BLOB_CONTENTS.len() as u64, @@ -79,7 +77,7 @@ async fn single_file_wrong_blob_size() { { let e = write_nar( sink(), - &castorepb::node::Node::File(FileNode { + &castorepb::node::Node::File(castorepb::FileNode { name: "doesntmatter".into(), digest: HELLOWORLD_BLOB_DIGEST.clone().into(), size: 42, // <- note the wrong size here! @@ -104,7 +102,7 @@ async fn single_file_wrong_blob_size() { { let e = write_nar( sink(), - &castorepb::node::Node::File(FileNode { + &castorepb::node::Node::File(castorepb::FileNode { name: "doesntmatter".into(), digest: HELLOWORLD_BLOB_DIGEST.clone().into(), size: 2, // <- note the wrong size here! @@ -147,7 +145,7 @@ async fn single_file() { write_nar( &mut buf, - &castorepb::node::Node::File(FileNode { + &castorepb::node::Node::File(castorepb::FileNode { name: "doesntmatter".into(), digest: HELLOWORLD_BLOB_DIGEST.clone().into(), size: HELLOWORLD_BLOB_CONTENTS.len() as u64, @@ -194,7 +192,7 @@ async fn test_complicated() { write_nar( &mut buf, - &castorepb::node::Node::Directory(DirectoryNode { + &castorepb::node::Node::Directory(castorepb::DirectoryNode { name: "doesntmatter".into(), digest: DIRECTORY_COMPLICATED.digest().into(), size: DIRECTORY_COMPLICATED.size(), @@ -211,7 +209,7 @@ async fn test_complicated() { let bs = blob_service.clone(); let ds = directory_service.clone(); let (nar_size, nar_digest) = calculate_size_and_sha256( - &castorepb::node::Node::Directory(DirectoryNode { + &castorepb::node::Node::Directory(castorepb::DirectoryNode { name: "doesntmatter".into(), digest: DIRECTORY_COMPLICATED.digest().into(), size: DIRECTORY_COMPLICATED.size(), |