Skip to content

test(frontend): extend notebook-migration LLM unit test coverage - #6781

Merged
aglinxinyuan merged 2 commits into
apache:mainfrom
aglinxinyuan:test-fe-migration-llm
Jul 23, 2026
Merged

test(frontend): extend notebook-migration LLM unit test coverage#6781
aglinxinyuan merged 2 commits into
apache:mainfrom
aglinxinyuan:test-fe-migration-llm

Conversation

@aglinxinyuan

Copy link
Copy Markdown
Contributor

What changes were proposed in this PR?

Extends migration-llm.spec.ts with 11 tests (16 -> 27), covering the feature-flag/assertEnabled guard, verifyConnection (disabled/not-initialized/success/error-catch), the initialize() default-token fallback, the not-initialized guards on sendPrompt/convertNotebookToWorkflow, the missing edges/outputs response-shape fallbacks, and close(). Coverage 78% -> ~100% (19 -> 1 uncovered; the residual is the documented network transport seam). No existing tests modified.

Any related issues, documentation, discussions?

Closes #6775.

How was this PR tested?

ng test --include='**/migration-llm.spec.ts' -> 27/27 passing. yarn format:ci passes.

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

Generated-by: Claude Code (Opus 4.8 [1M context])

Add 11 tests covering the feature-flag guard, verifyConnection (disabled/uninitialized/
success/error), the default-token fallback, the not-initialized guards, the missing
edges/outputs response fallbacks, and close(). Coverage 78% -> ~100%.
Copilot AI review requested due to automatic review settings July 22, 2026 06:22
@github-actions github-actions Bot added the frontend Changes related to the frontend GUI label Jul 22, 2026
@github-actions

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: @zyratlo
    You can notify them by mentioning @zyratlo in a comment.

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

This PR extends the frontend unit test coverage for NotebookMigrationLLM (notebook-to-workflow migration), adding targeted tests for feature-flag gating, initialization/guard behavior, connection verification, response-shape tolerances, and session teardown.

Changes:

  • Added coverage for feature-flag disabled behavior across initialize(), verifyConnection(), and convertNotebookToWorkflow().
  • Added tests for initialization defaults (Auth token fallback), not-initialized guardrails, and close() behavior.
  • Added a response-shape tolerance test for missing edges / outputs keys in the LLM workflow response.

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

Comment thread frontend/src/app/workspace/service/notebook-migration/migration-llm.spec.ts Outdated
@aglinxinyuan
aglinxinyuan requested a review from mengw15 July 22, 2026 06:24

@mengw15 mengw15 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

…llm spec

Rename the test to reflect that AuthService.getAccessToken() returns null so
the access token defaults to an empty string via the ?? fallback.
@aglinxinyuan
aglinxinyuan enabled auto-merge July 22, 2026 06:49
@aglinxinyuan
aglinxinyuan added this pull request to the merge queue Jul 22, 2026
@aglinxinyuan
aglinxinyuan removed this pull request from the merge queue due to a manual request Jul 22, 2026
@codecov-commenter

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 75.25%. Comparing base (a9f384e) to head (0c334bd).

Additional details and impacted files
@@             Coverage Diff              @@
##               main    #6781      +/-   ##
============================================
+ Coverage     75.20%   75.25%   +0.05%     
- Complexity     3446     3449       +3     
============================================
  Files          1160     1160              
  Lines         45807    45807              
  Branches       5071     5071              
============================================
+ Hits          34449    34473      +24     
+ Misses         9746     9731      -15     
+ Partials       1612     1603       -9     
Flag Coverage Δ *Carryforward flag
access-control-service 70.00% <ø> (ø) Carriedforward from 2a91832
agent-service 76.76% <ø> (ø) Carriedforward from 2a91832
amber 67.19% <ø> (+0.02%) ⬆️ Carriedforward from 2a91832
computing-unit-managing-service 20.49% <ø> (ø) Carriedforward from 2a91832
config-service 66.66% <ø> (ø) Carriedforward from 2a91832
file-service 67.21% <ø> (ø) Carriedforward from 2a91832
frontend 79.52% <ø> (+0.10%) ⬆️
notebook-migration-service 78.94% <ø> (ø) Carriedforward from 2a91832
pyamber 92.15% <ø> (ø) Carriedforward from 2a91832
workflow-compiling-service 55.14% <ø> (ø) Carriedforward from 2a91832

*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 reopened this Jul 23, 2026
@aglinxinyuan
aglinxinyuan enabled auto-merge July 23, 2026 00:17
@aglinxinyuan
aglinxinyuan added this pull request to the merge queue Jul 23, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Jul 23, 2026
@aglinxinyuan
aglinxinyuan added this pull request to the merge queue Jul 23, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Jul 23, 2026
@aglinxinyuan
aglinxinyuan added this pull request to the merge queue Jul 23, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Jul 23, 2026
@aglinxinyuan
aglinxinyuan added this pull request to the merge queue Jul 23, 2026
Merged via the queue into apache:main with commit 9c3b941 Jul 23, 2026
44 checks passed
@aglinxinyuan
aglinxinyuan deleted the test-fe-migration-llm branch July 23, 2026 05:10
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.

Extend notebook-migration LLM unit test coverage

4 participants