Test reports on every CI
To find why a build failed, Fistron reads its test reports. A JUnit report names the failed tests and their errors; a Cucumber suite’s JSON report also names every step of a failed scenario, with its result and time: which steps passed before the failure, which one failed, which were skipped. With the steps, Investigate a failed build and the Daily CI review’s RCA see where a scenario stopped and what passed before it, so read the Cucumber JSON whenever the suite writes one.
The rules are the same on every CI; only where the files are differs.
What Fistron reads without a setting
| CI | Where Fistron looks for the Cucumber JSON |
|---|---|
| Jenkins | the build’s archived artifacts named like a Cucumber report; else each HTML report the build archived (the HTML Publisher’s, as the build’s console log names it), by the usual names |
| GitHub Actions | the files named like a Cucumber report in the run’s artifacts whose name holds cucumber |
| GitLab CI | the files named like a Cucumber report in the failed job’s artifacts |
| Any CI, Fistron’s own step | the files named like a Cucumber report in the workspace of the job the step runs in |
Named like a Cucumber report: a .json file whose name holds cucumber,
or any .json file under a folder whose name holds cucumber
(**/*cucumber*.json, **/*cucumber*/**/*.json). The usual names in an
HTML report: cucumber_report.html.json, cucumber_report.json,
cucumber.json, report.json, output.json, results.json. A file is
used only when it is a Cucumber JSON report (a list of features).
When the suite keeps it elsewhere
Name the files in test_reports of the CI’s section of the agent’s
configuration (Agents › its Configuration). The patterns are paths:
** any folders, * within one name. Set, only these are read.
| CI | test_reports names |
Example |
|---|---|---|
Jenkins [acquisition.jenkins] |
archived artifacts, else the workspace’s files ({build} the build’s number); report:<report>/<file> a file of an archived HTML report |
["results/{build}/cucumber_report/*.json"], ["report:TestSuite_20Report/cucumber_report.html.json"] |
GitHub [acquisition.github] |
<artifact>/<file in it> of the run’s artifacts |
["test-results/**/*.json"] |
GitLab [acquisition.gitlab] |
files in the failed job’s artifacts | ["reports/cucumber/*.json"] |
| Fistron’s step in your pipeline | FISTRON_TEST_REPORTS, patterns separated by commas, in the step’s environment |
FISTRON_TEST_REPORTS=out/cucumber/*.json |
Fistron says when it is needed: when a Cucumber suite’s failed tests come
without their steps, the report of Investigate a failed build says that
no Cucumber JSON was read and what to set (for a Jenkins build that
archived an HTML report, the exact report: entry to complete).
A Cucumber report longer than max_report_bytes (20 000 000 by default),
usually for its embedded screenshots, is read as a stream: every scenario
with its steps, results and errors, and of each screenshot only that it
is there. When even that is too long, only the scenarios that did not pass
are kept. The import’s notes say how long the report was and what was
kept.
When an entry you set was not read, the same note says why, entry by
entry: not in the build (with the address tried, HTTP 404), too long even
read as a stream (then raise max_report_bytes in the same section above
the report’s size), or read but no Cucumber JSON (with the address, its
size and what it was instead, an HTML page such as a sign-in page, for
example). A build investigated again reads its test
reports again when the configuration names others than when the build was
first imported, and the investigation’s record says so.
To find the file on Jenkins: open the HTML report’s (all files in zip)
(or download <build>/<report>/*zip*/<report>.zip) and look for a .json
file that starts with [; in the workspace, open the build’s
Workspaces and its results folder. On GitHub and GitLab, download the
run’s or the job’s artifacts and look the same way.
Another CI
Fistron reads Jenkins, GitHub Actions and GitLab CI by their APIs. On any
other CI (Travis CI, CircleCI, Buildkite, Azure Pipelines and others) its
step in the pipeline runs where the tests ran, so it reads the reports from
the workspace by the same rules, with FISTRON_TEST_REPORTS when they are
named otherwise (use-fistron-in-your-ci.md).
Without the step, put the job’s log (console.log) and its reports
(Cucumber JSON under cucumber/, JUnit XML beside the log) in a folder and
run fistron causes analyze <folder>: the same reading, the same groups.