Skip to content

Latest commit

 

History

History
81 lines (56 loc) · 3.49 KB

reporting.md

File metadata and controls

81 lines (56 loc) · 3.49 KB

Reporting

Every run writes its output under reports/, which is git-ignored. Nothing is written outside that folder.

What a run produces

flowchart LR
    RUN["bun run test"] --> MONO["reports/monocart/index.html: Monocart report"]
    RUN --> HTML["reports/html/: Playwright HTML report"]
    RUN --> TR["reports/test-results/: traces, screenshots, videos on failure"]
    RUN -. "CI only" .-> JUNIT["reports/junit/results.xml: JUnit XML"]
    RUN --> CONSOLE["Console: list reporter, or github annotations in CI"]
Loading

Text alternative: one run writes a Monocart report, a Playwright HTML report, and failure artifacts (traces, screenshots, videos) into reports/. In CI it also writes a JUnit XML file. The console shows results live.

Output Path When
Monocart report reports/monocart/index.html every run
Playwright HTML report reports/html/ every run
Traces, screenshots, videos reports/test-results/ on failure (and a retry trace in CI)
JUnit XML reports/junit/results.xml CI only
JSON (flaky-test count) reports/json/results.json CI only

Opening reports

bun run report:monocart    # opens reports/monocart/index.html in your browser
bun run report:html        # opens the Playwright HTML report

Open a trace with Playwright's viewer:

bunx playwright show-trace reports/test-results/<test-folder>/trace.zip

Configuration

Reporters are set in playwright.config.js:

  • Local runs: list, Monocart, HTML, and the custom console reporter in src/reporters/custom-reporter.js.
  • CI runs (CI set): github annotations, Monocart, HTML, JUnit, and the custom reporter.

The Monocart report name includes the environment, so reports from different environments are easy to tell apart.

Cleaning up

bun run clean    # deletes reports/

test:ci runs clean first, so each CI run starts with an empty folder.

CI artifacts

Each workflow uploads reports/ as an artifact named for the workflow and run:

Workflow Artifact name Retention
CI reports-ci-<run id> 14 days
Nightly reports-nightly-<environment>-<run id> 30 days
Production smoke reports-prod-smoke-<run id> 30 days

Download an artifact from the run summary, unzip it, and open monocart/index.html.

Run summary

Each CI, nightly, and production run writes a short table to the run's summary page. It shows the environment, the number of tests, passed, failed, flaky, and skipped, and names the artifact that holds the full report. The table is built from reports/junit/results.xml and reports/json/results.json by scripts/ci-summary.js.

Flaky means a test that failed at least once and then passed on a retry. A flaky test is not a pass. Treat a non-zero flaky count as a bug to fix or quarantine, and do not let retries hide it. If the JUnit file is missing, the summary says so and the run is not failed.

Why Monocart instead of Allure

See ADR 0002.