Your developer has pushed a small payment change, but the pipeline is still running. Unit tests have finished, browser tests are waiting for a runner, and nobody knows whether the red job is a broken checkout or another test-environment problem. The team is waiting for an answer that should've been straightforward.
Continuous integration and testing should shorten that uncertainty, not add more checks to an already crowded queue. The useful question isn't how many tests you can run. It's which test will give the developer a trustworthy answer at the moment they need it.
Table of Contents
- Which Tests Run on Each Pipeline Trigger
- How Continuous Integration and Testing Work Together
- Building a Test Pyramid That Stays High-Signal
- Running Suites in Parallel to Cut Wait Time
- Flaky Tests and Why Retries Hide Real Failures
- A Worked Example of One Release Pipeline
- Decide If Your Pipeline Is Ready to Release
Which Tests Run on Each Pipeline Trigger
What runs, and when? Start by giving each pipeline trigger a specific job. A pipeline is a set of automatic checks started by an event, such as opening a pull request, merging code, reaching a scheduled time, or preparing a release.
A pull request needs an answer about the proposed change. A merge needs evidence that the combined application still works. A nightly run can investigate a wider range of conditions, while a release candidate needs a clear decision about the package you intend to ship.
Give Each Trigger a Budget
The following is an illustrative starting policy, not a benchmark or a promise about your application. Treat the time budgets as targets to test against your own infrastructure.
Tests and time budgets by pipeline trigger
| Trigger | Tests to run | Time budget | If it fails |
|---|---|---|---|
| Pull request opened or updated | Lint, unit tests, integration tests, API smoke tests for changed services | Target under 10 minutes | Block merge; author fixes before review |
| Merge to main | Full API regression, contract tests, end-to-end checks on core journeys | Target about 30 minutes | Fix or revert within the hour to keep main releasable |
| Nightly schedule | Cross-browser runs, long end-to-end suites, broader performance checks | Allow up to several hours | Open a ticket with an owner; doesn't block merges by default |
| Release candidate | Release smoke tests, security scan, performance baseline, mobile build check | Target 30-60 minutes | Stop the release and make a go or no-go decision |
Think of airport security. Everyone goes through quick screening, while deeper checks happen where the risk justifies them before departure. You wouldn't make every passenger wait for every aircraft inspection.
Apply the same distinction to tests. Developers wait directly on pull-request results, but a scheduled compatibility run can finish while they work on something else. Use risk-based software testing to decide which failures deserve an immediate stop rather than treating every check as equally urgent.
Practical rule: Put the fastest, most decisive checks on the earliest useful trigger. Don't make a developer wait for a slow check that belongs later.
Every failed check needs a named owner and a blocking policy. A nightly failure might not block merges, but a confirmed defect in payment processing should still stop an affected release.
How Continuous Integration and Testing Work Together
A chef tastes a dish while cooking, not only after it reaches the serving counter. Continuous integration applies that habit to software: developers combine small changes frequently and check the result while they can still adjust it.
The 2014 State of DevOps Report described frequent integration with quick automated tests as a foundation for continuous delivery because the process creates canonical builds and packages that can ultimately be deployed.
CI isn't just an automated build. It combines integration, repeatable execution, and feedback. Continuous delivery extends that work by keeping the validated software ready for release; it doesn't necessarily mean deploying every change automatically.
Follow the Change Through the Pipeline
-
A developer commits a small change to the shared branch. Teams using pull requests validate the proposed merge before accepting it. The common slip is keeping a branch isolated until integration becomes a separate debugging project.
-
The build creates a repeatable artifact. An artifact is the application package or container image produced from the code. Pin dependencies and build inside a defined environment so success doesn't depend on software installed on a developer's laptop.
-
Fast unit tests check local behavior. They verify calculations, validation rules, and other isolated decisions. Avoid requiring a running application just to test a simple function.
-
Integration and API tests check boundaries. They exercise database access, service communication, and request handling. Mocking every dependency can hide the exact compatibility problem these checks should expose.
-
The pipeline packages and stores the validated artifact. Associate it with the commit and test results. Don't rebuild it differently for each environment, or you'll release something other than what you tested.
-
Staging checks exercise deployed behavior. Deploy that artifact with representative configuration and run selected end-to-end journeys. Watch for staging shortcuts that bypass authentication or other important production behavior.
-
The result returns to the developer. Send the failing assertion, logs, and relevant trace directly to the pull request or team channel. A notification that only says failed leaves the investigation unfinished.
The diagram summarizes that feedback loop.

