add unit test coverage for MapOpDesc
- Dominant language
- Scala
- Stars
- 314
- Forks
- 187
- Avg merge
- 1d 21h
- Merged PRs (30d)
- 214
Description
### Task Summary
Add a dedicated unit-spec (`MapOpDescSpec.scala`) that pins `MapOpDesc.runtimeReconfiguration` always succeeds, dispatches to the new desc's `getPhysicalOp`, ignores the old desc, and returns `None` for the state-transfer function.
## Background
`MapOpDesc` in `common/workflow-operator` (`operator/map/MapOpDesc.scala`) currently lacks a dedicated unit-spec. It is the abstract base for `map`-family operator descriptors (used by `MapOpExec`, `TypeCastingOpDesc`, etc.); its only override is `runtimeReconfiguration`, which always succeeds and returns the NEW operator's physical plan, discarding the old desc.
```scala
abstract class MapOpDesc extends LogicalOp {
override def runtimeReconfiguration(
workflowId: WorkflowIdentity,
executionId: ExecutionIdentity,
oldOpDesc: LogicalOp,
newOpDesc: LogicalOp
): Try[(PhysicalOp, Option[StateTransferFunc])] = {
Success(newOpDesc.getPhysicalOp(workflowId, executionId), None)
}
}
```
## Behavior to pin
| Surface | Contract |
| --- | --- |
| `runtimeReconfiguration` | returns a `Success(...)` (never `Failure`, regardless of inputs) |
| Result's PhysicalOp | equals `newOpDesc.getPhysicalOp(workflowId, executionId)` — pin via reference / identity if the new desc returns a recognizable instance |
| Result's `StateTransferFunc` | is `None` — map operators are stateless and need no state transfer across reconfiguration |
| `oldOpDesc` argument | is IGNORED (the result depends only on the new desc) — verify by passing two different `oldOpDesc` instances and showing the result is identical |
| Distinct `workflowId` / `executionId` | propagate through to `newOpDesc.getPhysicalOp` (the same arguments must reach the new desc's call) |
## Scope
- New spec file: `MapOpDescSpec.scala` (matches the `Spec.scala` convention).
- `MapOpDesc` is abstract; exercise it through a minimal test-only concrete subclass that overrides `getPhysicalOp` to return a recognizable sentinel (or via an existing concrete subclass like `MapOpExec.MapOpDesc`).
- No production-code changes.
### Task Type
- [ ] Refactor / Cleanup
- [ ] DevOps / Deployment / CI
- [x] Testing / QA
- [ ] Documentation
- [ ] Performance
- [ ] Other
Contributor guide
Assessment
This issue has not been assessed yet.