Skip to content

feat(ci): add e2e duration charts#2361

Draft
universal-itengineer wants to merge 5 commits into
mainfrom
chore/ci/e2e-report-add-graphs
Draft

feat(ci): add e2e duration charts#2361
universal-itengineer wants to merge 5 commits into
mainfrom
chore/ci/e2e-report-add-graphs

Conversation

@universal-itengineer
Copy link
Copy Markdown
Member

@universal-itengineer universal-itengineer commented May 18, 2026

Description

Why do we need it, and what problem does it solve?

What is the expected result?

Checklist

  • The code is covered by unit tests.
  • e2e tests passed.
  • Documentation updated according to the changes.
  • Changes were tested in the Kubernetes cluster manually.

Changelog entries

section:
type:
summary:

Add per-spec timing propagation, Chart.js report rendering, Loop file uploads, and local report artifacts so E2E failures can include duration context.

Signed-off-by: Nikita Korolev <nikita.korolev@flant.com>
- Propagate core.warning from messenger-report.js into buildThreadMessages
  so duration-chart rendering failures are visible in CI logs instead of
  being silently masked by the "Charts unavailable." placeholder.
- Cache ChartJSNodeCanvas as a module-level singleton; chart rendering
  is reused across clusters instead of allocating a fresh canvas each time.
- Sanitize cluster name when composing chart file names so unexpected
  characters cannot leak into uploaded Loop attachment names.
- Switch e2e-matrix workflow to npm ci with cache and document why
  node-version stays pinned to 20 (actions/github-script@v7 ABI).
- Add jest case asserting core.warning is emitted when chart rendering
  rejects.

Signed-off-by: Nikita Korolev <nikita.korolev@flant.com>
If the Loop bot token lacks the upload_file permission, /api/v4/files
returns HTTP 403 and the per-file uploadFileToLoop call throws. The
exception used to propagate out of makeThreadedReportInLoop, aborting
the whole thread and dropping the failed-tests reply that we delivered
before charts were introduced.

Wrap the per-reply upload in try/catch, log a warning explaining that
attachments are skipped, and still post the reply text. The behaviour
is now strictly additive to the pre-charts implementation: chart
attachments are best-effort, the failed-tests table is guaranteed.

Add a jest case that mocks /api/v4/files with a 403 and asserts the
thread reply is posted without file_ids.

Signed-off-by: Nikita Korolev <nikita.korolev@flant.com>
…s only

Per user feedback after a local run review: the main message has to
match the pre-charts main-branch layout, and the per-cluster thread
reply should attach only the chart PNGs without the extra "### Test
durations / Attached charts: ..." caption block.

- markdown.js: drop renderTopSlowestSection (and the
  formatDuration/renderDurationBar helpers it owned) and the call
  from buildMainMessage so "Top slowest tests" no longer appears in
  the main message.
- markdown.js: shrink renderChartCaption to "Charts unavailable."
  only on chart-render error and an empty string otherwise, so a
  cluster with successful charts gets a clean
  **[cluster](url)** header plus file attachments.
- messenger-report.test.js: refresh the chart and Loop scenarios to
  assert the new minimal thread layout and the absence of the
  Top-3 section in the main message.

Failed-tests thread reply behavior is preserved: clusters with
failures still get the "### Failed tests" table, just without the
chart caption block underneath it.

Signed-off-by: Nikita Korolev <nikita.korolev@flant.com>
Signed-off-by: Nikita Korolev <nikita.korolev@flant.com>
@universal-itengineer universal-itengineer force-pushed the chore/ci/e2e-report-add-graphs branch from 6aac4a5 to 63d3cc7 Compare May 19, 2026 09:16
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.

1 participant