Skip to content

[FLINK-40601][runtime-web] Add Vitest specs for remaining web dashboard views - #29138

Open
spuru9 wants to merge 5 commits into
apache:masterfrom
spuru9:FLINK-40601
Open

[FLINK-40601][runtime-web] Add Vitest specs for remaining web dashboard views#29138
spuru9 wants to merge 5 commits into
apache:masterfrom
spuru9:FLINK-40601

Conversation

@spuru9

@spuru9 spuru9 commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

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:

  • Core services: config, overview, status, job-manager, and job services (task-state normalization, plan/stream-graph conversion, accumulator merge, desired-parallelism update, and the refresh stream).
  • Job-detail drawer views (pages/job/overview/*): accumulators, backpressure, chart, detail, flamegraph, subtasks, taskmanagers, watermarks.
  • JobManager pages: log, stdout, thread-dump, and profiler.
  • TaskManager pages: stdout, thread-dump, and profiler (the siblings of the JobManager pages above; logs/metrics/list already had specs).
  • Local stores: the job-local and application-local services (replay of the latest job/vertex/application detail and the paired job-with-vertex stream).
  • Page shells: the job/application list shells and the job/application detail shells.
  • Job chart and submit: the metric chart card and its resize service, and the job submission page.

Components that pull in chart/graph/editor children or fetch through services in ngOnInit are constructed directly and driven through their lifecycle/methods, so the controller logic is exercised without rendering children jsdom cannot draw.

dagre.component and flame-graph.component are 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=false in flink-runtime-web/web-dashboard: 62 spec files / 248 tests pass (up from the 33 files / 139 tests on master).
  • npm run lint and npx prettier --check are clean on all added files.

Does this pull request potentially affect one of the following parts:

  • Dependencies (does it add or upgrade a dependency): no
  • The public API, i.e., is any changed class annotated with @Public(Evolving): no
  • The serializers: no
  • The runtime per-record code paths (performance sensitive): no
  • Anything that affects deployment or recovery: JobManager (and its components), Checkpointing, Kubernetes/Yarn, ZooKeeper: no
  • The S3 file system connector: no

Documentation

  • Does this pull request introduce a new feature? no
  • If yes, how is the feature documented? not applicable

Was generative AI tooling used to co-author this PR?
  • Yes (please specify the tool below)

Generated-by: Claude Code (claude-sonnet-5)

…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)
@flinkbot

flinkbot commented Sep 8, 2026

Copy link
Copy Markdown
Collaborator

CI report:

Bot commands The @flinkbot bot supports the following commands:
  • @flinkbot run azure re-run the last Azure build

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants