Skip to content

test(workflow-core): add unit test coverage for FinalizePort and FinalizeExecutor markers#4792

Merged
Yicong-Huang merged 3 commits into
apache:mainfrom
aglinxinyuan:xinyuan-test-internal-markers-spec
May 3, 2026
Merged

test(workflow-core): add unit test coverage for FinalizePort and FinalizeExecutor markers#4792
Yicong-Huang merged 3 commits into
apache:mainfrom
aglinxinyuan:xinyuan-test-internal-markers-spec

Conversation

@aglinxinyuan
Copy link
Copy Markdown
Contributor

@aglinxinyuan aglinxinyuan commented May 3, 2026

What changes were proposed in this PR?

Add InternalMarkerSpec covering the FinalizePort and FinalizeExecutor payloads used to signal finalization within a TupleLike stream:

  • FinalizePort carries the configured portId and input direction
  • Both markers are TupleLike with empty getFields and zero inMemSize
  • FinalizePort respects case-class equality on its constructor arguments
  • Two FinalizeExecutor instances are equal (no-field case class)
  • The two markers are distinguishable via pattern matching (the test classifies a heterogeneous List[TupleLike] and asserts the dispatch labels), exercising the actual call-site idiom rather than just ==

Any related issues, documentation, discussions?

Closes #4791

How was this PR tested?

sbt "WorkflowCore/testOnly org.apache.texera.amber.core.tuple.InternalMarkerSpec" — 6/6 tests pass.

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

Generated-by: Claude Code (Claude Opus 4.7)

Add InternalMarkerSpec covering the FinalizePort and FinalizeExecutor
markers used to signal port- and executor-level finalization within a
TupleLike stream: argument-passing, empty getFields and zero inMemSize,
case-class equality, and inter-marker distinguishability.

Closes apache#4791

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings May 3, 2026 01:54
@github-actions github-actions Bot added the common label May 3, 2026
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

This PR adds focused unit coverage for the internal tuple-stream marker types in workflow-core. It helps lock down the lightweight marker contract used by the execution engine to signal port and executor finalization.

Changes:

  • Added a new InternalMarkerSpec covering FinalizePort field values and case-class equality.
  • Added assertions that FinalizePort and FinalizeExecutor behave as empty TupleLike markers with zero in-memory size.
  • Added a cross-marker inequality check to distinguish the two marker payloads.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@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.61%. Comparing base (ca11939) to head (046045d).

Additional details and impacted files
@@             Coverage Diff              @@
##               main    #4792      +/-   ##
============================================
- Coverage     43.62%   43.61%   -0.01%     
+ Complexity     2088     2087       -1     
============================================
  Files           957      957              
  Lines         34077    34077              
  Branches       3753     3753              
============================================
- Hits          14865    14864       -1     
+ Misses        18419    18417       -2     
- Partials        793      796       +3     
Flag Coverage Δ
access-control-service 28.12% <ø> (ø)
amber 41.98% <ø> (-0.01%) ⬇️
computing-unit-managing-service 0.00% <ø> (ø)
config-service 0.00% <ø> (ø)
file-service 33.24% <ø> (ø)
workflow-compiling-service 47.72% <ø> (ø)

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 Yicong-Huang May 3, 2026 01:59
- Replace the type-level equality check with a pattern-matching
  classification, so the test actually exercises the dispatch behavior
  the marker types are designed for.
- Apply scalafmt to long-line case-class equality assertions.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@Yicong-Huang Yicong-Huang enabled auto-merge (squash) May 3, 2026 07:16
@Yicong-Huang Yicong-Huang merged commit 5ecf746 into apache:main May 3, 2026
16 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 test coverage for FinalizePort and FinalizeExecutor markers

4 participants