From a5e66d8008e1feef57e53b5efef32ea0cc70d15d Mon Sep 17 00:00:00 2001 From: xxchan Date: Thu, 12 Sep 2024 16:46:23 +0800 Subject: [PATCH] more fix test Signed-off-by: xxchan --- Cargo.lock | 1 + src/connector/Cargo.toml | 1 + src/connector/src/sink/encoder/proto.rs | 8 ++++---- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 359a697ccc20..b6b24abe68ed 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -10611,6 +10611,7 @@ dependencies = [ "easy-ext", "enum-as-inner 0.6.0", "expect-test", + "fs-err", "futures", "futures-async-stream", "gcp-bigquery-client", diff --git a/src/connector/Cargo.toml b/src/connector/Cargo.toml index cec6e51a6d47..639347080e1e 100644 --- a/src/connector/Cargo.toml +++ b/src/connector/Cargo.toml @@ -193,6 +193,7 @@ assert_matches = "1" criterion = { workspace = true, features = ["async_tokio", "async"] } deltalake = { workspace = true, features = ["datafusion"] } expect-test = "1" +fs-err = "2" paste = "1" pretty_assertions = "1" quote = "1" diff --git a/src/connector/src/sink/encoder/proto.rs b/src/connector/src/sink/encoder/proto.rs index 625a873739ab..ce6e8503b624 100644 --- a/src/connector/src/sink/encoder/proto.rs +++ b/src/connector/src/sink/encoder/proto.rs @@ -440,7 +440,7 @@ mod tests { #[test] fn test_encode_proto_ok() { let pool_path = std::path::Path::new(env!("CARGO_MANIFEST_DIR")) - .join("src/codec/tests/test_data/all-types.pb"); + .join("codec/tests/test_data/all-types.pb"); let pool_bytes = std::fs::read(pool_path).unwrap(); let pool = prost_reflect::DescriptorPool::decode(pool_bytes.as_ref()).unwrap(); let descriptor = pool.get_message_by_name("all_types.AllTypes").unwrap(); @@ -495,7 +495,7 @@ mod tests { // Hint: write the binary output to a file `test.binpb`, and view it with `protoc`: // ``` // protoc --decode_raw < test.binpb - // protoc --decode=all_types.AllTypes recursive.proto < test.binpb + // protoc --decode=all_types.AllTypes all-types.proto < test.binpb // ``` [ 9, 0, 0, 0, 0, 0, 0, 17, 64, 21, 0, 0, 96, 64, 24, 22, 32, 23, 56, 48, 93, 26, 0, @@ -509,8 +509,8 @@ mod tests { #[test] fn test_encode_proto_repeated() { let pool_path = std::path::Path::new(env!("CARGO_MANIFEST_DIR")) - .join("src/test_data/proto_recursive/recursive.pb"); - let pool_bytes = std::fs::read(pool_path).unwrap(); + .join("codec/tests/test_data/all-types.pb"); + let pool_bytes = fs_err::read(pool_path).unwrap(); let pool = prost_reflect::DescriptorPool::decode(pool_bytes.as_ref()).unwrap(); let message_descriptor = pool.get_message_by_name("all_types.AllTypes").unwrap();