Your pipeline copies the previous Allure 2 report's `history/` directory into each new run's results, yet the trend chart keeps restarting from one or two points. How do you diagnose that, and why can the lost trend not be rebuilt from the archived results directories?
answer
- derived from the previous one, every time
- one missed build shortens it for good
- nothing fails when it is absent
- several results directories become one point
basics
~20 sEach report's history folder is built from the previous one plus the current run, so it is a chain. A single build that generates without it truncates everything earlier, permanently: a results directory holds only its own run.
solid answer
~50 sA report's `history/` directory is derived from the history carried into that run plus that run's own results, so the series is a chain of derivations rather than an archive. Any build that generates without the carried folder writes a report whose history contains only itself, and every later build copies that truncated file forward -- so one break shortens the trend for good. Nothing shouts, because the generator's history read is guarded by an existence check with no failure branch. Diagnose it from the artefacts: inspect the generated report's `history/history.json` and count entries for a long-lived case, confirm the folder is present in the results directory immediately before generation, and find the build where the depth drops. Re-generating from archived results does not help -- `allure generate` merges several results directories into **one** report with **one** new trend point.
go deeper
Know that the trend depends on a folder being carried from one build to the next, and that if a build skips that step the earlier points are gone rather than temporarily hidden.
Explain the derivation: this report's history equals the carried history plus this run. Then explain why that makes a break propagate forward instead of healing on the following build.
Demonstrate the diagnosis from artefacts rather than from the chart -- count entries in the generated history file, bisect to the build where depth drops, and confirm the copy landed in the directory the generator actually read.
Argue for where the guarantee should live. A silent, unowned file copy that quietly loses months of trend is a reliability problem, and you are expected to say what makes its failure visible on the day.
## History is a chain, not an archive Each Allure 2 report's `history/` directory is derived from exactly two inputs: **the history directory carried into that run's results**, and **that run's own results**. The generator prepends the current run to each series and writes the combined series into the new report. That makes the sequence a chain of derivations: ``` report N-1/history -> results N/history -> generate -> report N/history ``` Nothing outside that chain holds the older points. There is no store the generator can go back to, and a results directory contains only the run that produced it. So the property that matters operationally is this: **the trend's depth is a function of the unbroken chain behind it, not of how many builds have run.** ## What breaks a chain The symptom -- a trend that keeps restarting from one or two points -- is almost always one of a small number of causes: - **A build that generated with nothing carried in.** Its report's `history/` contains only itself. Every subsequent build copies *that* folder forward, so the truncation propagates and the trend never recovers on its own. - **The copy running after generation rather than before.** The report is built with no history, and the folder copied afterwards is not read by anything. - **Copying into the report directory rather than the results directory.** The generator does not read its own output directory as a source. - **Carrying from a stale source.** If the copy always takes `history/` from the same pinned report rather than from the immediately preceding build of the same series, the trend is not restarting -- it is frozen, and each run appears as the second point. - **A different results directory than the one the generator was pointed at.** The carry lands in one folder and the generator reads another; both steps report success. Whether the previous report is *available* when the copy runs -- how a pipeline holds it between builds -- is a separate concern with its own answers. What belongs here is that the carry step must land the folder in the results directory the generator is about to read, before it reads it. ## Why nothing shouts The generator's history read is guarded by a file-existence check with no failure branch. A missing `<results>/history/history.json` is not an error and not a warning: the plugin contributes nothing and generation continues to a successful exit. That is a deliberate design -- the first run of any suite legitimately has no history -- but it means a broken carry step is **indistinguishable from a first run** in every signal the build emits. Pipelines lose their trend for months this way. ## Why archived results do not bring it back The instinct is to re-generate a report from the last several builds' archived results directories and get the trend back. It does not work, for a specific reason: `allure generate` accepts several results directories, but it **merges them into one report**. The current trend point is computed over everything the generator read in that pass, so six archived results directories produce **one** report with **one** new trend point covering all six runs' tests together, not six points in sequence. The only thing that could restore the earlier points is the `history/` file that existed at the time -- and if it had existed, the chain would not have broken. Re-generation recovers the per-run reports; it does not recover their ordering as a series. ## Diagnosing it Work from the artefacts, not from the chart: 1. **Open the generated report's `history/history.json`** and look at how many entries a stable, long-lived test case has. That is the real depth of the carried series, independent of anything the UI is doing. 2. **Check the results directory just before generation** and confirm `history/history.json` is present there. If your build log does not show that, add a step that does. 3. **Compare consecutive builds.** If build N's report has a deep history and build N+1's has one entry, the break is at N+1 and the cause is in that build's carry step, not in the data. 4. **Confirm the source.** Verify the copy took the previous build's report of the same series, not a fixed or default location that happens to hold an old one. ## What to change once you have found it The durable fix is to make the carry step's failure loud rather than silent: assert that `<results>/history/history.json` exists immediately before generation and fail the step if it does not, with an explicit exemption for the genuine first run of a series. That converts a permanently truncated trend into a red build on the day it breaks -- which is the only point at which the missing points are still recoverable, because the previous report still has them.
- How would you make this failure loud instead of silent?Assert that `<results>/history/history.json` exists immediately before generation and fail the step when it does not, with an explicit exemption for the genuine first run of a series. That turns a permanently truncated trend into a red build on the day it breaks, while the previous report still holds the points that would otherwise be lost.
- The copy runs every build and always succeeds, but the trend is frozen at two points. What does that suggest?A stale source. If the copy always takes `history/` from the same fixed report rather than from the immediately preceding build of the same series, every run reads the same old series and appends itself, so the chart shows an unchanging past plus today. The chain is intact but it is not advancing.
- Does the carried file grow without bound if nothing prunes it?No. The generator prepends the current run to each series and keeps a bounded window, discarding the oldest entries as it writes. The carried directory therefore reaches a stable size instead of growing for the life of the project, and very old points fall out of the trend whether or not the chain is intact.
The carried folder is a relay baton, not a scoreboard. Each build takes it, adds one lap and hands it on. Drop it once and every lap run before the drop is gone, because nobody else was keeping the count.
saying these in an interview costs you the question
- Believes archived results can rebuild a lost trend
- Expects generation to fail when history is missing
- Thinks the next build repairs a truncated series
- Blames the chart renderer rather than the input
- Assumes several results directories give several trend points