Skip to content

Improve Markdown report and exclude step artifacts from test artifacts#795

Open
DavertMik wants to merge 6 commits into2.xfrom
improve-markdown-pipe
Open

Improve Markdown report and exclude step artifacts from test artifacts#795
DavertMik wants to merge 6 commits into2.xfrom
improve-markdown-pipe

Conversation

@DavertMik
Copy link
Copy Markdown
Contributor

Summary

  • Markdown pipe layout: per-test meta now renders as a table; <br>-joined string steps split into a bullet list with parsed durations; artifacts collapse into <details>; the noisy Environment section is removed.
  • Client: step artifacts no longer leak into the test-level artifacts list. addTestRun collects step artifact paths before upload and filters them out of files and manuallyAttachedArtifacts. Step artifacts still upload to S3 and stay attached to their step.
  • Docs: new docs/pipes/markdown.md, Markdown + HTML added to the built-in pipes index, and a Markdown report link in the README documentation list.

Test plan

  • npx mocha tests/unit/pipes/markdown_pipe_test.js (16 passing, including new assertions for the table layout, no-Environment-section, and <details> artifacts wrapper)
  • Full unit suite: 413 passing / 12 failing (same 12 failed pre-existing on 2.x, unrelated to this change)
  • Smoke test on a synthetic test payload: data.files retains test-only files and excludes paths referenced by step.artifacts; the existing step-artifact upload path is untouched
  • Verify rendered Markdown on a real run (TESTOMATIO_MARKDOWN_REPORT_SAVE=1 ...) shows: meta table, step list, fenced logs/stack, collapsible artifacts, no env block, no per-step screenshots duplicated under Artifacts

🤖 Generated with Claude Code

DavertMik and others added 6 commits May 6, 2026 01:22
…rtifacts

- Markdown pipe: render per-test meta as a table; parse <br>-joined string
  steps into a bullet list with parsed durations; wrap artifacts in
  collapsible <details>; remove the noisy Environment section.
- Client: collect step artifact paths before upload and filter them out of
  test-level files / manuallyAttachedArtifacts so per-step screenshots no
  longer duplicate into the test artifacts list. Step artifacts continue to
  upload to S3 and stay attached to their step.
- Docs: add docs/pipes/markdown.md, list Markdown and HTML in the built-in
  pipes index, and link the Markdown report from README.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
The Testomat.io pipe already forwards a run-level description (e.g. the
Coverage pipe's coverageDescription on the shared store) to the API. Make
the local Markdown and HTML reports surface the same content:

- Markdown pipe: render description verbatim under a "## Description"
  section between Run Metadata and Tests.
- HTML pipe: pass description into the template, register a `markdown`
  Handlebars helper backed by `marked`, render it in a styled Description
  card beneath the header. Skip both the section and the surrounding
  whitespace when no description is provided.
- Add `marked` as a direct runtime dependency.
- Tests for both pipes cover the present-and-omitted cases.
- Docs: mention the new behavior in pipes/markdown.md and pipes/html.md.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
client.createRun(params) already passes params to every pipe.createRun, but
the testomatio pipe ignored params.configuration and built configuration
only from the coverage-derived store. The HTML and Markdown reports had no
way to display run configuration at all.

- Testomatio pipe: merge params.configuration into runParams.configuration
  sent to the API. Caller values win on key conflict; coverage-derived
  tests/suites lists are preserved when not overridden. Stash the same
  configuration on the shared store so other pipes can read it.
- Markdown pipe: stash params.configuration in createRun, render as a
  "## Configuration" key/value table after the Description. tests/suites
  arrays are skipped (those are coverage scoping, not user config).
- HTML pipe: stash params.configuration in createRun, expose to the
  template, render in a styled Configuration card after the Description.
- Tests: 4 new pipe tests cover present/absent for both reports.
- Docs: pipes/markdown.md and pipes/html.md mention configuration support.

Caller usage:
  client.createRun({ configuration: { exploratory: true } })

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
marked v14's parse() return type is string | Promise<string> because the
parser supports async extensions. SafeString expects string, so tsc
rejected the assignment in CI. Pass { async: false } to pin the synchronous
overload.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Markdown pipe tests set process.env.TESTOMATIO_RUN to assert the env table,
but never restored process.env. The leak survived into testomatio_pipe_test.js,
where TestomatioPipe(...) saw an existing run id and switched createRun() to
PUT /api/reporter/{id} — a path the mock-http-server didn't have a handler
for, breaking 7 testomatio tests and the XML Reader run-id test on CI.

- markdown_pipe_test.js: snapshot process.env in before(), restore in after().
- testomatio_pipe_test.js: server.reset() in afterEach so handlers from one
  test don't leak into the next (defensive hygiene; the env restore above is
  the actual fix for the CI failures, but the mock-server reset removes a
  similar accidental coupling within the file itself).

Verified: bringing markdown_pipe_test.js + testomatio_pipe_test.js together
in the same mocha run goes from 7 failing to all 74 passing.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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