Skip to content

test(amber): add unit tests for LinkConfig.toPartitioning#4803

Open
Yicong-Huang wants to merge 2 commits intoapache:mainfrom
Yicong-Huang:test-link-config
Open

test(amber): add unit tests for LinkConfig.toPartitioning#4803
Yicong-Huang wants to merge 2 commits intoapache:mainfrom
Yicong-Huang:test-link-config

Conversation

@Yicong-Huang
Copy link
Copy Markdown
Contributor

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. The toPartitioning partition-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 OneToOne arm uses List.zip and silently truncates on unequal-length input — the same hazard as the parallel ChannelConfig issue (#4799). (2) The BroadcastPartition arm uses zip instead of the cross product, both diverging from the broadcast contract and from ChannelConfig's broadcast routing in the same package.

How was this PR tested?

sbt scalafmtCheckAll
sbt "WorkflowExecutionService/testOnly org.apache.texera.amber.engine.architecture.scheduling.config.LinkConfigSpec"

Was this PR authored or co-authored using generative AI tooling?

Generated-by: Claude Code (claude-opus-4-7)

Closes apache#4801

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented May 3, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 42.81%. Comparing base (88c7a21) to head (b64e24d).
⚠️ Report is 1 commits behind head on main.

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     
Flag Coverage Δ
amber 40.67% <ø> (+0.09%) ⬆️
python 84.10% <ø> (-0.06%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@aglinxinyuan aglinxinyuan requested a review from Copilot May 3, 2026 03:01
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 LinkConfigSpec covering HashPartition, RangePartition, SinglePartition, OneToOnePartition, BroadcastPartition, and UnknownPartition mappings.
  • 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.
@aglinxinyuan aglinxinyuan enabled auto-merge (squash) May 3, 2026 08:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add unit tests for LinkConfig.toPartitioning

4 participants