test(amber): add unit test coverage for AddressInfo#4916
Conversation
Pin the contract of `AddressInfo`: - Both fields (`allAddresses`, `controllerAddress`) round-trip from the case-class constructor. - Order of `allAddresses` is preserved (the cluster scheduler picks workers based on this order). - Empty `allAddresses` is accepted (controller-only configurations). - The controller may also appear in `allAddresses` (collocated mode). - `copy()` lets a single field change while preserving the other. - Case-class equality on the Array field is reference-based, not element-wise — locked down explicitly so a switch to (say) Seq doesn't silently flip the equality semantics for callers. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
Adds missing unit test coverage for AddressInfo in Amber’s deploy-semantics layer, pinning expected case-class behavior that the cluster scheduler and callers may rely on (including Array equality semantics).
Changes:
- Introduces
AddressInfoSpecwith 6 unit tests covering constructor round-trip,allAddressesordering, empty/collocated configurations,copy()behavior, andArrayreference-equality semantics.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…nce semantics Address Copilot feedback on apache#4916: the test description previously read "fields match by value", but the assertions specifically pin Array *reference* equality (case-class equality with an `Array` field is reference-based, not element-wise). Rename to "use Array reference equality (not element-wise) for the allAddresses field" and rename the local bindings (sameRef / sameRefAgain / differentRef) to match. 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 #4916 +/- ##
============================================
+ Coverage 42.17% 43.32% +1.14%
+ Complexity 2181 2179 -2
============================================
Files 980 915 -65
Lines 36298 32189 -4109
Branches 3783 3256 -527
============================================
- Hits 15308 13945 -1363
+ Misses 20065 17392 -2673
+ Partials 925 852 -73
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:
|
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 1 out of 1 changed files in this pull request and generated no new comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 1 out of 1 changed files in this pull request and generated no new comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 1 out of 1 changed files in this pull request and generated no new comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
What changes were proposed in this PR?
Adds
AddressInfoSpeccoveringAddressInfo(amber/src/main/scala/org/apache/texera/amber/engine/architecture/deploysemantics/AddressInfo.scala), the case class the cluster scheduler uses to describe worker / controller node addresses. It has no test coverage today.The new spec pins:
allAddresses,controllerAddress) round-trip from the case-class constructor.allAddressesis preserved (the cluster scheduler picks workers based on this order, so any reorder is observable).allAddressesarray is accepted (controller-only configurations).allAddresses(collocated mode).copy()allows one field to change while preserving the other.Arrayfield is reference-based, not element-wise. This is locked down explicitly so a future change to (say)Seqdoesn't silently flip the equality semantics for callers.No production code changed; this is test-only.
Any related issues, documentation, discussions?
Closes #4915
How was this PR tested?
Added 6 new unit tests in
AddressInfoSpec. Verified locally:Was this PR authored or co-authored using generative AI tooling?
Generated-by: Claude Code