Software Testing / Learning brief

Leo fails the build when k6 is too slow

What this means in plain language

Leo adds k6 to a GitHub Actions workflow, lets a broken threshold turn the build red and saves a summary file.

Understand the full idea, step by step

Analogy: a railway signal that stops the train. A signal turns red when the track ahead is not safe. The driver does not argue, and the train waits. A note of the reading is kept at the station.

The k6 exit code verdict (the number k6 returns, zero or not) is the signal. A k6 pipeline step (a step that installs and runs k6 in the build) is the track. A k6 summary file (a saved file of results) is the note at the station.

Evidence & review

REVIEWED 2026-10-31

The date on this lesson is when it went up on Payments Signal, not when its material was written — most of these were brought across from an earlier catalogue in a single run, which is why so many of them share a date. What the lesson says about the world is dated by the review above and by the sources below it.

Hands-on steps for this tool. The people and the app are invented.

What this brief simplifies: Fiction labelled SYNTHETIC / TRAINING ONLY. Sources were seen only as search excerpts. Tools and screens change, and each team sets its own.

Sources for this brief — 3 sources
  1. Market practice

    Add k6 as a continuous integration and delivery pipeline step (Grafana k6 learning path) ↗ — Grafana Labs · Grafana learning path: setup-k6-action installs k6, run-k6-action runs a script from a path, and a non-zero k6 exit code such as a threshold breach fails the job; a learning hub page names exit code 99 and the main docs do not give the number (search excerpt, page not opened)

    The Grafana learning path: the setup-k6-action installs k6 and the run-k6-action runs a script from a path. A non-zero k6 exit code, such as a threshold breach, fails the job. A learning hub page names exit code 99 for a failed threshold, and the main docs do not give the number. · Checked 2026-10-31

    Found through a web search; the page was not opened (search excerpt, page not opened). Version: Web page, no edition number. Licence terms were not read, so put it in your own words and do not quote it. Open the page and confirm what it says before relying on any detail.

  2. Market practice

    End of test and Custom summary (Grafana k6 documentation) ↗ — Grafana Labs · Grafana k6 docs: handleSummary receives the metrics and returns text or files, --summary-export writes a JSON file, and the docs now discourage that flag (search excerpt, page not opened)

    The Grafana k6 pages on the summary: handleSummary receives the metrics and returns text or files for stdout, stderr or a path. The flag --summary-export writes a JSON file, and the docs now discourage it. · Checked 2026-10-31

    Found through a web search; the page was not opened (search excerpt, page not opened). Version: Web page, no edition number. Licence terms were not read, so put it in your own words and do not quote it. Open the page and confirm what it says before relying on any detail.

  3. Simplified educational illustration

    Payments Signal editorial teaching models — Payments Signal

    This site's own simplified teaching models. · Checked 2026-07-12

    Used wherever diagrams, scenarios, figures, or example values are didactic constructions rather than sourced facts; every such use carries a simplifications disclosure. All people, companies, banks, and list entries in examples are fictional.

Learn this properly

START HEREk6 part 3: run k6 in a pipeline, fail the build and keep the resultsRun the k6 script in GitHub Actions, let a broken threshold fail the build through its exit code, and save a summary file for the team.Opens at L0 Explain simply · about 16 min

Related briefs

When Leo cannot see it

Leo cannot reproduce Tom's late reminder bug. Tom does not argue. He finds his receipt, the build number and a short video, and Leo sees the bug. A lost shop order shows how to reply calmly.

READ BRIEF

It works on my machine, says Leo

Tom reports a reminder that shows the wrong time and Leo cannot see it. Tom writes down both setups, compares them side by side and finds that the time zone is the difference.

READ BRIEF