[FLINK-40601][runtime-web] Add Vitest specs for remaining web dashboard views - #29138
Open
spuru9 wants to merge 5 commits into
Open
[FLINK-40601][runtime-web] Add Vitest specs for remaining web dashboard views#29138spuru9 wants to merge 5 commits into
spuru9 wants to merge 5 commits into
Conversation
…rvices
FLINK-40117 and FLINK-40600 covered most dashboard views but left the
core services untested. This adds specs for the five of them, following
the existing task-manager.service.spec.ts pattern.
- config.service: base URL default and that COLOR_MAP has an entry for
every status key.
- overview.service: passthrough and the empty-stream error fallback.
- job-manager.service: all public methods (mirrors the task-manager
service spec).
- status.service: change-detector wiring, boot() config caching, and
the refresh stream emitting once wired up.
- job.service: the derived logic (task-state normalization, plan and
stream-graph conversion, accumulator merge, desired-parallelism
update) plus representative URL construction.
Generated-by: Claude Code (claude-sonnet-5)
Covers the eight drawer views under pages/job/overview, none of which
had a spec. Each is constructed directly and driven through ngOnInit so
the controller logic is exercised without rendering the chart and
dynamic-host children that jsdom cannot draw.
- accumulators: flattening per-subtask user accumulators, empty-table
fallback on error.
- backpressure: percentage formatting, subtask indexing, empty view on
error.
- chart: available/selected/unselected metric bookkeeping and the
per-vertex selection cache.
- detail: <br/> to newline rewriting of the vertex description.
- flamegraph: sampleable-subtask derivation and whole-vertex vs
single-subtask requests.
- subtasks: subtask/aggregated loading and status-duration ordering.
- taskmanagers: taskmanagers extraction and empty-list fallback.
- watermarks: watermark map to indexed rows and sorting.
Generated-by: Claude Code (claude-sonnet-5)
…page shells
Covers the JobManager log/stdout/thread-dump/profiler pages (mirroring
the existing TaskManager specs) and the job/application list and detail
shells, none of which had a spec.
- jobmanager logs/stdout: load and download-target derivation with an
empty-content fallback on error.
- jobmanager thread-dump: default load, mode selection updating the
download url and reload mode, empty fallback on error.
- jobmanager profiler: refresh-driven list load, prepending a created
instance, and the guard against starting one while another runs.
- job/application shells: parsing the selected id and completed state
from the url, re-reading on navigation, and relative navigation.
- job/application detail shells: publishing the loaded detail to the
local service and the error paths (including the job root exception).
Generated-by: Claude Code (claude-sonnet-5)
…page
Covers the metric chart card, its resize service, and the job submission
page. The dagre graph and flame-graph components are left out: they are
pure g6/d3 rendering with no controller logic that can be asserted
without a real DOM.
- job-chart.service: resize broadcast.
- job-chart component: per-title sample appending, the 20-sample
rolling window, close emission, and the big-layout flag.
- submit page: jar-list load and no-access handling, entry-class
prefill on expand, delete refresh/collapse, upload progress, and
navigation to the submitted job.
Generated-by: Claude Code (claude-sonnet-5)
… pages
Covers the two stateful local services and the TaskManager stdout,
thread-dump, and profiler pages. The latter three mirror the JobManager
specs added earlier in this PR, removing the asymmetry of testing only
one side.
- job-local / application-local services: replay of the latest job,
vertex, and application detail, and the paired job-with-vertex
stream (including that a null vertex is filtered out).
- taskmanager stdout/thread-dump: routed-id load and download-target
derivation, thread-dump mode selection and vertex-name decoding,
empty fallback on error.
- taskmanager profiler: refresh-driven list load, creating an instance
for the routed task manager, and the still-running guard.
Generated-by: Claude Code (claude-sonnet-5)
Collaborator
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What is the purpose of the change
Follow-up to FLINK-40117 and FLINK-40600, which added Vitest specs for the high-traffic web dashboard views. This fills the remaining coverage gaps: at the start, 67 of 102 testable source files (components/services/pipes/directives/guards) had no spec. This adds specs for the core services, the job-detail drawer views, the JobManager and TaskManager pages, the local stores, the list/detail page shells, and the job chart and submit page.
Brief change log
29 new spec files:
config,overview,status,job-manager, andjobservices (task-state normalization, plan/stream-graph conversion, accumulator merge, desired-parallelism update, and the refresh stream).pages/job/overview/*): accumulators, backpressure, chart, detail, flamegraph, subtasks, taskmanagers, watermarks.logs/metrics/listalready had specs).job-localandapplication-localservices (replay of the latest job/vertex/application detail and the paired job-with-vertex stream).Components that pull in chart/graph/editor children or fetch through services in
ngOnInitare constructed directly and driven through their lifecycle/methods, so the controller logic is exercised without rendering children jsdom cannot draw.dagre.componentandflame-graph.componentare intentionally left out: they are pure g6/d3 rendering with no controller logic that can be meaningfully asserted without a real DOM, so a jsdom smoke test there would not verify anything useful.Verifying this change
This change adds tests and can be verified as follows:
npx ng test --watch=falseinflink-runtime-web/web-dashboard: 62 spec files / 248 tests pass (up from the 33 files / 139 tests on master).npm run lintandnpx prettier --checkare clean on all added files.Does this pull request potentially affect one of the following parts:
@Public(Evolving): noDocumentation
Was generative AI tooling used to co-author this PR?
Generated-by: Claude Code (claude-sonnet-5)