
Testing in Continuous Delivery: How Automated Test Gates Fit In

Key Takeaways
Testing in continuous delivery works when staged automated gates run cheap tests first and block each promotion, and the team trusts a red build enough to stop a release.
- Most tests belong in the first three stages, and UI tests are kept for journeys where a failure would cost revenue or customers.
- One team cut a UI suite of more than 200 tests that took hours to run down to 20 critical tests by moving scenarios to service-level tests. Execution dropped under 20 minutes.
- In GitHub Actions, chaining jobs with needs stops a failed unit test before costlier stages run.
- A required reviewer on the production environment is the continuous delivery approval step. Removing it gives continuous deployment.
- Flaky tests teach teams to ignore red builds. Atlassian reported flakiness caused as much as 21% of master build failures in its Jira Frontend repository in December 2025.
- Quarantine a flaky test with an owner and a ticket, fix the cause, then return it to the gate.
- New tests should run in a non-blocking CI job and become blocking only once stable. One team that gated unstable UI tests saw developers bypass the pipeline.
Before adding new tests or AI drafting, write down what each stage blocks, how long it takes and how often builds are rerun.
Testing in continuous delivery means every commit runs through staged automated tests, and each stage is a gate that decides whether the change moves toward production. Because nobody re-checks each build by hand, a delivery pipeline is only as safe as the gates its tests enforce. The harder problem shows up six months in, when a slow or flaky gate starts getting bypassed and releases go out on hope again.
What testing in continuous delivery has to prove
Each automated test answers one question about a commit, which is whether the change is safe to release. The answer has to arrive fast enough that developers wait for it and be right often enough that they act on it. Lose either property and people start routing around the pipeline with reruns and manual overrides.
In continuous delivery, every change that passes the pipeline is releasable, and a person approves the move to production. Continuous deployment removes that approval, which leaves the test gates to make the release decision alone. Teams usually add post-deployment smoke tests and a rehearsed rollback before they drop the human step.
Automation pays off fastest when it targets a specific delivery problem. One team whose regression cycle delayed releases by up to two weeks automated stable, high-risk flows first, skipped rarely used features and measured success by regression duration. Within six months, its regression cycle fell from two weeks to two days.
Which tests belong at each pipeline stage?
Cheap tests run first and block early. Expensive tests run later and block promotion to the next environment.
Stage | Tests that run | Example tools | What a failure blocks |
|---|---|---|---|
Developer machine | Linting, formatting, secrets detection, unit tests for changed files | Pre-commit hooks, ESLint, Jest, pytest | The push, if hooks are enforced |
Pull request | Build, full unit suite, static analysis (SAST), dependency scan | Jest, pytest, JUnit, SonarQube, npm audit | Merge to main |
Integration | API and service tests against real databases and queues in containers, contract tests between services | Playwright API tests, JUnit, pytest, Docker Compose | The end-to-end stage |
End-to-end | A short list of critical user journeys in a browser or on a device | Playwright, Cypress, Selenium, Appium | Deployment to staging |
Staging | Smoke tests, performance tests against agreed thresholds, DAST security scan | JMeter, ZAP | Promotion to production |
Production | Post-deploy smoke tests, health checks, error-rate monitoring | Sentry, Datadog | Nothing; a failure triggers rollback |
Most of the suite belongs in the first three rows. Unit tests run in seconds and point at the broken function, and API tests check business logic without a browser. UI tests are the slowest and most fragile layer, so they earn a place only for journeys where a failure would cost revenue or customers.
One team had more than 200 UI tests that took hours to run. It moved most scenarios down to service-level tests and kept 20 UI tests for critical paths. Execution dropped to under 20 minutes, which made running the suite in CI practical.
Seams keep the remaining UI tests focused. An e-commerce team's cart tests searched for a product before adding it, and any search failure broke every cart test. An API call that put the product straight into the cart made those tests faster and more reliable.
A test-gated pipeline in GitHub Actions
The workflow below is a Node.js example with gates in the order of the table. Each job starts only after the job it needs has passed, and both deployment jobs wait on GitHub environments. The checkout and setup-node actions are at v7 as of November 2026, and reading the Node version from .nvmrc keeps the workflow unchanged when the runtime is upgraded.
name: ci-cd
on:
pull_request:
push:
branches: [main]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
fast-checks:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- uses: actions/setup-node@v7
with:
node-version-file: .nvmrc
cache: npm
- run: npm ci
- run: npm run lint
- run: npm test
- run: npm audit --audit-level=high
integration:
needs: fast-checks
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- uses: actions/setup-node@v7
with:
node-version-file: .nvmrc
cache: npm
- run: npm ci
- run: docker compose up -d --wait
- run: npm run test:integration
e2e:
needs: integration
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
shardIndex: [1, 2, 3, 4]
shardTotal: [4]
steps:
- uses: actions/checkout@v7
- uses: actions/setup-node@v7
with:
node-version-file: .nvmrc
cache: npm
- run: npm ci
- run: npx playwright install --with-deps
- run: npx playwright test --grep-invert @quarantine --shard=${{ matrix.shardIndex }}/${{ matrix.shardTotal }}
deploy-staging:
if: github.ref == 'refs/heads/main'
needs: e2e
runs-on: ubuntu-latest
environment: staging
steps:
- uses: actions/checkout@v7
- run: ./scripts/deploy.sh staging
- run: ./scripts/smoke-test.sh ${{ vars.STAGING_URL }}
deploy-production:
needs: deploy-staging
runs-on: ubuntu-latest
environment: production
steps:
- uses: actions/checkout@v7
- run: ./scripts/deploy.sh production
- run: ./scripts/smoke-test.sh ${{ vars.PRODUCTION_URL }}
- if: failure()
run: ./scripts/rollback.sh productionA few lines in this file do most of the work:
- The
needskey chains the jobs. A failed unit test stops the run before the integration and end-to-end jobs spend runner time. - The
concurrencyblock cancels in-progress runs for older commits on the same branch, which keeps outdated builds out of the queue. - End-to-end tests run as four parallel shards through Playwright's
--shardoption, andfail-fast: falselets every shard report even when one fails. Tests tagged@quarantineare excluded with--grep-invert. - GitHub's documentation states that "a job that references an environment must follow any protection rules for the environment before running." A required reviewer on the production environment is the continuous delivery approval step. Remove the reviewer and the same file does continuous deployment.
- A failed production smoke test runs the rollback script. Run that script in staging on a schedule, because a rollback that first runs during an incident adds a second risk to the first.
Arbisoft's work on Sozie follows the same principle with a smaller toolchain: pre-commit hooks in front of GitHub CI, and a rule that every change needs unit, API and integration tests, with the full suite running in CI. Over 13 weeks of weekly releases, three developers shipped 246 tickets. Five came back after release, a return rate of about 2%.
How do you keep the pipeline fast enough that nobody skips it?
Run the tests most likely to fail at the cheapest stage, and spend parallel runners on the slowest stage. That is test prioritization in practice, and it matters most in continuous deployment, where nothing stands between a green build and users.
- On pull requests, run tests related to the change first. Playwright's
--only-changedoption runs only test files changed between HEAD and a given ref. Keep the full suite on merges to main, because a change can break tests in files it never touched. - Tag a small smoke set for the critical journeys and run it on every deployment. Run full regression on main and on a nightly schedule.
- Shard the slowest stage only after the tests are independent. One team's suite passed locally and failed under parallel execution because tests shared data, and refactoring it late was costly.
- Agree a time budget for each stage and treat a stage that exceeds it as a defect.
How to quarantine flaky tests and promote new ones
A flaky test passes and fails on the same code, and each false failure teaches the team to ignore red builds. Atlassian's engineering team reported in December 2025 that flakiness had been responsible for as much as 21% of master build failures in its Jira Frontend repository. A quarantine process takes that noise out of the gate while keeping the test visible until someone fixes it.
- Rerun a failed test once in the same build. If it passes on identical code, log it as flaky. Playwright's
--retriesoption and similar settings in other runners automate the rerun. - Tag the test
@quarantineso the gate skips it, and keep running it in a separate non-blocking job. - Give every quarantined test an owner and a ticket, because an unowned quarantine list turns into a second, silent suite.
- Fix the cause, which is usually shared test data, fixed waits or selectors tied to layout. One team's tests used CSS selectors that changed with the UI and broke on every UI change until dedicated test attributes cut failures significantly.
- Return the test to the gate once it stays healthy for a set period, the rule Atlassian's process uses.
New tests should earn their place in the gate the same way. They run locally first, then in a visible non-blocking CI job, and become blocking once they have proven stable. One team gated every commit on unstable UI tests, and developers lost trust and bypassed the pipeline until the tests were stabilized and gating was delayed. Another ignored failures for weeks until its suite was unusable, and recovered after assigning daily ownership of triage.
Who owns testing when the whole team ships
Testing turns into a bottleneck when it belongs to one person. A story waits for the tester while the developer starts the next one, which then waits too, and knowledge of the framework collects with whoever built it. Shared ownership splits the work by who is best placed to do it.
- Developers write unit tests, support service-level tests and fix the tests their changes break.
- Testers identify high-risk scenarios, review coverage, triage failures and run exploratory testing.
- Automation engineers design the framework, watch its reliability and mentor the rest of the team.
- Product owners schedule test maintenance alongside feature work.
Both ways of getting this wrong are common. One team left all UI automation to testers, who were overloaded until developers took over unit tests and maintenance was shared. Another gave automation to developers "when they had time", and it slipped sprint after sprint until the team assigned a dedicated test automation engineer and reserved sprint capacity for it.
Pairing and mobbing on test automation
Pairing a developer with a tester on new automated tests combines knowledge of the code with knowledge of the risks.
Strong-style pairing works well when the team has no automation specialist. The navigator decides the next step and the driver types it, so every idea passes through both people before it reaches the code. Rotate the roles often, take breaks, and pair across roles. Pairing works just as well remotely.
Mobbing extends pairing to the whole team. Everyone works on the same task at the same time on one shared screen, in a room or on a call. One person drives, one navigates and the rest research and suggest, with roles rotating on a timer or by task. Because the team has one story in progress, nobody waits on a hand-off, knowledge spreads as the work happens and new members get up to speed faster.
Teams new to mobbing often start with strict rules, such as a timer and fixed rotations, then lengthen rotations and make participation flexible once the habit settles. A safe environment matters more than the format: build on each other's ideas and leave seniority at the door.
Learning communities for teams without automation experts
Automation skills don't have to be learned alone. A testing tour, where team members spend time with another team or company to see its process and tools, shows working setups from the inside. Personal learning networks of peers and mentors help with specific problems, and company-wide meetups, workshops and lean coffees spread what one team learns to the others. Inside the team, writing behavior-driven development (BDD) examples before coding gives automation a shared starting point, and growing T-shaped skills lets developers test and testers automate.
Setting up test automation as a team
- Choose a framework the team knows or can learn quickly, in a language it already uses.
- Store the tests in the product repository and review them in the same pull requests as the code, so ownership is shared.
- Treat test code like product code, with reviews, tests for the automation itself and proper test data setup.
- Make tests runnable both locally and centrally, against test and production versions.
- Run fast tests automatically in the pipeline and trigger longer suites centrally on demand.
- Include testing and automation in every story, so it becomes part of everyone's work.
The first setup won't be perfect. Improve it in small steps and pay down test debt early, before it slows the pipeline.
Where low-code and no-code test automation tools fit
Low-code and no-code test automation tools let people who don't write code create automated tests through visual builders or record-and-playback. They belong in a delivery pipeline when their tests run from the pipeline without a person present and return a pass or fail result the gate can act on.
Approach | Who usually writes the tests | How tests reach the pipeline | Main trade-off |
|---|---|---|---|
No-code (visual builders, record-and-playback) | Manual testers, business analysts | Vendor CLI or API trigger, with results exported to CI | Vendor lock-in; a failed visual flow is harder to debug than code |
Low-code (visual steps plus code for complex cases) | QA engineers with some scripting | Vendor CLI or API trigger, with custom code steps | Complex scenarios still need code, stored in the vendor's format |
Code frameworks (Selenium, Playwright, Cypress) | Developers and automation engineers | Tests live in the repository and run with a CLI command | Needs coding skill and ongoing framework upkeep |
Playwright sits between the rows. Its codegen tool generates tests as someone performs actions in the browser, and the output is ordinary test code the team can review. A workable split lets domain experts record the business journeys they know best, while every test that blocks a deployment lives in version control and goes through review.
Before buying a no-code tool, check that it runs headlessly from CI, reports results in a standard format such as JUnit XML, keeps version history and lets you export tests. For AI-assisted options, see our comparison of AI test automation tools for QA teams.
What AI can and can't do for CI/CD test automation
AI assistants can draft unit tests, workflow YAML and a first explanation of a failed job, which shortens the blank-page part of the work. They can't decide what the gate should protect, and a generated test that passes proves only that it runs. The 2025 DORA report on AI-assisted software development describes AI as "an amplifier, magnifying an organization's existing strengths and weaknesses." A weak test gate is one of those weaknesses, and faster code generation pushes more change through it.
Two Arbisoft projects build review into the workflow. On Xiangqi, the Playwright and Cucumber QA flow uses a page-inspector agent that extracts verified locators before any test is generated, which means generated tests start from locators confirmed on the page. On Sozie, production and source changes are never auto-committed; Claude shows the diff and waits for the developer's approval.
Review an AI-generated test like any other. Check that it asserts behavior a user cares about, that it fails when the feature is reverted, and that it avoids fixed waits and layout-bound selectors. AI in QA more broadly is covered in how AI tools change software quality assurance.
Which metrics show your test gates are working?
DORA's software delivery metrics show whether testing protects releases, and a few test-health metrics explain why they move. DORA defines five delivery metrics:
- Change lead time is the time a change takes to go from version control to production.
- Deployment frequency counts deployments over a period, or the time between them.
- Change fail rate is the share of deployments that need immediate intervention.
- Failed deployment recovery time is how long recovery from such a deployment takes.
- Deployment rework rate is the share of deployments that are unplanned and caused by a production incident.
Test analytics in CI/CD connect those numbers to the suite. Store each run's results as JUnit XML or a Playwright report, then track pipeline duration for the median and the slowest runs, the flaky rate, the count and age of quarantined tests, and defects that escape to production. One team tracked "time to confidence" after each commit and cut it from hours to minutes.
Read the two sets together. A rising change fail rate while the pipeline stays green points to gaps in what the gate checks. A long lead time with frequent reruns points to flakiness or a slow stage. Deployment frequency rising while change fail rate holds steady suggests the gates are doing their job.
Frequently asked questions
Is there still a place for manual testing in continuous delivery?
Exploratory testing still has a place because it finds problems nobody thought to automate, such as confusing flows and gaps between the spec and real use. Keep it outside the deployment gate: testers explore new features in staging or behind a feature flag, and anything worth checking on every release becomes an automated test.
How do you add test gates to a legacy codebase with few tests?
Start with smoke tests for the few journeys that would hurt most if they broke, and make those the first gate. Then add tests around each area of code before changing it, recording current behavior so a refactor can't alter it silently. Coverage grows where the team works, which is where the release risk sits.
Where to start with your own test gates
Fix trust before speed. Write down what each pipeline stage blocks today, how long it takes and how often builds are rerun, quarantine the flaky tests before adding new ones, and add AI drafting only once the gate is believed. Testing in continuous delivery works when a red build stops a release and the team accepts the verdict.
If you want help designing those gates or building the pipeline around them, Arbisoft's automated testing services and DevOps engineers can work alongside your team.
...Loading Related Blogs









