skip to content

Summary Tiles

The panels an overview page ships and what each is really computed from — the file behind it, the denominator and the window — so a tile can be read honestly rather than quoted.

on this pageshow

explore

questions

5

In a report generated by Allure 2, the overview page's panels are not computed in the browser from the raw results. Where does the generator put each panel's numbers, and what does `widgets/summary.json` hold?

level: juniorimportance: must knowfreq 62%

answer

  1. one file per panel, written at generate
  2. a sibling directory of data and history
  3. widgets/, one JSON named per tile
  4. summary.json: reportName, statistic, time

basics

~20 s

Allure 2 writes one JSON file per panel into the generated report's widgets directory at generate time. The file widgets/summary.json holds the report name, a five-status statistic with a derived total, and a time block for the run.

solid answer

~40 s

An Allure 2 report is a static site, and every overview panel is backed by a file the generator already wrote into `widgets/`. Each aggregator plugin runs once over the parsed results and emits a small JSON document at a fixed path — `widgets/summary.json`, `widgets/status-chart.json`, `widgets/duration.json`, `widgets/suites.json` and the trend files beside them — and the browser only draws what is there. `widgets/summary.json` carries `reportName`, an empty `testRuns` list, a `statistic` of `failed`, `broken`, `passed`, `skipped` and `unknown` plus a derived `total`, and a `time` block of `start`, `stop`, `duration`, `minDuration`, `maxDuration` and `sumDuration`. Because those numbers are frozen at generate time, nothing in the interface re-derives them: a stale tile means a stale `allure generate`.

code

json · 20 lines
json
{
  "reportName": "Allure Report",
  "testRuns": [],
  "statistic": {
    "failed": 4,
    "broken": 1,
    "skipped": 12,
    "passed": 803,
    "unknown": 0,
    "total": 820
  },
  "time": {
    "start": 1757260800000,
    "stop": 1757261412000,
    "duration": 612000,
    "minDuration": 8,
    "maxDuration": 41230,
    "sumDuration": 2841377
  }
}

go deeper

for a junior

Be ready to say that the generated report is static and that each overview panel reads one JSON file under widgets/, named for the panel. Naming summary.json and its statistic and time blocks is enough at this level.

for a middle

Explain the generate-time aggregation: plugins run once over the parsed results and write fixed paths, so total is derived from the five counters. Know that status-chart.json and duration.json hold one entry per result rather than buckets.

for a senior

Show that you use this in production — reading widgets/summary.json directly from a pipeline step, diagnosing a stale tile as a stale generate rather than a caching bug, and never confusing the widget and data copies of suites.json.

for a principal

Own the consequence for how your organisation quotes numbers. A frozen, file-backed tile is auditable and scriptable but cannot be re-sliced, so decide whether the report is the reporting surface or only a human view over something queryable.