Protect the Process That Runs the Checks
Build credentials and deployment permissions deserve the same care as application code. For a broader checklist when reviewing pipeline access, Rite NRG's security practices for software teams provide useful context.
Feedback should arrive progressively, not only after staging finishes. When a failure appears close to its introducing change, the developer has less history to investigate and less context to reconstruct.
Map your current pipeline to these steps. Mark every stage without an automatic check, and every failure notification that doesn't explain what someone should do next.
Building a Test Pyramid That Stays High-Signal
A building needs a wide foundation, not extra floors balanced on a narrow base. The test pyramid follows the same logic: broad coverage of isolated behavior supports a smaller collection of checks that exercise the whole application.
A high-signal suite gives useful evidence. A failure usually points to a genuine defect, and a pass supports confidence in the behavior the suite covers. It doesn't prove that untested behavior works.
The pyramid shows the intended balance, not a mandatory test-count ratio.

Choose the Layer That Exposes the Defect
These speed categories describe practical expectations for small, isolated checks, not guaranteed execution times.
Test layers compared by speed and purpose
| Layer | Typical speed | Runs on | Best at catching |
|---|---|---|---|
| Unit tests | Milliseconds per test | Every commit | Logic errors inside a single function |
| Integration tests | Seconds per test | Every pull request | Broken contracts between modules and the database |
| API tests | Seconds per test | Pull request and merge | Wrong responses, authentication failures, schema changes |
| End-to-end tests | Minutes per test | Merge and release | Broken user journeys such as sign-up or checkout |
| Performance and security tests | Minutes to hours | Nightly and release | Slow paths, load limits, known vulnerabilities |
Use unit tests for decisions such as whether a discount applies. Use integration tests to verify that an order can be written and read with the actual database schema. An API test can check whether an unauthorized request is rejected without opening a browser.
End-to-end checks answer a different question: can a customer complete the journey through the deployed system? Keep them focused on sign-up, login, checkout, or the main data-entry flow. Performance and security checks add evidence about operating conditions and exposure that successful functional tests don't establish.
These categories overlap. An API test can also be an integration test, and functional behavior can be checked at several layers. The distinction between functional tests and unit tests helps prevent the mistaken assumption that every business rule needs a browser test.
Remove Duplicate Work, Not Useful Protection
Say checkout supports different tax rules. Verify the calculation cases close to the calculation code, then retain a browser journey that confirms the interface, API, and saved order agree.
If a lower-layer check can catch the same defect with the same confidence, move the detailed coverage down.
Rewrite timing-sensitive browser checks instead of accepting their noise. Replace fixed sleeps with observable conditions, and remove a redundant test only after confirming another check protects the intended behavior.
This week, count your tests by layer. Identify the slowest end-to-end checks that repeat lower-layer assertions, then decide which should become focused API or unit tests.
Running Suites in Parallel to Cut Wait Time
A developer waiting on a pipeline may start another task before the result arrives. When the failure finally appears, they have to reconstruct what they changed. Reducing that wait means measuring the whole path, not just buying faster runners.
Start with the job timeline in GitHub Actions, GitLab CI, or Jenkins. Separate queue time, environment setup, test execution, and report upload. A suite that starts late needs a different fix from one that executes slowly.
Use the Right Lever for the Delay
- Shard long suites. Split tests across independent runners. Balance shards using recorded execution duration rather than file counts, because a small file can contain a slow browser journey.
- Cache repeatable inputs. Cache package downloads and reusable container layers. Key caches to dependency lockfiles and relevant platform details so speed doesn't come from accidentally using stale dependencies.
- Fail fast on cheap checks. Run lint and unit tests before allocating heavy test environments. A syntax error shouldn't require a browser session to discover it.
- Limit the build matrix. Choose browser and operating-system combinations that reflect supported customer environments. Run a narrower representative selection early and broader compatibility checks on a schedule.
- Cancel superseded work. When a developer updates a pull request, stop obsolete runs where it's safe to do so. Keep release validation attached to its exact candidate artifact.
For a hypothetical calculation, a suite requiring forty minutes of test execution would have an ideal execution time of five minutes across eight perfectly balanced runners. Real elapsed time will be longer because setup, uneven tests, and report collection don't disappear.
Isolate State Before Adding Runners
Parallel execution fails when tests share mutable data. If separate shards change the same account or clear the same database, you'll get failures that disappear when the tests run alone.
Give each shard its own database, schema, or uniquely scoped records. Use separate queues and storage prefixes where tests write background jobs or files, and make cleanup safe when a test stops unexpectedly.
Parallelism reduces elapsed time, not necessarily compute consumption. Watch whether added runners improve the developer's actual wait rather than just moving the bottleneck to database capacity.
Choose your slowest independent job this sprint. Split it only after you can explain how its data, environment, and reports remain isolated.
Flaky Tests and Why Retries Hide Real Failures
A flaky test passes and fails against the same code under supposedly equivalent conditions. Once developers learn that rerunning a red job often makes it green, they may stop investigating the original failure.
In a one-month sample, Google's study of flaky tests found that nearly 16% of tests showed some flakiness, while 84% of pass-to-fail transitions were attributed to flaky tests rather than genuine regressions.
Those findings describe Google's environment, not your team's expected failure rate. They illustrate why a red build can become a poor diagnostic signal when nondeterministic behavior dominates the results.
A Retry Changes the Evidence
Suppose a checkout assertion fails, then passes on retry. You've established that the outcome isn't stable. You haven't established whether the cause is a test defect, an overloaded environment, or an intermittent application bug.
Keep the original failure visible during investigation.

