CI/CD for test suites
Not which CI tool — they are broadly the same. What matters is where tests run in the pipeline, what they block, how failures are reported, and how the whole thing stays under the runtime budget a team will actually tolerate.
Continuous integration (CI) is the practice of merging often and having every merge automatically built and tested. Continuous delivery (CD) extends that so every passing build is releasable.
For a tester, the pipeline is where your work either protects a release or gets quietly skipped. Three decisions matter, and they are yours to influence.
What blocks. Which failures stop a merge or a deploy, and which only report.
What runs where. Fast checks on every commit, slower ones later, expensive ones on a schedule.
Who fixes. A red pipeline needs an owner, or it stays red until somebody switches the notification off.
The terms you will hear
- Stage, or job. One step in a pipeline, such as lint, unit, integration.
- Gate. A stage whose failure blocks progress.
- Required check. A gate enforced by the repository, so a pull request cannot merge without it.
- Artifact. Something a stage produces and passes on, such as a build or a test report.
- Fail fast. Ordering so the cheapest, most likely failure runs first.
- Non-blocking, or advisory. A stage that reports and does not stop anything.
How to stage a suite
Order by cost, so a broken build is known in seconds rather than in twenty minutes.
- Static, in seconds. Types, lint, formatting, schema validation. No execution.
- Unit and component, in a minute or two. Cheap, precise, and where most logic defects surface.
- Integration, in a few minutes. Real database, stubbed third parties, per mocking.
- A handful of end-to-end, in a few more. The critical journeys only, per pyramid or trophy.
- Nightly, everything expensive. Full browser matrix, performance, mobile real devices, red-team suites.
Why it matters
Because suite duration quietly sets team behaviour.
For example, a pipeline taking 35 minutes produces larger, less frequent merges, because nobody wants to wait twice. Larger merges are harder to review and harder to diagnose when they break. Cut the same pipeline to six minutes and merges get smaller, which makes every failure easier to attribute.
That is why suite duration is not a testing detail. It shapes how the team works, and arguing for it is a legitimate part of the job.
What good practice looks like
- Publish the report as an artifact, so a failure can be read without re-running anything.
- Keep traces and screenshots on failure only. Enough to diagnose, no storage cost on green runs.
- Make one retry visible. Retries are acceptable while flakiness is being fixed, and only if they are counted, per flakiness.
- Name an owner for red. Whoever merged, by default. A pipeline everybody owns is one nobody fixes.
- Separate infrastructure failures from test failures. A farm timeout is not a defect and should not read like one.
- Set and defend a duration budget. For example ten minutes to merge. Adding a test then means removing one.
- Run the same commands locally. If a developer cannot reproduce a CI failure with one command, the pipeline is a black box and diagnosis costs hours.
A worked pipeline
For example, here is one small team's layout after a clean-up.
BEFORE one job, everything, 34 minutes, required
developers merged twice a day and re-ran the pipeline most times
red about 40 percent of the time, mostly browser flakiness
AFTER staged, with only three gates
ON EVERY PUSH (required, 5 min 40 total)
lint and types 45s gate
unit + component (312 tests) 95s gate
api + integration (128 tests) 2m10 gate
e2e smoke (6 journeys, chromium) 1m50 gate
buy a book, buy with a gift card, refund, login,
password reset, checkout on iOS viewport
ON MERGE TO MAIN (advisory, reported in the channel)
e2e full (31 journeys, chromium + webkit) 9m
visual regression (15 comparisons) 2m
contract verification 40s
NIGHTLY (advisory, paged only on repeated failure)
full browser matrix, mobile real devices, performance,
eval suite, red-team suite
RULES
duration budget for the required set: 6 minutes. exceeded means
something moves to advisory or gets deleted.
one retry, counted, reported in the summary
infrastructure failures tagged separately from test failures
red on main is owned by whoever merged, and it is the only
notification that pages anyone
RESULT after 8 weeks
required set 5m40, red 4 percent of runs (was 40)
merges per day 2 -> 9
two production defects caught by the advisory full e2e set,
which would previously have been skipped in a re-runThe thing to notice is that the suite did not shrink. It was re-ordered, and only four stages kept the right to block.
How to show you know it
- A staged pipeline with three gates. Being able to explain what earns the right to block is the core judgement here.
- A duration budget. "Six minutes to merge, so a new test displaces an old one."
- A separated infrastructure category. It keeps failure numbers honest.
- A merge frequency change. Showing that a faster pipeline changed how the team works is the strongest argument you will ever make for suite hygiene.
Questions
Should end-to-end tests block a merge?
A handful of stable ones, yes. A full browser suite, no. Six journeys that almost never flake are worth the ninety seconds; thirty-one are not.
What do we do about a permanently red advisory stage?
Fix it or delete it. An advisory stage nobody acts on trains people to ignore reports, and it is the same rot as an unowned quarantine list.
How fast should the required set be?
Fast enough that nobody minds waiting, which in practice means under about ten minutes. The exact number matters less than having one and defending it.
Who should own the pipeline?
Whoever owns the tooling, with testers deeply involved in what blocks. The gate decisions are quality decisions, so having no say in them is a bad position to be in.