Skip to content

test(frontend): add unit tests for execute-workflow guards#6649

Merged
aglinxinyuan merged 3 commits into
apache:mainfrom
Ma77Ball:test/execute-workflow-guards-spec
Jul 23, 2026
Merged

test(frontend): add unit tests for execute-workflow guards#6649
aglinxinyuan merged 3 commits into
apache:mainfrom
Ma77Ball:test/execute-workflow-guards-spec

Conversation

@Ma77Ball

@Ma77Ball Ma77Ball commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

What changes were proposed in this PR?

  • Add frontend/src/app/workspace/types/execute-workflow.interface.spec.ts, a new Vitest spec for the execute-workflow type guards, which previously had no dedicated unit tests.
  • Cover isWebPaginationUpdate (pagination vs snapshot/delta) and isWebDataUpdate (snapshot/delta vs pagination).
  • Cover isNotInExecution for all four terminal/uninitialized states (true) and the seven active states (false).

Any related issues, documentation, discussions?

Closes: #6648

How was this PR tested?

  • Run: cd frontend && node --max-old-space-size=8192 ./node_modules/nx/dist/bin/nx.js test gui --watch=false --include=src/app/workspace/types/execute-workflow.interface.spec.ts, expect all 6 tests passing.
  • Test-only change; no production code is modified.

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

Co-authored with Claude Opus 4.8 in compliance with ASF

@github-actions github-actions Bot added the frontend Changes related to the frontend GUI label Jul 20, 2026
@github-actions

github-actions Bot commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

Automated Reviewer Suggestions

Based on the git blame history of the changed files, we recommend the following reviewers:

  • Contributors with relevant context: @PG1204
    You can notify them by mentioning @PG1204 in a comment.

@aglinxinyuan
aglinxinyuan requested a review from Copilot July 20, 2026 21:47

@aglinxinyuan aglinxinyuan left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM!

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Adds a new Vitest spec file to cover the execute-workflow type guards and execution-state helper used by the frontend workspace workflow execution flow.

Changes:

  • Added unit tests for isWebPaginationUpdate and isWebDataUpdate (pagination vs snapshot/delta).
  • Added unit tests for isNotInExecution across terminal/uninitialized vs active execution states.

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

Comment thread frontend/src/app/workspace/types/execute-workflow.interface.spec.ts
Comment thread frontend/src/app/workspace/types/execute-workflow.interface.spec.ts
@aglinxinyuan

Copy link
Copy Markdown
Contributor

Please address the comments.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@aglinxinyuan
aglinxinyuan added this pull request to the merge queue Jul 22, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Jul 22, 2026
@aglinxinyuan

Copy link
Copy Markdown
Contributor

Merged main to trigger coverage report.

@codecov-commenter

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 76.27%. Comparing base (110a54c) to head (c80e627).
⚠️ Report is 1 commits behind head on main.
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@            Coverage Diff            @@
##               main    #6649   +/-   ##
=========================================
  Coverage     76.27%   76.27%           
  Complexity     3452     3452           
=========================================
  Files          1161     1161           
  Lines         45919    45918    -1     
  Branches       5100     5099    -1     
=========================================
  Hits          35025    35025           
  Misses         9329     9329           
+ Partials       1565     1564    -1     
Flag Coverage Δ *Carryforward flag
access-control-service 70.00% <ø> (ø) Carriedforward from c24755c
agent-service 76.76% <ø> (ø) Carriedforward from c24755c
amber 67.33% <ø> (ø) Carriedforward from c24755c
computing-unit-managing-service 20.49% <ø> (ø) Carriedforward from c24755c
config-service 66.66% <ø> (ø) Carriedforward from c24755c
file-service 67.21% <ø> (ø) Carriedforward from c24755c
frontend 81.71% <ø> (+<0.01%) ⬆️ Carriedforward from c24755c
notebook-migration-service 78.94% <ø> (ø) Carriedforward from c24755c
pyamber 92.15% <ø> (ø) Carriedforward from c24755c
workflow-compiling-service 55.14% <ø> (ø) Carriedforward from c24755c

*This pull request uses carry forward flags. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 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.

@aglinxinyuan
aglinxinyuan added this pull request to the merge queue Jul 23, 2026
Merged via the queue into apache:main with commit 0ba5d1a Jul 23, 2026
21 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

frontend Changes related to the frontend GUI

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add unit test coverage for execute-workflow type guards

4 participants