test(workflow-core): add unit test coverage for core/executor reflection#4834
Merged
Yicong-Huang merged 2 commits intoMay 3, 2026
Merged
Conversation
Add CoreExecutorReflectionSpec covering: - OperatorExecutor trait defaults (open/close no-ops, produceStateOnStart/Finish None, processState passthrough, processTupleMultiPort delegation, onFinish empty, onFinishMultiPort delegation) - SourceOperatorExecutor trait defaults (processTuple / processTupleMultiPort empty; onFinishMultiPort delegates to produceTuple) - ExecFactory.newExecFromJavaClassName across all four constructor-shape fallbacks (no-arg, (String), (Int,Int), (String,Int,Int)) plus ClassNotFoundException for unknown classes - JavaRuntimeCompilation.compileCode success path on a self-contained source and diagnostic RuntimeException on syntax errors The newExecFromJavaCode / compileCode-with-Texera-deps integration is intentionally not covered: javac is invoked with null compilation options, which under sbt test does not include the project classpath and produces "package ... does not exist" errors for any source that references workflow-core types. That failure is a deployment-environment artifact, not a contract violation. Closes apache#4833 Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #4834 +/- ##
============================================
+ Coverage 47.70% 47.95% +0.25%
- Complexity 2139 2153 +14
============================================
Files 817 817
Lines 25980 25980
Branches 2343 2343
============================================
+ Hits 12393 12460 +67
+ Misses 12804 12735 -69
- Partials 783 785 +2
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Contributor
There was a problem hiding this comment.
Pull request overview
Adds focused Scala unit tests in workflow-core to validate the reflection/runtime-compilation behavior in the core/executor layer (trait default methods, reflection-based executor construction, and Java runtime compilation diagnostics).
Changes:
- Add tests for
OperatorExecutorandSourceOperatorExecutordefault method behaviors (no-ops, delegation, and routing defaults). - Add tests for
ExecFactory.newExecFromJavaClassNameconstructor fallback paths plus unknown-class handling. - Add tests for
JavaRuntimeCompilation.compileCodesuccess on self-contained source and diagnostic failure on invalid Java.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Yicong-Huang
approved these changes
May 3, 2026
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.
What changes were proposed in this PR?
Add
CoreExecutorReflectionSpeccovering the four classes/traits incommon/workflow-core/.../core/executor:OperatorExecutortrait defaults (open/close no-ops, produceStateOnStart/Finish None, processState passthrough, processTupleMultiPort delegation to processTuple, onFinish empty, onFinishMultiPort delegation to onFinish)SourceOperatorExecutortrait defaults (processTuple / processTupleMultiPort always empty; onFinishMultiPort delegates to produceTuple with no port routing)ExecFactory.newExecFromJavaClassNameacross all four constructor-shape fallbacks (no-arg, (String), (Int, Int), (String, Int, Int)) plus ClassNotFoundException for unknown classesJavaRuntimeCompilation.compileCodesuccess path on a self-contained source and diagnostic RuntimeException on syntax errorsThe
newExecFromJavaCode/compileCode-with-Texera-deps integration is intentionally not covered: javac is invoked with null compilation options, which under sbt test does not include the project classpath and produces "package ... does not exist" errors for any source that references workflow-core types. That failure is a deployment-environment artifact, not a contract violation.Any related issues, documentation, discussions?
Closes #4833
How was this PR tested?
sbt "WorkflowCore/testOnly org.apache.texera.amber.core.executor.CoreExecutorReflectionSpec"- 18/18 tests pass.Was this PR authored or co-authored using generative AI tooling?
Generated-by: Claude Code (Claude Opus 4.7)