test(amber): add unit tests for ChannelConfig.generateChannelConfigs#4800
Merged
Conversation
Closes apache#4798 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 #4800 +/- ##
============================================
+ Coverage 43.67% 43.69% +0.01%
+ Complexity 2087 2086 -1
============================================
Files 957 957
Lines 34072 34072
Branches 3753 3753
============================================
+ Hits 14882 14887 +5
+ Misses 18395 18389 -6
- Partials 795 796 +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 ChannelConfig.generateChannelConfigs, exercising expected channel pair generation across supported PartitionInfo variants and edge cases, and documenting the current OneToOnePartition truncation behavior.
Changes:
- Introduces
ChannelConfigSpeccovering cross-product partition arms (Hash/Range/Broadcast/Unknown). - Adds assertions for
SinglePartition(N→1 routing + assertion behavior) andOneToOnePartition(pairwise zip + truncation). - Covers empty-input behavior and
toPortIdpropagation.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Switch the empty-input and toPortId-propagation tests under a fresh \`generateChannelConfigs\` subject so ScalaTest stops reporting them as \`OneToOnePartition should ...\`. Drop the \`.asInstanceOf[PartitionInfo]\` on the RangePartition case (the companion \`apply\` already returns PartitionInfo) and the now-unused PartitionInfo import.
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/ChannelConfig.scala. ThegenerateChannelConfigspartition-routing helper had no dedicated spec.Any related issues, documentation, discussions?
Closes #4798.
Bug pinned in the spec with explanatory comment (filed separately as a Bug issue): the
OneToOnePartitionarm usesList.zip, which silently truncates to the shorter input. Other arms either compute the full cross product or assert exact lengths (SinglePartitionrequirestoWorkerIds.size == 1); onlyOneToOnedrops surplus pairings without warning.How was this PR tested?
Was this PR authored or co-authored using generative AI tooling?
Generated-by: Claude Code (claude-opus-4-7)