A final green badge can hide that distinction if the reporting system overwrites earlier attempts. Preserve the assertion, screenshot, trace, application logs, and environment details from the failed attempt, not just the successful retry.
A retry-pass is evidence of uncertainty, not proof that the original failure was harmless.
Contain Instability Without Losing Coverage
-
Track instability per test. Keep first-attempt results separate from retry results. Record the commit, runner image, environment, and failure signature so recurring patterns are visible.
-
Classify the failure before routing it. A full runner disk belongs with infrastructure maintenance. An incorrect payment total belongs with the application team. A network timeout needs investigation because either the environment or the product could be responsible.
-
Quarantine nondeterministic checks with an owner. Remove the check from the blocking suite while continuing to execute it separately. Give the owner a repair deadline, document the coverage gap, and arrange replacement protection for critical behavior.
-
Limit retries and preserve every attempt. Use retries to gather diagnostic evidence, not to keep running until something passes. Report retry-passes as unstable outcomes rather than ordinary successes.
-
Repair the cause or replace the check. Look for shared records, uncontrolled clocks, unseeded randomness, asynchronous work, and fragile selectors. Delete a test only when it protects no necessary behavior or another reliable test covers its purpose.
Quarantine should be temporary. A separate suite that nobody reviews becomes a storage area for unresolved risk, especially when it contains the only check for a critical journey.
A useful test-health report shows the responsible team, current status, recurring failure pattern, and next action. Avoid a dashboard that ranks tests only by total failures, since frequently executed tests naturally accumulate more events.
Run a simple audit today: find failed builds from last month that passed unchanged on rerun. Review the first failures and ask whether your pipeline retained enough evidence to explain them.
A Worked Example of One Release Pipeline
Consider a hypothetical team maintaining a web application, several backend services, and a mobile app. They want a developer changing the payment API to learn about broken request handling before the change reaches the shared branch.
Their pipeline separates developer feedback from release evidence. The collaboration point is the release candidate, where engineering and quality leads review the same artifact and results.

