Skip to content

test(amber): unit tests for web state stores and websocket plumbing#5209

Merged
kunwp1 merged 1 commit into
apache:mainfrom
Yicong-Huang:test/web-state-stores-and-ws-input
May 26, 2026
Merged

test(amber): unit tests for web state stores and websocket plumbing#5209
kunwp1 merged 1 commit into
apache:mainfrom
Yicong-Huang:test/web-state-stores-and-ws-input

Conversation

@Yicong-Huang
Copy link
Copy Markdown
Contributor

What changes were proposed in this PR?

Add six ScalaTest specs under amber/src/test/scala/org/apache/texera/web/ covering pure-logic helpers that ship without direct unit coverage today.

  • StateStoreSpec — observable diff filter, multi-handler fan-out, registration-order delivery, Disposable removal, double-dispose tolerance.
  • WorkflowStateStoreSpec and ExecutionStateStoreSpec — default child-store identities and getAllStores enumeration order.
  • SubscriptionManagerSpec — bulk dispose semantics on the trait, including repeat-call no-op and post-clear reuse.
  • WebsocketInputSpec — type-discriminated request routing, uidOpt pass-through, callback-exception routing through errorHandler, and subscriber isolation across throwing callbacks.
  • UserRoleAuthorizerSpec — accept matching role, reject mismatching role, IAE on unknown / case-mismatched enum string (covers the surface that fix: enforce @RolesAllowed on microservice resources #5049 was meant to guard).

Any related issues, documentation, discussions?

Closes #5208.

How was this PR tested?

Added unit tests under amber/src/test/scala/org/apache/texera/web/.

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

Generated-by: Claude Opus 4.7

Covers six pure-logic helpers under org.apache.texera.web that ship
without direct coverage today: StateStore (rx observable diff + handler
registry), WorkflowStateStore and ExecutionStateStore wrappers,
SubscriptionManager trait, WebsocketInput type-discriminated pub/sub,
and UserRoleAuthorizer. Specs exercise no-op skip on equal updates,
multi-handler fan-out, Disposable removal semantics, callback exception
routing, and case-sensitive enum lookup.
@codecov-commenter
Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 48.09%. Comparing base (9b850e2) to head (a99b4b7).
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@             Coverage Diff              @@
##               main    #5209      +/-   ##
============================================
+ Coverage     48.05%   48.09%   +0.03%     
- Complexity     2348     2368      +20     
============================================
  Files          1042     1042              
  Lines         39973    39973              
  Branches       4251     4251              
============================================
+ Hits          19211    19224      +13     
+ Misses        19624    19609      -15     
- Partials       1138     1140       +2     
Flag Coverage Δ *Carryforward flag
access-control-service 39.53% <ø> (ø) Carriedforward from 9b850e2
agent-service 33.76% <ø> (ø) Carriedforward from 9b850e2
amber 50.44% <ø> (+0.08%) ⬆️
computing-unit-managing-service 0.00% <ø> (ø) Carriedforward from 9b850e2
config-service 0.00% <ø> (ø) Carriedforward from 9b850e2
file-service 32.18% <ø> (ø) Carriedforward from 9b850e2
frontend 40.02% <ø> (ø) Carriedforward from 9b850e2
python 90.50% <ø> (ø) Carriedforward from 9b850e2
workflow-compiling-service 56.81% <ø> (ø) Carriedforward from 9b850e2

*This pull request uses carry forward flags. 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:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@Yicong-Huang Yicong-Huang requested a review from kunwp1 May 25, 2026 23:37
Copy link
Copy Markdown
Contributor

@kunwp1 kunwp1 left a comment

Choose a reason for hiding this comment

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

LGTM! Since it's a test-only changes, we can safely merge this.

@kunwp1 kunwp1 added this pull request to the merge queue May 26, 2026
Merged via the queue into apache:main with commit 1cdfc45 May 26, 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 org.apache.texera.web state stores and websocket plumbing

3 participants