M cmd/conformance/core.lua => cmd/conformance/core.lua +8 -4
@@ 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
M test/conformance_test.lua => test/conformance_test.lua +4 -2
@@ 121,11 121,13 @@ core_g.test_parse_error_on_malformed_json = function()
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