Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update ruby_generator.cc to allow proto2 imports in proto3 #9003

Merged
merged 6 commits into from
Sep 22, 2021

Conversation

zhangskz
Copy link
Member

No description provided.

@zhangskz zhangskz changed the title Update ruby_generator.cc to allow proto2 imports in proto3, with updated unit tests Update ruby_generator.cc to allow proto2 imports in proto3 Sep 20, 2021
@haberman
Copy link
Member

This looks great. Could you also add a test in one of these protos, to ensure that the generated code can be successfully loaded into a Ruby process and used?

https://github.com/protocolbuffers/protobuf/tree/master/ruby/tests

I think this is a good candidate; you could make this file import one of the proto2 protos from this directory: https://github.com/protocolbuffers/protobuf/blob/master/ruby/tests/basic_test.proto

Then add a test in https://github.com/protocolbuffers/protobuf/blob/master/ruby/tests/basic.rb

@zhangskz zhangskz merged commit 740c4b0 into protocolbuffers:3.18.x Sep 22, 2021
bithium pushed a commit to bithium/protobuf that referenced this pull request Sep 4, 2023
…uffers#9003)

* Update ruby_generator.cc to allow proto2 imports in proto3, with updated unit tests

* Update Makefile.am with new ruby_generated_code_proto2_import.proto

* Fix ruby_generator unit test to use temporary test directory for imported protos

* Add test for imported proto2 to ruby/tests

* Fix proto_path, restore to ../src/protoc, and fix/cleanup unit test.

* Rename Proto2TestMessage to TestImportedMessage for consistency, for ruby compiler tests
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants