A CI/CD pipeline should answer one question: can this change safely move on? Tests are the main source of that answer. The problem is that many teams put every test into a single step. The result is predictable: the pipeline takes 40 minutes, developers stop waiting for the outcome and a red status becomes background noise that everyone ignores.

A good pipeline does not run everything every time. It runs the right tests at the right moment.

The rule: fastest feedback first

Each pipeline stage should be faster and cheaper than the next. First we catch problems that can be detected in seconds, and only then invest time in tests that need an environment, data and a browser.

In practice, four levels work well.

1. On every commit: static checks and unit tests

  • linting, formatting and type checks,
  • unit and component tests,
  • dependency scanning for known vulnerabilities.

Goal: a result in under five minutes. If this stage takes longer, developers will start working around it.

2. On pull requests: integration and API tests

This is where we check whether modules and services work together: API contracts, reading and writing data, error handling and authorisation. API tests are usually many times faster and more stable than UI tests, and they catch a large share of integration problems.

3. After merge: critical end-to-end journeys

Browser-based E2E tests are the most expensive and the most prone to instability. That is why it pays to limit them to a handful of critical journeys: login, sign-up, payment, the key form. They run on a production-like environment after every merge to the main branch.

4. Before and after release: smoke tests and monitoring

After deploying to preview or production, a short smoke suite confirms that the application is up, key pages respond and integrations work. If not, an automatic rollback is cheaper than late-night firefighting.

An example stage layout

commit        → lint, types, unit tests             (~3 min)
pull request  → integration and API tests           (~8 min)
merge to main → critical E2E journeys on staging    (~15 min)
deploy        → smoke tests + rollback on failure   (~2 min)
nightly build → full regression, accessibility, performance

Full regression does not have to block every change. It can run in a nightly build and report in the morning, provided someone actually reads the results.

Where does manual testing fit?

Pipeline automation checks what we already know should work. It will not judge whether a new feature makes sense to users, whether an error message is understandable, or what happens when someone does something unexpected. Exploratory testing of new features and accessibility reviews still need a person, ideally before the change is released rather than after a customer reports it.

Common mistakes

  • Everything in one step. A long pipeline means slow feedback and the temptation to bypass it.
  • Too many E2E tests. Any scenario that can be checked at API level should be checked there.
  • Tolerating flaky tests. One test that “sometimes fails” teaches the team to ignore a red status.
  • No owner for the results. A nightly regression report that nobody opens is not quality control.
  • An untested rollback. A restore procedure that has never been exercised usually fails exactly when it is needed.

Where to start

You do not need to rebuild the whole process. Start by measuring how long the current pipeline takes and which tests fail most often for no reason. Then split out a fast commit stage, move suitable scenarios from UI to API and choose a few critical E2E journeys. These three steps alone usually cut feedback time in half.

A pipeline is only as valuable as the team’s trust in its result.

If you would like us to look at your pipeline and propose a testing layout, describe your product - we will start with a review of the current repository.