---
title: Test Engine
description: Monitor, detect, and manage unreliable tests across your repositories.
hubAccent: true
---

Test Engine (formerly Test Insights) helps you manage test reliability across
the full lifecycle. It catches flaky tests on pull requests before they merge,
surfaces unhealthy tests across your repositories, and lets you quarantine
problematic tests so they don't block your CI pipeline.

## How it works

Test Engine is organized into three phases that follow the natural lifecycle
of a test reliability problem:

1. **[Prevention](/test-engine/prevention)**: Catch flaky and broken tests
   on pull requests before they reach your codebase. Mergify reruns tests on
   PRs to detect inconsistent behavior early.

2. **[Detection](/test-engine/detection)**: Identify and prioritize
   unhealthy tests across your repositories. See which tests are flaky or
   broken, and focus on the ones with the most impact.

3. **[Test States](/test-engine/test-states)**: Unblock CI without removing
   problematic tests. A quarantined test keeps running, but its failures no
   longer block merges; a skipped one does not run at all. You set both from
   Detection.

On your default branch and in the merge queue,
[test retry](/test-engine/test-retry) runs a failing test again, so a flaky
failure no longer fails the build.

You can also search test health directly from the terminal or from AI coding
agents with the [`tests` CLI reference](/cli/tests). This is useful when
an agent needs to decide whether a failing test is a real regression or
known flakiness.

## Key concepts

- **Flaky test**: A test whose outcome does not follow from the code alone,
  for example one that passed and failed on the same commit.

- **Broken test**: A test that fails, with nothing pointing to flakiness.

- **Health status**: A test's reliability classification: healthy, flaky, or
  broken. Based on the test's CI runs over time. See
  [Health Status](/test-engine/health) for how a test moves between them.

- **Confidence**: How many runs support a test's health status, reported as
  low, medium, or high. [Prevention](/test-engine/prevention) reports it for
  the tests a pull request adds. Low confidence means the status could still
  change as the test runs again.

- **Quarantine**: Isolating a test so its failures are ignored for merge
  decisions. The test still runs and results are still collected, preserving
  full visibility.

- **Tracked branches**: A test's health comes from the runs on each tracked
  branch. A repository tracks its default branch until you
  [choose others](/test-engine/configuration#tracked-branches). Pull request
  runs feed [Prevention](/test-engine/prevention) instead. See
  [which runs Detection reports on](/test-engine/detection#which-runs-detection-reports-on).

## Setup

Test Engine is powered by the same CI integration as
[CI Insights](/ci-insights). To get started, configure your CI system and test
framework:

- [GitHub Actions setup](/ci-insights/setup/github-actions)
- [Buildkite setup](/ci-insights/setup/buildkite)
- [Jenkins setup](/ci-insights/setup/jenkins)
- [CircleCI setup](/ci-insights/setup/circleci)
- [Test framework setup](/test-engine/test-frameworks)

To let your coding agent do the whole setup, give it the
[`mergify-test-engine-setup` skill](/cli/agents#use-the-test-engine-setup-skill-without-installing-it).

Then set the rerun budgets and turn on auto-quarantine for each repository on the
[Configuration](/test-engine/configuration) page.

## Test framework configuration

Test Engine captures test-level data from your test framework. Each framework
needs a short setup so its results reach Test Engine: a Mergify plugin where
one exists, or a JUnit XML report uploaded after the tests run.

[Test framework setup](/test-engine/test-frameworks) lists every supported
framework, grouped by language, with the setup each one uses.
