diff --git a/cmd/conformance/core.lua b/cmd/conformance/core.lua index c2d30cd79d36ef4b46f496ebe0dce210ccf18cc2..a81fbe91fddb0072178b9a7e2bfba18596f93254 100644 --- a/cmd/conformance/core.lua +++ b/cmd/conformance/core.lua @@ -11,23 +11,27 @@ local pb = require('pb') local conformance = require('full.conformance.conformance_pb') local proto3_tests = require('full.protobuf_test_messages.proto3.test_messages_proto3_pb') +local proto2_tests = require('full.protobuf_test_messages.proto2.test_messages_proto2_pb') local M = {} -- Map of supported `message_type` -> descriptor. Any other message type -- yields a `skipped` response so we don't claim conformance for protos we --- don't actually support yet (proto2, editions). +-- don't actually support yet (editions; MessageSet-flavored proto2 schemas +-- still need work — those tests appear as runtime/parse errors below). local MESSAGE_REGISTRY = { ['protobuf_test_messages.proto3.TestAllTypesProto3'] = proto3_tests.TestAllTypesProto3_descriptor, + ['protobuf_test_messages.proto2.TestAllTypesProto2'] = + proto2_tests.TestAllTypesProto2_descriptor, ['conformance.FailureSet'] = conformance.FailureSet_descriptor, } --- Register the test message in the runtime's WKT registry so Any fields --- with `@type` pointing at a non-WKT user type (the conformance suite uses --- TestAllTypesProto3 itself inside some Any tests) resolve in JSON decode. +-- Register test messages in the runtime's Any/WKT registry so JSON Any +-- fields with `@type` pointing at our test types resolve on decode. pb.register(proto3_tests.TestAllTypesProto3_descriptor) +pb.register(proto2_tests.TestAllTypesProto2_descriptor) local WIRE_FORMAT = conformance.WireFormat local PROTOBUF = WIRE_FORMAT.PROTOBUF diff --git a/test/conformance_test.lua b/test/conformance_test.lua index 90db2cb7a66391601baa697729b6ad9be6681f02..d9d35963cfb42cb274ebdfd3bbab02ffcffc1c20 100644 --- a/test/conformance_test.lua +++ b/test/conformance_test.lua @@ -121,11 +121,13 @@ t.assert_not_equals(resp.parse_error, nil) end core_g.test_unsupported_message_type_skipped = function() - -- proto2 / editions test message types are intentionally unsupported. + -- Editions test message types are intentionally unsupported. Proto2 + -- moved into the registry once codegen landed; pick a type that's + -- explicitly absent so this pin still demonstrates the skip path. local resp = decode_resp(core.handle_request(encode_req({ protobuf_payload = '', requested_output_format = PROTOBUF, - message_type = 'protobuf_test_messages.proto2.TestAllTypesProto2', + message_type = 'protobuf_test_messages.editions.TestAllTypesEdition2023', }))) t.assert_str_contains(resp.skipped or '', 'unsupported message type') end