Skip to content

test(amber): add unit tests for ChannelConfig.generateChannelConfigs#4800

Merged
aglinxinyuan merged 3 commits into
apache:mainfrom
Yicong-Huang:test-channel-config
May 3, 2026
Merged

test(amber): add unit tests for ChannelConfig.generateChannelConfigs#4800
aglinxinyuan merged 3 commits into
apache:mainfrom
Yicong-Huang:test-channel-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/ChannelConfig.scala. The generateChannelConfigs partition-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 OneToOnePartition arm uses List.zip, which silently truncates to the shorter input. Other arms either compute the full cross product or assert exact lengths (SinglePartition requires toWorkerIds.size == 1); only OneToOne drops surplus pairings without warning.

How was this PR tested?

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

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

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

Closes apache#4798

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 43.69%. Comparing base (6ae0c46) to head (d285434).

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     
Flag Coverage Δ
amber 42.02% <ø> (+0.03%) ⬆️
python 86.46% <ø> (ø)

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 ChannelConfig.generateChannelConfigs, exercising expected channel pair generation across supported PartitionInfo variants and edge cases, and documenting the current OneToOnePartition truncation behavior.

Changes:

  • Introduces ChannelConfigSpec covering cross-product partition arms (Hash/Range/Broadcast/Unknown).
  • Adds assertions for SinglePartition (N→1 routing + assertion behavior) and OneToOnePartition (pairwise zip + truncation).
  • Covers empty-input behavior and toPortId propagation.

💡 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.
@aglinxinyuan aglinxinyuan enabled auto-merge (squash) May 3, 2026 04:16
@aglinxinyuan aglinxinyuan disabled auto-merge May 3, 2026 04:16
@aglinxinyuan aglinxinyuan enabled auto-merge (squash) May 3, 2026 04:16
@aglinxinyuan aglinxinyuan merged commit f624949 into apache:main May 3, 2026
15 checks passed
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 ChannelConfig.generateChannelConfigs

4 participants