Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 16 additions & 1 deletion lib/codecs/src/encoding/format/protobuf.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ impl ProtobufSerializerConfig {

/// The data type of events that are accepted by `ProtobufSerializer`.
pub fn input_type(&self) -> DataType {
DataType::Log.and(DataType::Trace)
DataType::Log
}

/// The schema required by the serializer.
Expand Down Expand Up @@ -234,12 +234,27 @@ mod tests {
};
}

fn test_data_dir() -> PathBuf {
PathBuf::from(std::env::var_os("CARGO_MANIFEST_DIR").unwrap()).join("tests/data/protobuf")
}

fn test_message_descriptor(message_type: &str) -> MessageDescriptor {
let path = PathBuf::from(std::env::var_os("CARGO_MANIFEST_DIR").unwrap())
.join("tests/data/protobuf/protos/test.desc");
get_message_descriptor(&path, &format!("test.{message_type}")).unwrap()
}

#[test]
fn test_config_input_type() {
let config = ProtobufSerializerConfig {
protobuf: ProtobufSerializerOptions {
desc_file: test_data_dir().join("test_protobuf.desc"),
message_type: "test_protobuf.Person".into(),
},
};
assert_eq!(config.input_type(), DataType::Log);
}

#[test]
fn test_encode_integers() {
let message = encode_message(
Expand Down