Follow a Payment Change
The timings below are illustrative measurements for this scenario, not expected results for every pipeline.
| Trigger | Example execution | Decision |
|---|---|---|
| Pull request | Lint and unit tests take 4 minutes; API smoke tests take 3 minutes; setup adds about 1 minute | Return a result in about 8 minutes |
| Merge to main | API regression takes 12 minutes; login and checkout journeys take 15 minutes; deployment adds about 3 minutes | Validate the combined application in about 30 minutes |
| Release candidate | A performance baseline takes 20 minutes, with security scanning and the mobile package check running alongside | Review all required results before promotion |
A developer renames a payment field but misses a response mapping. The API smoke check fails during its three-minute execution window and reports the missing field. The developer fixes the mapping before review, while the change is still easy to explain.
Without that pull-request check, the team would discover the problem after integration, when other work might already depend on the changed response. The lesson is to place a decisive check where its result can still change the next action.
Handle an Uncertain Checkout Result
Later, a checkout browser test fails and passes on retry. The owner keeps the failed trace, moves that check into a non-blocking quarantine suite, and investigates a shared test account. A deterministic API check and a targeted manual checkout protect the affected behavior while the browser test is repaired.
The release owner reviews that temporary coverage explicitly. They don't treat the eventual green browser result as sufficient approval.
For a visual companion to the pipeline walkthrough, use the video below.
Sketch your own triggers, expected answers, and failure owners. Mark any stage where a developer can change critical behavior without receiving a focused check.
Decide If Your Pipeline Is Ready to Release
Among elite performers that met their reliability targets, organizations were 5.8 times more likely to use continuous integration and 3.7 times more likely to use continuous testing than other organizations, according to DORA's 2021 report.
These are relationships, not proof that adopting CI or testing alone causes elite performance. They're useful because the report connects engineering capabilities with delivery outcomes, rather than treating test execution as the outcome itself.
A release decision needs both perspectives: evidence about the candidate in front of you and evidence about how reliably your team delivers and recovers.
Measure Outcomes Alongside Test Health
Release-readiness metrics and warning signs
| Metric | What it measures | Warning sign |
|---|---|---|
| Deployment frequency | How often a release reaches production | Releases bunching up at the end of a sprint |
| Lead time for changes | Time from commit to running in production | Lead time growing as the suite grows |
| Change-failure rate | Share of releases that need a fix or rollback | Rising failures after test changes |
| Time to restore service | How long recovery takes after a failed release | Recovery slower than the release cycle |
| Flake rate | Share of test runs failing for non-product reasons | Above the limit the team agreed on |
Deployment frequency and lead time help you locate delivery friction. A growing delay might come from test execution, approval queues, environment availability, or oversized changes. Break the timeline into those parts before changing the suite.
Change-failure rate and restoration time tell you whether releases remain manageable after deployment. A rollback procedure that exists only in documentation isn't enough; rehearse it and measure when service returns.
Flake rate describes test health, not customer reliability. Define how you classify failures and handle unknown causes so the metric doesn't improve merely because someone relabels failures. Choose software quality metrics that support decisions instead of rewarding a larger test count.
Answer the Release Checklist
- Pull-request protection: Does a reliable smoke suite run on every pull request?
- Test health: Do you track instability per test and preserve retry history?
- Journey coverage: Can you map critical customer flows to current test evidence?
- Decision ownership: Does a named person make the go or no-go decision for each release?
- Recovery readiness: Have you measured rollback time and verified the recovery procedure?
Treat every no as an owned release risk. The answer might be to delay, narrow the release, add a temporary check, or accept a documented limitation. It shouldn't be to ignore the missing evidence.
Before approval, confirm that results belong to the candidate you're shipping, required checks have finished, and unresolved failures have explicit dispositions. A green result from an older commit doesn't validate a newer package.
Choose one unanswered checklist item and assign an owner this week. Give that person a concrete completion condition, such as a working smoke gate or a rehearsed rollback, rather than a general instruction to improve quality.
We offer a free 20-minute call to map your current testing process and critical flows, identify where automation can help, and show how fast an automation framework can be up and running. Visit AskYourQA to discuss which checks belong on your pull requests, merges, and release candidates, and bring the unanswered checklist item your team needs to resolve first.