Skip to content

test(frontend): cover three dashboard services#5203

Merged
Yicong-Huang merged 1 commit into
apache:mainfrom
Yicong-Huang:test/dashboard-service-trio-specs
May 25, 2026
Merged

test(frontend): cover three dashboard services#5203
Yicong-Huang merged 1 commit into
apache:mainfrom
Yicong-Huang:test/dashboard-service-trio-specs

Conversation

@Yicong-Huang
Copy link
Copy Markdown
Contributor

@Yicong-Huang Yicong-Huang commented May 25, 2026

What changes were proposed in this PR?

Adds HttpClientTestingModule-based specs for three dashboard services that previously had no (or near-empty) tests:

  • dataset.service.ts — pins the URL, HTTP method, body / query string, and response mapping for every public method, including the authenticated / anonymous endpoint splits, the presigned-URL chain on retrieveDatasetVersionSingleFile, and the file-node attaching that createDatasetVersion / retrieveDatasetLatestVersion perform.
  • workflow-version.service.ts — replaces a 2-test stub with coverage of the readonly-display lifecycle (snapshot, swap, restore), joint-paper highlight helpers, the forward-diff classification in getWorkflowsDifference / getOperatorsDifference, and the three version-API HTTP endpoints.
  • search.service.ts — covers the authenticated vs public search routing (with the forced includePublic=true on the anonymous path), the dataset hasMismatch filtering inside executeSearch, and the branchy enrich pipeline in extendSearchResultsWithHubActivityInfo (Workflow / Project / Dataset entity routing, activity-list narrowing, and the workflow-only size-lookup gating).

No production code is touched.

Any related issues, documentation, discussions?

Closes #5202.

How was this PR tested?

Added unit tests for the three services listed above.

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

Generated-by: Claude Opus 4.7

Adds HttpClientTestingModule specs for the dashboard service trio that
previously had no (or near-empty) coverage:

- dataset.service: every public HTTP wrapper, the authenticated /
  anonymous endpoint splits, the presigned-URL chain on
  retrieveDatasetVersionSingleFile, and the fileNodes mapping that
  createDatasetVersion / retrieveDatasetLatestVersion apply.
- workflow-version.service: replaces the 2-test stub with full
  coverage of the readonly-display lifecycle (snapshot, swap, restore),
  the joint-paper highlight helpers, the forward-diff classification
  in getWorkflowsDifference / getOperatorsDifference, and the three
  version-API HTTP endpoints.
- search.service: new spec for the authenticated vs public search
  routing (with the forced includePublic=true on the anonymous path),
  the dataset hasMismatch filtering inside executeSearch, and the
  branchy extendSearchResultsWithHubActivityInfo enrich pipeline
  (Workflow / Project / Dataset routing, activity-list narrowing,
  size lookup gating on workflow ids).

Closes apache#5202.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@github-actions github-actions Bot added the frontend Changes related to the frontend GUI label May 25, 2026
@codecov-commenter
Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 47.81%. Comparing base (c435aa7) to head (c9d7506).

Additional details and impacted files
@@             Coverage Diff              @@
##               main    #5203      +/-   ##
============================================
+ Coverage     47.15%   47.81%   +0.66%     
  Complexity     2348     2348              
============================================
  Files          1042     1042              
  Lines         39989    39989              
  Branches       4260     4260              
============================================
+ Hits          18855    19121     +266     
+ Misses        20012    19727     -285     
- Partials       1122     1141      +19     
Flag Coverage Δ *Carryforward flag
access-control-service 39.53% <ø> (ø) Carriedforward from c435aa7
agent-service 33.76% <ø> (ø) Carriedforward from c435aa7
amber 50.36% <ø> (ø) Carriedforward from c435aa7
computing-unit-managing-service 0.00% <ø> (ø) Carriedforward from c435aa7
config-service 0.00% <ø> (ø) Carriedforward from c435aa7
file-service 32.18% <ø> (ø) Carriedforward from c435aa7
frontend 39.43% <ø> (+1.62%) ⬆️
python 90.50% <ø> (ø) Carriedforward from c435aa7
workflow-compiling-service 56.81% <ø> (ø) Carriedforward from c435aa7

*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:
  • ❄️ 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.

@Yicong-Huang Yicong-Huang added this pull request to the merge queue May 25, 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

Adds comprehensive Angular/Vitest unit tests (HttpClientTestingModule-based) for three previously un(der)-tested dashboard services, improving confidence in HTTP routing, query/body construction, and response mapping without changing production behavior.

Changes:

  • Expanded workflow-version.service.spec.ts to cover readonly-display lifecycle, diff/highlight helpers, and version HTTP endpoints.
  • Added new search.service.spec.ts covering authenticated vs anonymous routing, dataset mismatch filtering in executeSearch, and hub-activity enrichment logic (counts/likes/access/size).
  • Added new dataset.service.spec.ts covering all major dataset endpoints, including presigned-URL download chaining and file-node attachment mapping.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
frontend/src/app/dashboard/service/user/workflow-version/workflow-version.service.spec.ts Replaces minimal coverage with detailed tests for workflow version display/diff/highlight behaviors and related HTTP endpoints.
frontend/src/app/dashboard/service/user/search.service.spec.ts New tests validating search endpoint selection, query param behavior, mismatch filtering, and enrichment via HubService/WorkflowPersistService.
frontend/src/app/dashboard/service/user/dataset/dataset.service.spec.ts New tests asserting dataset API endpoint usage, request construction (params/body/headers), and response mapping behaviors.

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

Merged via the queue into apache:main with commit 767219a May 25, 2026
21 checks passed
@Yicong-Huang Yicong-Huang deleted the test/dashboard-service-trio-specs branch May 25, 2026 22:46
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 tests for dashboard service trio (dataset, workflow-version, search)

4 participants