Skip to content

Add unit tests for org.apache.texera.web state stores and websocket plumbing #5208

@Yicong-Huang

Description

@Yicong-Huang

Task Summary

amber/src/main/scala/org/apache/texera/web/ has 124 production Scala files and only 11 specs, so the bulk of the websocket / state-store / auth helpers ship with no direct unit coverage. Cover a self-contained cluster of pure-logic files in one PR:

  • storage/StateStore.scala — observable state with diff-handler registry and ReentrantLock; emits websocket events only on actual state changes
  • storage/WorkflowStateStore.scala and storage/ExecutionStateStore.scala — thin wrappers that enumerate child stores via getAllStores
  • SubscriptionManager.scala — trait that owns a list of Disposables and disposes them in bulk
  • WebsocketInput.scala — type-discriminated rx pub/sub that routes callback exceptions through a user-supplied error handler
  • auth/UserRoleAuthorizer.scala — single-method authorizer that delegates to SessionUser.isRoleOf

Out of scope for this issue (heavier mocking, separate follow-ups):

  • WorkflowLifecycleManager — needs AmberRuntime actor-system scheduling
  • SessionState — needs a javax.websocket.Session double
  • ExecutionStateStore.updateWorkflowState — touches ExecutionsMetadataPersistService and the DB

Task Type

  • Testing / QA

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No fields configured for Task.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions