tafia / quick-protobuf

A rust implementation of protobuf parser
MIT License
446 stars 82 forks source link

Unable to run tests #238

Open dignifiedquire opened 1 year ago

dignifiedquire commented 1 year ago

Trying to run tests with the run_test.sh I get quite a lot of failures: https://gist.github.com/dignifiedquire/c03ae16417f9f27fe4eabd1e5c823d7e

Running cargo test -p quick-protobuf also fails.

Any guidance how to run them locally would be appreciated.

snproj commented 1 year ago

Hi! Thanks for letting me know! I've just newly cloned the master branch and ran the run_test.sh script; seemed to work though, even after multiple times.

My procedure

git clone https://github.com/tafia/quick-protobuf.git
cd quick-protobuf/
./run_test.sh > runlog 2>&1  # log to runlog

Possible source of errors?

Click to expand contents of runlog ``` + cd quick-protobuf/tests/rust_protobuf + ./generate.sh v2/issue118-2.proto: ok v2/issue118.proto: ok v2/issue_170_a.proto: ok v2/issue_170_b.proto: ok v2/issue_170_c.proto: ok v2/issue_170_common.proto: ok v2/issue_170_d.proto: ok v2/issue_170_e.proto: ok v2/struct.proto: ok v2/test-sanitize-file-name_pb.proto: ok v2/test_basic_pb.proto: ok v2/test_comments.proto: ok v2/test_default_values_pb.proto: ok v2/test_deprecated_lifetime_can_compile.proto: ok v2/test_deprecated_lifetime_pb.proto: ok v2/test_enum_alias_pb.proto: enum alias not implemented v2/test_enum_invalid_default.proto: enum variant does not exist v2/test_enum_values_pb.proto: ok v2/test_expose_oneof_pb.proto: missing file v2/test_group_pb.proto: expected failure (empty read) v2/test_ident_pb.proto: ok v2/test_import_nested_imported_pb.proto: ok v2/test_import_nested_pb.proto: ok v2/test_import_nonunique_1_pb.proto: ok v2/test_import_nonunique_2_pb.proto: ok v2/test_import_nonunique_pb.proto: ok v2/test_import_pkg_nested_imported_pb.proto: ok v2/test_import_pkg_nested_pb.proto: ok v2/test_import_root_imported_pb.proto: ok v2/test_import_root_pb.proto: ok v2/test_lite_runtime_pb.proto: ok v2/test_name_resolution_p0.proto: ok v2/test_name_resolution_p1.proto: ok v2/test_name_resolution_p2.proto: ok v2/test_name_resolution_p3.proto: ok v2/test_name_resolution_p4.proto: ok v2/test_nested_basic_case_p0.proto: ok v2/test_nested_basic_case_p1.proto: ok v2/test_nested_p0.proto: ok v2/test_nested_p1.proto: ok v2/test_nested_p2.proto: ok v2/test_nested_p3.proto: ok v2/test_nonunique_enum_pb.proto: ok v2/test_oneof_pb.proto: ok v2/test_owned_pb.proto: ok v2/test_required_pb.proto: ok v2/test_root_pb.proto: ok v2/test_special~characters file{name}_pb.proto: ok v2/test_text_format_pb.proto: ok v2/vector_tile.proto: ok v3/test_basic_pb.proto: ok v3/test_comments.proto: ok v3/test_deprecated_lifetime_can_compile.proto: ok v3/test_deprecated_lifetime_pb.proto: ok v3/test_enum_alias_pb.proto: enum alias not implemented v3/test_enum_invalid_default.proto: enum variant does not exist v3/test_ident_pb.proto: ok v3/test_map_pb.proto: ok v3/test_oneof_pb.proto: ok v3/test_owned_pb.proto: ok common/mesos.proto: ok All files generated as expected +++ dirname ./generate_modules.sh ++ cd . ++ pwd + base_dir=/home/zhengyew.yong/temp/quick-protobuf + rm -r quick-protobuf/examples/pb_rs/data_types.rs quick-protobuf/examples/pb_rs/data_types_unit.rs quick-protobuf/examples/pb_rs/mod.rs quick-protobuf/examples/pb_rs/a + rm -r quick-protobuf/examples/pb_rs_v3/data_types.rs quick-protobuf/examples/pb_rs_v3/data_types_unit.rs quick-protobuf/examples/pb_rs_v3/mod.rs quick-protobuf/examples/pb_rs_v3/a + proto_sets=(perftest/src quick-protobuf/benches/perftest_data quick-protobuf/examples/pb_rs quick-protobuf/examples/pb_rs_v3 quick-protobuf/tests/packed_primitives quick-protobuf/tests/rust_protobuf/common) + nostd_proto_sets=(quick-protobuf/examples/pb_rs_nostd) + for ps in '"${proto_sets[@]}"' + cargo run -p pb-rs -- -I perftest/src -d perftest/src perftest/src/perftest_data.proto warning: manifest at `/home/zhengyew.yong/temp/quick-protobuf/perftest` contains `[project]` instead of `[package]`, this could become a hard error in the future Finished dev [unoptimized + debuginfo] target(s) in 0.03s Running `target/debug/pb-rs -I perftest/src -d perftest/src perftest/src/perftest_data.proto` Found 8 messages, and 0 enums Writing message perftest_data::Test1 Writing message perftest_data::TestRepeatedBool Writing message perftest_data::TestRepeatedPackedInt32 Writing message perftest_data::TestRepeatedMessages Writing message perftest_data::TestOptionalMessages Writing message perftest_data::TestStrings Writing message perftest_data::TestBytes Writing message perftest_data::PerftestData Writing Rpc PerftestService + for ps in '"${proto_sets[@]}"' + cargo run -p pb-rs -- -I quick-protobuf/benches/perftest_data -d quick-protobuf/benches/perftest_data quick-protobuf/benches/perftest_data/perftest_data.proto warning: manifest at `/home/zhengyew.yong/temp/quick-protobuf/perftest` contains `[project]` instead of `[package]`, this could become a hard error in the future Finished dev [unoptimized + debuginfo] target(s) in 0.03s Running `target/debug/pb-rs -I quick-protobuf/benches/perftest_data -d quick-protobuf/benches/perftest_data quick-protobuf/benches/perftest_data/perftest_data.proto` Found 10 messages, and 0 enums Writing message Test1 Writing message TestRepeatedBool Writing message TestRepeatedPackedInt32 Writing message TestRepeatedPackedFloat Writing message TestRepeatedMessages Writing message TestOptionalMessages Writing message TestStrings Writing message TestBytes Writing message TestMap Writing message PerftestData + for ps in '"${proto_sets[@]}"' + cargo run -p pb-rs -- -I quick-protobuf/examples/pb_rs -d quick-protobuf/examples/pb_rs quick-protobuf/examples/pb_rs/data_types.proto quick-protobuf/examples/pb_rs/data_types_import.proto quick-protobuf/examples/pb_rs/data_types_unit.proto warning: manifest at `/home/zhengyew.yong/temp/quick-protobuf/perftest` contains `[project]` instead of `[package]`, this could become a hard error in the future Finished dev [unoptimized + debuginfo] target(s) in 0.03s Running `target/debug/pb-rs -I quick-protobuf/examples/pb_rs -d quick-protobuf/examples/pb_rs quick-protobuf/examples/pb_rs/data_types.proto quick-protobuf/examples/pb_rs/data_types_import.proto quick-protobuf/examples/pb_rs/data_types_unit.proto` Found 4 messages, and 1 enums Writing enum FooEnum Writing message BarMessage Writing message FooMessage Writing message BazMessage Writing message mod_BazMessage::Nested Writing message mod_BazMessage::mod_Nested::NestedMessage Writing enum NestedEnum Found 1 messages, and 0 enums Writing message a::b::ImportedMessage Found 1 messages, and 1 enums Writing enum test Writing message unit_message + for ps in '"${proto_sets[@]}"' + cargo run -p pb-rs -- -I quick-protobuf/examples/pb_rs_v3 -d quick-protobuf/examples/pb_rs_v3 quick-protobuf/examples/pb_rs_v3/data_types.proto quick-protobuf/examples/pb_rs_v3/data_types_import.proto quick-protobuf/examples/pb_rs_v3/data_types_unit.proto warning: manifest at `/home/zhengyew.yong/temp/quick-protobuf/perftest` contains `[project]` instead of `[package]`, this could become a hard error in the future Finished dev [unoptimized + debuginfo] target(s) in 0.03s Running `target/debug/pb-rs -I quick-protobuf/examples/pb_rs_v3 -d quick-protobuf/examples/pb_rs_v3 quick-protobuf/examples/pb_rs_v3/data_types.proto quick-protobuf/examples/pb_rs_v3/data_types_import.proto quick-protobuf/examples/pb_rs_v3/data_types_unit.proto` Found 5 messages, and 1 enums Writing enum FooEnum Writing message BarMessage Writing message FooMessage Writing message BazMessage Writing message mod_BazMessage::Nested Writing message mod_BazMessage::mod_Nested::NestedMessage Writing enum NestedEnum Writing message RepeatedMessage Found 1 messages, and 0 enums Writing message a::b::ImportedMessage Found 1 messages, and 1 enums Writing enum test Writing message unit_message + for ps in '"${proto_sets[@]}"' + cargo run -p pb-rs -- -I quick-protobuf/tests/packed_primitives -d quick-protobuf/tests/packed_primitives quick-protobuf/tests/packed_primitives/person.proto warning: manifest at `/home/zhengyew.yong/temp/quick-protobuf/perftest` contains `[project]` instead of `[package]`, this could become a hard error in the future Finished dev [unoptimized + debuginfo] target(s) in 0.03s Running `target/debug/pb-rs -I quick-protobuf/tests/packed_primitives -d quick-protobuf/tests/packed_primitives quick-protobuf/tests/packed_primitives/person.proto` Found 3 messages, and 1 enums Writing enum City Writing message Address Writing message Person Writing message PersonPacked + for ps in '"${proto_sets[@]}"' + cargo run -p pb-rs -- -I quick-protobuf/tests/rust_protobuf/common -d quick-protobuf/tests/rust_protobuf/common quick-protobuf/tests/rust_protobuf/common/mesos.proto warning: manifest at `/home/zhengyew.yong/temp/quick-protobuf/perftest` contains `[project]` instead of `[package]`, this could become a hard error in the future Finished dev [unoptimized + debuginfo] target(s) in 0.03s Running `target/debug/pb-rs -I quick-protobuf/tests/rust_protobuf/common -d quick-protobuf/tests/rust_protobuf/common quick-protobuf/tests/rust_protobuf/common/mesos.proto` Found 86 messages, and 3 enums Writing enum Status Writing enum TaskState Writing enum OperationState Writing message mesos::v1::FrameworkID Writing message mesos::v1::OfferID Writing message mesos::v1::AgentID Writing message mesos::v1::TaskID Writing message mesos::v1::ExecutorID Writing message mesos::v1::ContainerID Writing message mesos::v1::ResourceProviderID Writing message mesos::v1::OperationID Writing message mesos::v1::TimeInfo Writing message mesos::v1::DurationInfo Writing message mesos::v1::Address Writing message mesos::v1::URL Writing message mesos::v1::Unavailability Writing message mesos::v1::MachineID Writing message mesos::v1::MachineInfo Writing enum Mode Writing message mesos::v1::FrameworkInfo Writing message mesos::v1::mod_FrameworkInfo::Capability Writing enum Type Writing message mesos::v1::CheckInfo Writing message mesos::v1::mod_CheckInfo::Command Writing message mesos::v1::mod_CheckInfo::Http Writing message mesos::v1::mod_CheckInfo::Tcp Writing enum Type Writing message mesos::v1::HealthCheck Writing message mesos::v1::mod_HealthCheck::HTTPCheckInfo Writing message mesos::v1::mod_HealthCheck::TCPCheckInfo Writing enum Type Writing message mesos::v1::KillPolicy Writing message mesos::v1::CommandInfo Writing message mesos::v1::mod_CommandInfo::URI Writing message mesos::v1::ExecutorInfo Writing enum Type Writing message mesos::v1::DomainInfo Writing message mesos::v1::mod_DomainInfo::FaultDomain Writing message mesos::v1::mod_DomainInfo::mod_FaultDomain::RegionInfo Writing message mesos::v1::mod_DomainInfo::mod_FaultDomain::ZoneInfo Writing message mesos::v1::MasterInfo Writing message mesos::v1::mod_MasterInfo::Capability Writing enum Type Writing message mesos::v1::AgentInfo Writing message mesos::v1::mod_AgentInfo::Capability Writing enum Type Writing message mesos::v1::CSIPluginContainerInfo Writing enum Service Writing message mesos::v1::CSIPluginInfo Writing message mesos::v1::ResourceProviderInfo Writing message mesos::v1::mod_ResourceProviderInfo::Storage Writing message mesos::v1::Value Writing message mesos::v1::mod_Value::Scalar Writing message mesos::v1::mod_Value::Range Writing message mesos::v1::mod_Value::Ranges Writing message mesos::v1::mod_Value::Set Writing message mesos::v1::mod_Value::Text Writing enum Type Writing message mesos::v1::Attribute Writing message mesos::v1::Resource Writing message mesos::v1::mod_Resource::AllocationInfo Writing message mesos::v1::mod_Resource::ReservationInfo Writing enum Type Writing message mesos::v1::mod_Resource::DiskInfo Writing message mesos::v1::mod_Resource::mod_DiskInfo::Persistence Writing message mesos::v1::mod_Resource::mod_DiskInfo::Source Writing message mesos::v1::mod_Resource::mod_DiskInfo::mod_Source::Path Writing message mesos::v1::mod_Resource::mod_DiskInfo::mod_Source::Mount Writing enum Type Writing message mesos::v1::mod_Resource::RevocableInfo Writing message mesos::v1::mod_Resource::SharedInfo Writing message mesos::v1::TrafficControlStatistics Writing message mesos::v1::IpStatistics Writing message mesos::v1::IcmpStatistics Writing message mesos::v1::TcpStatistics Writing message mesos::v1::UdpStatistics Writing message mesos::v1::SNMPStatistics Writing message mesos::v1::DiskStatistics Writing message mesos::v1::ResourceStatistics Writing message mesos::v1::ResourceUsage Writing message mesos::v1::mod_ResourceUsage::Executor Writing message mesos::v1::mod_ResourceUsage::mod_Executor::Task Writing message mesos::v1::PerfStatistics Writing message mesos::v1::Request Writing message mesos::v1::Offer Writing message mesos::v1::mod_Offer::Operation Writing message mesos::v1::mod_Offer::mod_Operation::Launch Writing message mesos::v1::mod_Offer::mod_Operation::LaunchGroup Writing message mesos::v1::mod_Offer::mod_Operation::Reserve Writing message mesos::v1::mod_Offer::mod_Operation::Unreserve Writing message mesos::v1::mod_Offer::mod_Operation::Create Writing message mesos::v1::mod_Offer::mod_Operation::Destroy Writing message mesos::v1::mod_Offer::mod_Operation::GrowVolume Writing message mesos::v1::mod_Offer::mod_Operation::ShrinkVolume Writing message mesos::v1::mod_Offer::mod_Operation::CreateDisk Writing message mesos::v1::mod_Offer::mod_Operation::DestroyDisk Writing enum Type Writing message mesos::v1::InverseOffer Writing message mesos::v1::TaskInfo Writing message mesos::v1::TaskGroupInfo Writing message mesos::v1::Task Writing message mesos::v1::TaskResourceLimitation Writing message mesos::v1::UUID Writing message mesos::v1::Operation Writing message mesos::v1::OperationStatus Writing message mesos::v1::CheckStatusInfo Writing message mesos::v1::mod_CheckStatusInfo::Command Writing message mesos::v1::mod_CheckStatusInfo::Http Writing message mesos::v1::mod_CheckStatusInfo::Tcp Writing message mesos::v1::TaskStatus Writing enum Source Writing enum Reason Writing message mesos::v1::Filters Writing message mesos::v1::Environment Writing message mesos::v1::mod_Environment::Variable Writing enum Type Writing message mesos::v1::Parameter Writing message mesos::v1::Parameters Writing message mesos::v1::Credential Writing message mesos::v1::Credentials Writing message mesos::v1::Secret Writing message mesos::v1::mod_Secret::Reference Writing message mesos::v1::mod_Secret::Value Writing enum Type Writing message mesos::v1::RateLimit Writing message mesos::v1::RateLimits Writing message mesos::v1::Image Writing message mesos::v1::mod_Image::Appc Writing message mesos::v1::mod_Image::Docker Writing enum Type Writing message mesos::v1::MountPropagation Writing enum Mode Writing message mesos::v1::Volume Writing message mesos::v1::mod_Volume::Source Writing message mesos::v1::mod_Volume::mod_Source::DockerVolume Writing message mesos::v1::mod_Volume::mod_Source::HostPath Writing message mesos::v1::mod_Volume::mod_Source::SandboxPath Writing enum Type Writing enum Type Writing enum Mode Writing message mesos::v1::NetworkInfo Writing message mesos::v1::mod_NetworkInfo::IPAddress Writing message mesos::v1::mod_NetworkInfo::PortMapping Writing enum Protocol Writing message mesos::v1::CapabilityInfo Writing enum Capability Writing message mesos::v1::LinuxInfo Writing message mesos::v1::RLimitInfo Writing message mesos::v1::mod_RLimitInfo::RLimit Writing enum Type Writing message mesos::v1::TTYInfo Writing message mesos::v1::mod_TTYInfo::WindowSize Writing message mesos::v1::ContainerInfo Writing message mesos::v1::mod_ContainerInfo::DockerInfo Writing message mesos::v1::mod_ContainerInfo::mod_DockerInfo::PortMapping Writing enum Network Writing message mesos::v1::mod_ContainerInfo::MesosInfo Writing enum Type Writing message mesos::v1::ContainerStatus Writing message mesos::v1::CgroupInfo Writing message mesos::v1::mod_CgroupInfo::Blkio Writing message mesos::v1::mod_CgroupInfo::mod_Blkio::Value Writing message mesos::v1::mod_CgroupInfo::mod_Blkio::CFQ Writing message mesos::v1::mod_CgroupInfo::mod_Blkio::mod_CFQ::Statistics Writing message mesos::v1::mod_CgroupInfo::mod_Blkio::Throttling Writing message mesos::v1::mod_CgroupInfo::mod_Blkio::mod_Throttling::Statistics Writing message mesos::v1::mod_CgroupInfo::mod_Blkio::Statistics Writing enum Operation Writing message mesos::v1::mod_CgroupInfo::NetCls Writing message mesos::v1::Labels Writing message mesos::v1::Label Writing message mesos::v1::Port Writing message mesos::v1::Ports Writing message mesos::v1::DiscoveryInfo Writing enum Visibility Writing message mesos::v1::WeightInfo Writing message mesos::v1::VersionInfo Writing message mesos::v1::Flag Writing message mesos::v1::Role Writing message mesos::v1::Metric Writing message mesos::v1::FileInfo Writing message mesos::v1::Device Writing message mesos::v1::mod_Device::Number Writing message mesos::v1::DeviceAccess Writing message mesos::v1::mod_DeviceAccess::Access Writing message mesos::v1::DeviceWhitelist + for ps in '"${nostd_proto_sets[@]}"' + cargo run -p pb-rs -- --nostd -I quick-protobuf/examples/pb_rs_nostd -d quick-protobuf/examples/pb_rs_nostd quick-protobuf/examples/pb_rs_nostd/no_std.proto warning: manifest at `/home/zhengyew.yong/temp/quick-protobuf/perftest` contains `[project]` instead of `[package]`, this could become a hard error in the future Finished dev [unoptimized + debuginfo] target(s) in 0.03s Running `target/debug/pb-rs --nostd -I quick-protobuf/examples/pb_rs_nostd -d quick-protobuf/examples/pb_rs_nostd quick-protobuf/examples/pb_rs_nostd/no_std.proto` Found 2 messages, and 1 enums Writing enum MyEnum Writing message protos::no_std::EmbeddedMessage Writing message protos::no_std::NoStdMessage + rm -rf quick-protobuf/examples/pb_rs_v3/owned + mkdir -p quick-protobuf/examples/pb_rs_v3/owned + cargo run -p pb-rs -- quick-protobuf/examples/pb_rs_v3/data_types.proto quick-protobuf/examples/pb_rs_v3/data_types_import.proto quick-protobuf/examples/pb_rs_v3/data_types_unit.proto -I quick-protobuf/examples/pb_rs_v3 --owned --output_directory quick-protobuf/examples/pb_rs_v3/owned warning: manifest at `/home/zhengyew.yong/temp/quick-protobuf/perftest` contains `[project]` instead of `[package]`, this could become a hard error in the future Finished dev [unoptimized + debuginfo] target(s) in 0.03s Running `target/debug/pb-rs quick-protobuf/examples/pb_rs_v3/data_types.proto quick-protobuf/examples/pb_rs_v3/data_types_import.proto quick-protobuf/examples/pb_rs_v3/data_types_unit.proto -I quick-protobuf/examples/pb_rs_v3 --owned --output_directory quick-protobuf/examples/pb_rs_v3/owned` Found 5 messages, and 1 enums Writing enum FooEnum Writing message BarMessage Writing message FooMessage Writing message BazMessage Writing message mod_BazMessage::Nested Writing message mod_BazMessage::mod_Nested::NestedMessage Writing enum NestedEnum Writing message RepeatedMessage Found 1 messages, and 0 enums Writing message a::b::ImportedMessage Found 1 messages, and 1 enums Writing enum test Writing message unit_message ~/temp/quick-protobuf/quick-protobuf ~/temp/quick-protobuf warning: manifest at `/home/zhengyew.yong/temp/quick-protobuf/perftest` contains `[project]` instead of `[package]`, this could become a hard error in the future Compiling proc-macro2 v1.0.47 Compiling serde v1.0.149 Compiling unicode-ident v1.0.5 Compiling quote v1.0.21 Compiling syn v1.0.105 Compiling serde_json v1.0.89 Compiling serde_derive v1.0.149 Compiling trybuild v1.0.72 Compiling itoa v1.0.4 Compiling ryu v1.0.11 Compiling glob v0.3.0 Compiling byteorder v1.4.3 Compiling once_cell v1.16.0 Compiling lazy_static v1.4.0 Compiling quick-protobuf v0.8.1 (/home/zhengyew.yong/temp/quick-protobuf/quick-protobuf) Compiling toml v0.5.9 Finished dev [unoptimized + debuginfo] target(s) in 9.41s Running `/home/zhengyew.yong/temp/quick-protobuf/target/debug/examples/pb_rs_example_v3_owned` Message written successfully! bytes=[8, 54, 48, 0, 56, 0, 122, 10, 73, 32, 115, 101, 101, 32, 121, 111, 117, 33, 130, 1, 25, 72, 101, 108, 108, 111, 32, 119, 111, 114, 108, 100, 32, 102, 114, 111, 109, 32, 101, 120, 97, 109, 112, 108, 101, 33, 178, 1, 2, 8, 1, 194, 1, 4, 10, 2, 8, 2, 200, 1, 2, 210, 1, 7, 10, 3, 102, 111, 111, 16, 1, 210, 1, 7, 10, 3, 98, 97, 114, 16, 2, 242, 1, 4, 103, 111, 97, 116, 242, 1, 7, 114, 117, 110, 110, 105, 110, 103, 250, 1, 15, 10, 4, 10, 2, 8, 2, 16, 10, 26, 5, 98, 111, 111, 109, 10, 216, 1, 2] FooMessage { f_int32: 54, f_int64: 0, f_uint32: 0, f_uint64: 0, f_sint32: 0, f_sint64: 0, f_bool: false, f_FooEnum: FIRST_VALUE, f_fixed64: 0, f_sfixed64: 0, f_fixed32: 0, f_sfixed32: 0, f_double: 0.0, f_float: 0.0, f_bytes: [73, 32, 115, 101, 101, 32, 121, 111, 117, 33], f_string: "Hello world from example!", f_self_message: None, f_bar_message: None, f_repeated_int32: [], f_repeated_packed_int32: [], f_repeated_packed_float: [], f_imported: Some(ImportedMessage { i: true }), f_baz: None, f_nested: Some(Nested { f_nested: Some(NestedMessage { f_nested: 2 }) }), f_nested_enum: Baz, f_map: {"foo": 1, "bar": 2}, f_repeated_string: ["goat", "running"], f_repeated_baz_message: [BazMessage { nested: Some(Nested { f_nested: Some(NestedMessage { f_nested: 2 }) }), b_int64: 10, b_string: "boom\n" }], test_oneof: f1(2) } Message read back and everything matches! warning: manifest at `/home/zhengyew.yong/temp/quick-protobuf/perftest` contains `[project]` instead of `[package]`, this could become a hard error in the future Compiling quick-protobuf v0.8.1 (/home/zhengyew.yong/temp/quick-protobuf/quick-protobuf) Finished dev [unoptimized + debuginfo] target(s) in 0.67s Running `/home/zhengyew.yong/temp/quick-protobuf/target/debug/examples/pb_rs_example` Message written successfully! Message read back and everything matches! FooMessage { f_int32: Some( 54, ), f_int64: None, f_uint32: None, f_uint64: None, f_sint32: None, f_sint64: 0, f_bool: false, f_FooEnum: None, f_fixed64: None, f_sfixed64: None, f_fixed32: 0, f_sfixed32: None, f_double: None, f_float: None, f_bytes: Some( [ 73, 32, 115, 101, 101, 32, 121, 111, 117, 33, ], ), f_string: Some( "Hello world from example!", ), f_self_message: None, f_bar_message: None, f_repeated_int32: [], f_repeated_packed_int32: [], f_repeated_packed_float: [], f_imported: Some( ImportedMessage { i: Some( true, ), }, ), f_baz: None, f_nested: Some( Nested { f_nested: NestedMessage { f_nested: 2, }, }, ), f_nested_enum: Some( Baz, ), f_map: { "foo": 1, "bar": 2, }, test_oneof: f1( 2, ), } warning: manifest at `/home/zhengyew.yong/temp/quick-protobuf/perftest` contains `[project]` instead of `[package]`, this could become a hard error in the future Compiling quick-protobuf v0.8.1 (/home/zhengyew.yong/temp/quick-protobuf/quick-protobuf) Finished dev [unoptimized + debuginfo] target(s) in 0.75s Running `/home/zhengyew.yong/temp/quick-protobuf/target/debug/examples/pb_rs_example_v3` Message written successfully! bytes=[119, 8, 54, 48, 0, 56, 0, 122, 10, 73, 32, 115, 101, 101, 32, 121, 111, 117, 33, 130, 1, 25, 72, 101, 108, 108, 111, 32, 119, 111, 114, 108, 100, 32, 102, 114, 111, 109, 32, 101, 120, 97, 109, 112, 108, 101, 33, 178, 1, 2, 8, 1, 194, 1, 4, 10, 2, 8, 2, 200, 1, 2, 210, 1, 7, 10, 3, 98, 97, 114, 16, 2, 210, 1, 7, 10, 3, 102, 111, 111, 16, 1, 242, 1, 4, 103, 111, 97, 116, 242, 1, 7, 114, 117, 110, 110, 105, 110, 103, 250, 1, 15, 10, 4, 10, 2, 8, 2, 16, 10, 26, 5, 98, 111, 111, 109, 10, 216, 1, 2] Message read back and everything matches! FooMessage { f_int32: 54, f_int64: 0, f_uint32: 0, f_uint64: 0, f_sint32: 0, f_sint64: 0, f_bool: false, f_FooEnum: FIRST_VALUE, f_fixed64: 0, f_sfixed64: 0, f_fixed32: 0, f_sfixed32: 0, f_double: 0.0, f_float: 0.0, f_bytes: [ 73, 32, 115, 101, 101, 32, 121, 111, 117, 33, ], f_string: "Hello world from example!", f_self_message: None, f_bar_message: None, f_repeated_int32: [], f_repeated_packed_int32: [], f_repeated_packed_float: [], f_imported: Some( ImportedMessage { i: true, }, ), f_baz: None, f_nested: Some( Nested { f_nested: Some( NestedMessage { f_nested: 2, }, ), }, ), f_nested_enum: Baz, f_map: { "foo": 1, "bar": 2, }, f_repeated_string: [ "goat", "running", ], f_repeated_baz_message: [ BazMessage { nested: Some( Nested { f_nested: Some( NestedMessage { f_nested: 2, }, ), }, ), b_int64: 10, b_string: "boom\n", }, ], test_oneof: f1( 2, ), } Message written successfully! bytes=[6, 10, 0, 10, 2, 8, 9] Message read back and everything matches! RepeatedMessage { bar_message: [ BarMessage { b_int32: 0, }, BarMessage { b_int32: 9, }, ], } warning: manifest at `/home/zhengyew.yong/temp/quick-protobuf/perftest` contains `[project]` instead of `[package]`, this could become a hard error in the future Compiling byteorder v1.4.3 Compiling quick-protobuf v0.8.1 (/home/zhengyew.yong/temp/quick-protobuf/quick-protobuf) Finished dev [unoptimized + debuginfo] target(s) in 0.80s Running `/home/zhengyew.yong/temp/quick-protobuf/target/debug/examples/pb_rs_example_nostd` ~/temp/quick-protobuf warning: manifest at `/home/zhengyew.yong/temp/quick-protobuf/perftest` contains `[project]` instead of `[package]`, this could become a hard error in the future Compiling same-file v1.0.6 Compiling quick-protobuf v0.8.1 (/home/zhengyew.yong/temp/quick-protobuf/quick-protobuf) Compiling walkdir v2.3.2 Compiling pb-rs v0.10.0 (/home/zhengyew.yong/temp/quick-protobuf/pb-rs) warning: unused variable: `e` --> quick-protobuf/tests/rust_protobuf/v2/issue_170.rs:30:9 | 30 | let e = E { | ^ help: if this is intentional, prefix it with an underscore: `_e` | = note: `#[warn(unused_variables)]` on by default warning: unused variable: `test_package_prefixed_field_names` --> quick-protobuf/tests/rust_protobuf/v2/test_name_resolution.rs:12:9 | 12 | let test_package_prefixed_field_names = | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_test_package_prefixed_field_names` warning: unused variable: `test_non_unique_package_prefixed_field_names` --> quick-protobuf/tests/rust_protobuf/v2/test_name_resolution.rs:17:9 | 17 | let test_non_unique_package_prefixed_field_names = | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_test_non_unique_package_prefixed_field_names` warning: unused variable: `test_absolute_field_names` --> quick-protobuf/tests/rust_protobuf/v2/test_name_resolution.rs:22:9 | 22 | let test_absolute_field_names = | ^^^^^^^^^^^^^^^^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_test_absolute_field_names` warning: unused variable: `should_use_internal_b` --> quick-protobuf/tests/rust_protobuf/v2/test_name_resolution.rs:27:9 | 27 | let should_use_internal_b = | ^^^^^^^^^^^^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_should_use_internal_b` warning: unused variable: `should_use_same_package_b` --> quick-protobuf/tests/rust_protobuf/v2/test_name_resolution.rs:32:9 | 32 | let should_use_same_package_b = | ^^^^^^^^^^^^^^^^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_should_use_same_package_b` warning: unused variable: `should_use_internal_b` --> quick-protobuf/tests/rust_protobuf/v2/test_name_resolution.rs:42:9 | 42 | let should_use_internal_b = super::test_name_resolution_p2::ShouldUseInternalB { | ^^^^^^^^^^^^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_should_use_internal_b` warning: unused variable: `should_use_same_package_b` --> quick-protobuf/tests/rust_protobuf/v2/test_name_resolution.rs:46:9 | 46 | let should_use_same_package_b = super::test_name_resolution_p2::ShouldUseSamePackageB { | ^^^^^^^^^^^^^^^^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_should_use_same_package_b` warning: unused variable: `should_use_internal_b` --> quick-protobuf/tests/rust_protobuf/v2/test_name_resolution.rs:53:9 | 53 | let should_use_internal_b = super::test_name_resolution_p3::ShouldUseInternalB { | ^^^^^^^^^^^^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_should_use_internal_b` warning: unused variable: `should_use_different_package_b` --> quick-protobuf/tests/rust_protobuf/v2/test_name_resolution.rs:57:9 | 57 | let should_use_different_package_b = | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_should_use_different_package_b` warning: unused variable: `should_use_same_package_b_despite_import` --> quick-protobuf/tests/rust_protobuf/v2/test_name_resolution.rs:65:9 | 65 | let should_use_same_package_b_despite_import = | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_should_use_same_package_b_despite_import` warning: unused variable: `w` --> quick-protobuf/tests/rust_protobuf/v2/test_nested_package_dir/basic/case/nested.rs:68:47 | 68 | fn write_message(&self, w: &mut Writer) -> Result<()> { | ^ help: if this is intentional, prefix it with an underscore: `_w` warning: unused variable: `w` --> quick-protobuf/tests/rust_protobuf/v3/test_deprecated_lifetime_pb.rs:40:47 | 40 | fn write_message(&self, w: &mut Writer) -> Result<()> { | ^ help: if this is intentional, prefix it with an underscore: `_w` warning: unused variable: `w` --> quick-protobuf/tests/rust_protobuf/v3/test_deprecated_lifetime_pb.rs:71:47 | 71 | fn write_message(&self, w: &mut Writer) -> Result<()> { | ^ help: if this is intentional, prefix it with an underscore: `_w` warning: unused variable: `w` --> quick-protobuf/tests/rust_protobuf/v3/test_deprecated_lifetime_pb.rs:117:47 | 117 | fn write_message(&self, w: &mut Writer) -> Result<()> { | ^ help: if this is intentional, prefix it with an underscore: `_w` warning: variable does not need to be mutable --> quick-protobuf/tests/rust_protobuf/v2/test_nested_package_dir/basic/case/nested.rs:52:13 | 52 | let mut msg = Self::default(); | ----^^^ | | | help: remove this `mut` | = note: `#[warn(unused_mut)]` on by default warning: variable does not need to be mutable --> quick-protobuf/tests/rust_protobuf/v3/test_deprecated_lifetime_pb.rs:24:13 | 24 | let mut msg = Self::default(); | ----^^^ | | | help: remove this `mut` warning: variable does not need to be mutable --> quick-protobuf/tests/rust_protobuf/v3/test_deprecated_lifetime_pb.rs:53:13 | 53 | let mut msg = Self::default(); | ----^^^ | | | help: remove this `mut` warning: variable does not need to be mutable --> quick-protobuf/tests/rust_protobuf/v3/test_deprecated_lifetime_pb.rs:101:13 | 101 | let mut msg = Self::default(); | ----^^^ | | | help: remove this `mut` warning: `quick-protobuf` (test "rust_proto") generated 19 warnings Finished test [unoptimized + debuginfo] target(s) in 3.58s Running unittests src/lib.rs (target/debug/deps/pb_rs-02d4d36d690b7475) running 21 tests test parser::test::comment_vs_other_whitespace_behaviour ... ok test parser::test::enum_comments ... ok test parser::test::empty_message ... ok test parser::test::enum_deprecated ... ok test parser::test::test_enum ... ok test parser::test::leading_comment ... ok test parser::test::test_ignore ... ok test parser::test::enum_semicolon ... ok test parser::test::test_message ... ok test parser::test::test_missing_tokens ... ok test parser::test::test_rpc_function ... ok test parser::test::test_word_and_qualifiable_names ... ok test parser::test::test_map ... ok test parser::test::test_which_names_can_be_qualified ... ok test parser::test::test_import ... ok test parser::test::test_rpc_service ... ok test parser::test::test_comments ... ok test parser::test::test_package ... ok test parser::test::test_reserved ... ok test parser::test::test_oneof ... ok test parser::test::test_nested_message ... ok test result: ok. 21 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s Running unittests src/main.rs (target/debug/deps/pb_rs-1283d5fa4d86e594) running 0 tests test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s Running unittests src/lib.rs (target/debug/deps/quick_protobuf-185bd5c11abfab8a) running 3 tests test reader::read_size_overflowing_unknown ... ok test reader::test_varint ... ok test writer::test_issue_222 ... ok test result: ok. 3 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s Running tests/rust_proto.rs (target/debug/deps/rust_proto-29b0d35c580e3685) running 67 tests test rust_protobuf::hex::test::test_decode_hex ... ok test rust_protobuf::v2::issue_170::t ... ok test rust_protobuf::hex::test::test_encode_hex ... ok test rust_protobuf::v2::test_basic::test1 ... ok test rust_protobuf::v2::test_basic::test2 ... ok test rust_protobuf::v2::test_basic::test3 ... ok test rust_protobuf::v2::test_basic::test4 ... ok test rust_protobuf::v2::test_basic::test_default_instance ... ok test rust_protobuf::v2::test_basic::test_bug_sint ... ok test rust_protobuf::v2::test_basic::test_empty ... ok test rust_protobuf::v2::test_basic::test_read_packed_expect_unpacked ... ok test rust_protobuf::v2::test_basic::test_read_unpacked_expect_packed ... ok test rust_protobuf::v2::test_basic::test_read_junk - should panic ... ok test rust_protobuf::v2::test_basic::test_truncated_middle_of_length_delimited ... ok test rust_protobuf::v2::test_basic::test_truncated_middle_of_varint ... ok test rust_protobuf::v2::test_basic::test_truncated_no_varint ... ok test rust_protobuf::v2::test_basic::test_truncated_repeated_packed ... ok test rust_protobuf::v2::test_basic::test_types_repeated ... ok test rust_protobuf::v2::test_basic::test_types_singular ... ok test rust_protobuf::v2::test_default_values_test::test_default_value_extreme ... ok test rust_protobuf::v2::test_basic::test_types_repeated_packed ... ok test rust_protobuf::v2::test_deprecated_lifetime::test_add_deprecated_lifetime ... ok test rust_protobuf::v2::test_default_values_test::test_default_value_simple ... ok test rust_protobuf::v2::test_name_resolution::test_p0 ... ok test rust_protobuf::v2::test_lite_runtime_test::test_lite_runtime ... ok test rust_protobuf::v2::test_name_resolution::test_p2 ... ok test rust_protobuf::v2::test_name_resolution::test_p3 ... ok test rust_protobuf::v2::test_oneof::test_simple ... ok test rust_protobuf::v2::test_oneof::test_types ... ok test rust_protobuf::v2::test_name_resolution::test_p4 ... ok test rust_protobuf::v2::test_required_test::test_read_missing_required ... ok test rust_protobuf::v2::test_oneof::test_types_v2 ... ok test rust_protobuf::v2::test_owned::test_owned_basic_functionality ... ok test rust_protobuf::v2::test_required_test::test_write_missing_required ... ok test rust_protobuf::v2::test_text_format::test_complex_message ... ok test rust_protobuf::v2::test_text_format::test_repeated_multiple ... ok test rust_protobuf::v2::test_text_format::test_repeated_one ... ok test rust_protobuf::v2::test_text_format::test_singular ... ok test rust_protobuf::v3::test_basic::test1 ... ok test rust_protobuf::v3::test_basic::test2 ... ok test rust_protobuf::v3::test_basic::test4 ... ok test rust_protobuf::v3::test_basic::test3 ... ok test rust_protobuf::v3::test_basic::test_default_instance ... ok test rust_protobuf::v3::test_basic::test_bug_sint ... ok test rust_protobuf::v2::test_sync::test_sync ... ok test rust_protobuf::v3::test_basic::test_empty ... ok test rust_protobuf::v3::test_basic::test_read_junk - should panic ... ok test rust_protobuf::v3::test_basic::test_read_packed_expect_unpacked ... ok test rust_protobuf::v3::test_basic::test_read_unpacked_expect_packed ... ok test rust_protobuf::v3::test_basic::test_truncated_middle_of_length_delimited ... ok test rust_protobuf::v3::test_basic::test_truncated_middle_of_varint ... ok test rust_protobuf::v3::test_basic::test_truncated_no_varint ... ok test rust_protobuf::v3::test_basic::test_truncated_repeated_packed ... ok test rust_protobuf::v3::test_basic::test_types_repeated ... ok test rust_protobuf::v3::test_basic::test_types_repeated_packed ... ok test rust_protobuf::v3::test_deprecated_lifetime::test_add_deprecated_lifetime ... ok test rust_protobuf::v3::test_basic::test_types_singular ... ok test rust_protobuf::v3::test_map::test_map_with_object ... ok test rust_protobuf::v3::test_map::test_map ... ok test rust_protobuf::v3::test_oneof::test_simple ... ok test rust_protobuf::v3::test_oneof::test_types ... ok test rust_protobuf::v3::test_oneof::test_types_v3 ... ok test rust_protobuf::v3::test_owned::test_owned_basic_functionality ... ok Checking byteorder v1.4.3 Checking lazy_static v1.4.0 Checking quick-protobuf v0.8.1 (/home/zhengyew.yong/temp/quick-protobuf/quick-protobuf) Checking quick-protobuf-tests v0.0.0 (/home/zhengyew.yong/temp/quick-protobuf/target/tests/quick-protobuf) Finished dev [unoptimized + debuginfo] target(s) in 0.83s test tests/rust_protobuf/v2/test_deprecated_lifetime_must_compile_error.rs ... ok  test rust_protobuf::v2::test_deprecated_lifetime::test_deprecated_lifetime ... ok Checking quick-protobuf-tests v0.0.0 (/home/zhengyew.yong/temp/quick-protobuf/target/tests/quick-protobuf) Finished dev [unoptimized + debuginfo] target(s) in 0.07s test tests/rust_protobuf/v2/test_owned_must_compile_error.rs ... ok  test rust_protobuf::v2::test_owned::test_owned ... ok Checking quick-protobuf-tests v0.0.0 (/home/zhengyew.yong/temp/quick-protobuf/target/tests/quick-protobuf) Finished dev [unoptimized + debuginfo] target(s) in 0.07s test tests/rust_protobuf/v3/test_deprecated_lifetime_must_compile_error.rs ... ok  test rust_protobuf::v3::test_deprecated_lifetime::test_owned ... ok Checking quick-protobuf-tests v0.0.0 (/home/zhengyew.yong/temp/quick-protobuf/target/tests/quick-protobuf) Finished dev [unoptimized + debuginfo] target(s) in 0.08s test tests/rust_protobuf/v3/test_owned_must_compile_error.rs ... ok  test rust_protobuf::v3::test_owned::test_owned ... ok test result: ok. 67 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 1.82s Running tests/write_read.rs (target/debug/deps/write_read-3c966c1e6c93e71b) running 26 tests test wr_bool ... ok test wr_bytes ... ok test wr_double ... ok test wr_enum ... ok test wr_fixed64 ... ok test wr_float ... ok test wr_fixed32 ... ok test wr_int64 ... ok test wr_int32 ... ok test wr_map ... ok test wr_message ... ok test wr_message_length_prefixed ... ok test wr_message_slice ... ok test wr_message_with_prefix_wrapper ... ok test wr_message_wo_prefix ... ok test wr_message_wo_prefix_wrapper ... ok test wr_packed_float ... ok test wr_packed_uint32 ... ok test wr_sfixed32 ... ok test wr_sfixed64 ... ok test wr_sint32 ... ok test wr_sint64 ... ok test wr_string ... ok test wr_u8 ... ok test wr_uint32 ... ok test wr_uint64 ... ok test result: ok. 26 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s Doc-tests pb-rs running 1 test test src/lib.rs - ConfigBuilder (line 15) - compile ... ok test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.04s Doc-tests quick-protobuf running 3 tests test src/reader.rs - reader::BytesReader (line 41) ... ok test src/writer.rs - writer::Writer (line 15) ... ok test src/reader.rs - reader::Reader (line 575) ... ok test result: ok. 3 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.20s ```

You might notice that there's a bunch of files generated at the start of my output that I don't see in your output; namely

+ cd quick-protobuf/tests/rust_protobuf
+ ./generate.sh
v2/issue118-2.proto: ok
v2/issue118.proto: ok
v2/issue_170_a.proto: ok
v2/issue_170_b.proto: ok
// etc etc etc...

Do you think you could let me know the leadup to how you ran the tests?

The test works by:

  1. First calling pb-rs to generate .rs files inside quick-protobuf/tests/rust_protobuf/v2 and quick-protobuf/tests/rust_protobuf/v3
  2. Running test scripts tin those same folders that rely on the generated .rs files.

From the error messages, it looks like some files have not been generated, which potentially lines up with the difference in output. The code that generates them is ultimately in quick-protobuf/tests/rust_protobuf/generate.sh.

dignifiedquire commented 1 year ago

Okay I think this might be because of OS issues. I was originally trying on macOS, running on my linux box, everything works out fine.

nyurik commented 1 year ago

seems like CI would catch all such issues. Ideally the tests should run with a simple cargo test -- that's what most Rust devs would expect. But in rare cases this is too hard to implement (e.g. if a database is required), in which case people have used just. I hope this repo can just use the cargo test without any extra steps, but I haven't looked in depth yet