test(amber): add unit tests for LinkConfig.toPartitioning#4803
Open
Yicong-Huang wants to merge 2 commits intoapache:mainfrom
Open
test(amber): add unit tests for LinkConfig.toPartitioning#4803Yicong-Huang wants to merge 2 commits intoapache:mainfrom
Yicong-Huang wants to merge 2 commits intoapache:mainfrom
Conversation
Closes apache#4801 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 #4803 +/- ##
============================================
+ Coverage 42.77% 42.81% +0.03%
+ Complexity 2014 2012 -2
============================================
Files 957 957
Lines 34077 34077
Branches 3753 3753
============================================
+ Hits 14578 14590 +12
+ Misses 18719 18708 -11
+ Partials 780 779 -1
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:
|
aglinxinyuan
approved these changes
May 3, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
Adds ScalaTest coverage for Amber’s scheduling-layer LinkConfig.toPartitioning helper to lock in current routing/partitioning behavior (including two known-but-unfixed behaviors around zip usage).
Changes:
- Introduces
LinkConfigSpeccoveringHashPartition,RangePartition,SinglePartition,OneToOnePartition,BroadcastPartition, andUnknownPartitionmappings. - Adds assertions for channel topology (cross-product vs
zip) and batch-size propagation. - Pins two known issues in-spec via comments (silent truncation with
zip, and broadcast behaving as 1:1 pairing).
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Re-anchor the empty-input, batch-propagation, and the new unsupported-branch tests under the `toPartitioning` subject so ScalaTest stops reporting them as `"UnknownPartition" should ...`. Add a test that passes `null` as the partitionInfo (the only off-domain value reachable for the sealed `PartitionInfo` hierarchy) and asserts `UnsupportedOperationException`, pinning the catch-all branch.
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?
Adds scalatest coverage for
amber/src/main/scala/org/apache/texera/amber/engine/architecture/scheduling/config/LinkConfig.scala. ThetoPartitioningpartition-routing helper had no dedicated spec.Any related issues, documentation, discussions?
Closes #4801.
Two related bugs are pinned in the spec with explanatory comments and filed separately as Bug issues: (1) the
OneToOnearm usesList.zipand silently truncates on unequal-length input — the same hazard as the parallelChannelConfigissue (#4799). (2) TheBroadcastPartitionarm useszipinstead of the cross product, both diverging from the broadcast contract and fromChannelConfig's broadcast routing in the same package.How was this PR tested?
Was this PR authored or co-authored using generative AI tooling?
Generated-by: Claude Code (claude-opus-4-7)