test(compiler): add IR validation and codegen tests for gRPC service support#3528
Open
darius024 wants to merge 5 commits intoapache:mainfrom
Open
test(compiler): add IR validation and codegen tests for gRPC service support#3528darius024 wants to merge 5 commits intoapache:mainfrom
darius024 wants to merge 5 commits intoapache:mainfrom
Conversation
…nd non-message RPC types
There was a problem hiding this comment.
Pull request overview
Adds IR-level validation and compiler/codegen smoke tests to cover gRPC service schema support in the Fory compiler, filling the remaining testing gaps for Issue #3277.
Changes:
- Add IR validation for duplicate service/method names and enforce RPC request/response types are messages.
- Add IR validation tests across FDL / proto / fbs, including streaming RPC cases.
- Add codegen/compile smoke tests ensuring service definitions don’t affect message codegen and
--grpccompilation succeeds.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 7 comments.
| File | Description |
|---|---|
| compiler/fory_compiler/ir/validator.py | Adds _check_services() and wires it into schema validation. |
| compiler/fory_compiler/tests/test_ir_service_validation.py | New tests covering duplicate names, type restrictions, and streaming RPC validation. |
| compiler/fory_compiler/tests/test_service_codegen.py | New smoke tests to ensure services don’t change message codegen and compile_file(..., grpc=True) emits output. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why?
Issue #3277 requires unit tests for gRPC service support in the Fory compiler: IR validation tests covering name, type, and streaming rules, and golden codegen tests for service schemas. The parser tests for FDL/proto/fbs service syntax already existed from closed sub-issues. This PR fills the remaining gaps.
What does this PR do?
compiler/fory_compiler/ir/validator.py_check_services()implementing three validation rules:message—enumandunionare rejected_check_services()intovalidate()after_check_type_references()compiler/fory_compiler/tests/test_ir_service_validation.py(new)compiler/fory_compiler/tests/test_service_codegen.py(new)generate_services()returns[]as a baseline for all generatorscompile_file(..., grpc=True)succeeds and produces output for all languages usingexamples/service.fdlclass HelloRequest,String name, etc.) are present in Java and Python generated outputRelated issues