## Where an overview panel's numbers actually come from An Allure 2 report is a static site. `allure generate` reads a results directory, parses every `-result.json` into an in-memory model, and then runs a chain of aggregator plugins over that model. Each aggregator writes a small JSON document into the generated `allure-report` tree. The browser that later opens `index.html` **draws** those documents; it never re-derives them from the raw results, which are not shipped into the report at all. The generated tree separates those documents by purpose: | directory | what it holds | |---|---| | `widgets/` | one small JSON file per overview panel | | `data/` | the full payload behind each tab | | `history/` | the trend files carried into the next run | | `plugins/` | the report's bundled plugins | | `export/` | CSV exports of the same data | So the answer to "where does this tile get its number" is always the same shape: a file in `widgets/`, named for the panel, written once at generate time. ## Which file backs which panel | file | panel | shape | |---|---|---| | `widgets/summary.json` | the totals tile | one object | | `widgets/status-chart.json` | the status breakdown | an array, one entry per counted result | | `widgets/duration.json` | the duration plot | an array, one entry per counted result | | `widgets/suites.json` | the suites panel | a `total` plus a trimmed `items` list | | `widgets/duration-trend.json` | the duration trend | an array of per-build points | | `widgets/categories-trend.json` | the categories trend | an array of per-build points | Two of those are worth pausing on. `widgets/status-chart.json` and `widgets/duration.json` are **not** aggregates at all: each is a flat array holding one entry per counted result, carrying that result's `uid`, `name`, `status`, `time` and `severity`. The binning into a chart happens when the panel is drawn. That is why those two files grow with the size of the suite while `widgets/summary.json` stays one small object however many tests ran. ## What `widgets/summary.json` holds The file is the serialised summary model, with four top-level keys: 1. `reportName` — the report's title, taken from the `--name` / `--report-name` option when one was given, otherwise from the run's executor block, otherwise the default literal `Allure Report`. 2. `testRuns` — a list this generator leaves empty. 3. `statistic` — five counters, `failed`, `broken`, `passed`, `skipped` and `unknown`, plus a `total`. Those five names are exactly the five values of the report-side status model in Allure 2, `unknown` included. 4. `time` — `start`, `stop`, `duration`, `minDuration`, `maxDuration` and `sumDuration` for the run as a whole. `total` is **derived**, not stored: it is serialised from the sum of the five counters, so it can never disagree with them, and it is not a count of files in the results directory. Each counter is incremented once per result the report counted, which means the tile speaks in results, not in distinct test cases. ## What follows from the numbers being frozen at generate time - **A tile is exactly as fresh as the last `allure generate`.** Re-opening the same `allure-report` directory redraws the same JSON. If a number looks stale, the question is when the report was generated, not whether the page cached something. - **Nothing in the interface re-derives a tile.** There is no filter that recomputes `statistic` for a subset; the panel shows what the aggregator wrote, whole. - **You can read a tile without a browser.** Because these are ordinary JSON files at fixed paths, a pipeline step can read `widgets/summary.json` directly to print a one-line run summary, without parsing the raw results again. - **The same name can appear in two directories.** `data/suites.json` and `widgets/suites.json` are written by the same plugin: the first is the whole tree the tab renders, the second the trimmed panel version. Reaching for the wrong one is the commonest mistake when scripting against a generated report. ## Reading the tile honestly Quoting a tile means quoting the file behind it. Before repeating a number off the overview, name which file it came from, whether that file is a per-run object or a per-build series, and what its counters count. `widgets/summary.json` answers the first two easily — it is one object, about one run — and its counters count the results the report kept. Anything you say beyond that is an inference you have added yourself, and it is worth saying out loud that you added it.

  • The overview shows a number you know is out of date. Where do you look first?
    At when `allure generate` last ran against that results directory. Widget files are written once, at generation, so a tile can only be as fresh as the last generate — reopening the same `allure-report` directory redraws the same JSON. Regenerate from the newer results rather than refreshing the page.
  • What does the generator write alongside `widgets/`, and why does that matter when scripting?
    `data/` holds the full per-tab payloads, `history/` the trend files carried to the next run, `plugins/` the bundled plugins and `export/` the CSV exports. It matters because one name can live in two of them: `data/suites.json` is the whole suite tree, `widgets/suites.json` the trimmed panel version.

saying these in an interview costs you the question

  • Claims the browser recomputes tiles from the raw result files
  • Thinks an overview panel can be re-filtered in the interface
  • Confuses widgets/suites.json with the full data/suites.json
  • Says total is stored rather than derived from the counters
open as a page

Allure 2's `widgets/summary.json` reports a run's time as both a `duration` and a `sumDuration`. What is each one computed from, and which of the two does the report's duration-trend tile plot?

level: middleimportance: must knowfreq 54%

basics

~20 s

In Allure 2, duration is the run's wall-clock span, the latest stop minus the earliest start. sumDuration adds up each counted result's own duration. The duration-trend tile plots the wall-clock span, not the summed test time.

open as a page

In an Allure 2 report, the tiles backed by `widgets/duration-trend.json` and `widgets/categories-trend.json` show points from earlier builds. How many points can such a file hold, and what happens to the oldest one when the next report is generated?

level: middleimportance: should knowfreq 46%

basics

~20 s

An Allure 2 trend file keeps twenty points, newest first. Each generate prepends this run's point and cuts to twenty, writing that cut list to both the widget and history files, so a dropped point leaves the chain for good.

open as a page

A colleague divides the tallest bar on an Allure 2 report's categories-trend tile by the `total` in `widgets/summary.json` and calls the result the share of tests hitting that failure class. What is each number's real denominator, and why does that ratio not mean what they think?

level: seniorimportance: should knowfreq 44%

basics

~20 s

The bar counts one build's failures; the total counts every result of the current run. Dividing them puts a failure numerator over an all-result denominator, and usually crosses two different builds as well, so the percentage means nothing.

open as a page

In an Allure 2 report, `widgets/suites.json` does not list every suite in the run. What does it list, in what order, and what is the `total` that sits beside those rows?

level: seniorimportance: nice to knowfreq 32%

basics

~20 s

It lists at most ten rows, built only from the top layer of the suite tree and ranked failures-first. The total beside them counts every top-level group in the whole tree, so the panel is a worst-ten board rather than an inventory.

open as a page