For the complete documentation index, see llms.txt. This page is also available as Markdown.

Test Management Overview

Automatically detect flaky tests, quarantine failures, and keep your pipelines green

FEATURE FLAGS AND PREREQUISITES

  • Flaky Test Detection, Quarantine, and Policies require the feature flag TI_POLICY_EVALUATION_ENABLED to be enabled on your account.

  • Code Coverage requires the feature flag CI_CODE_COVERAGE to be enabled on your account.

  • All hcli commands require the environment variable CI_ENABLE_HCLI_FOR_TESTS=true in your pipeline.

Contact Harness Support to enable feature flags. Go to Environment variables to configure environment variables.

Test Management

CI pipelines generate large volumes of test data, but most teams lack visibility and control over test health. Unstable tests block releases, resulting in failing pipelines, slow delivery and limited insights into coverage making it hard to understand real risk.

Harness Test Management turns test results into a complete test health system. After you upload test results, Harness continuously analyzes execution history to detect flaky tests, enforce automated policies, enable safe quarantine, and provide coverage insights across builds and pull requests.

This allows teams to keep pipelines fast and reliable while continuously improving test quality and release confidence.

Test Management Workflow

Test Management follows a simple lifecycle:

  1. Upload test results from your pipeline.

  2. Build historical test intelligence across executions.

  3. Detect instability automatically (flaky tests).

  4. Apply governance rules with policies.

  5. Unblock pipelines safely using quarantine.

  6. Measure test effectiveness with code coverage.

Once enabled, this workflow runs continuously without requiring changes from developers.

Key Features

Capability
What It Does
Value

Flaky Detection

Continuously analyzes historical test results to identify tests with inconsistent pass/fail behavior across runs and environments

Eliminates trust issues in CI by surfacing unreliable tests early and reducing wasted debugging time

Quarantine

Automatically isolates identified flaky tests from pipeline pass/fail status while continuing to execute and track them

Preserves delivery velocity without hiding risk, enabling teams to ship while fixing test instability

Policies

Applies user-defined rules to automatically mark or quarantine tests based on failures, flakiness, or performance signals

Automates governance and enforces consistent quality standards without manual intervention

Code Coverage

Collects and visualizes test coverage for you builds, to show how much code is exercised by tests

Increases release confidence by quantifying risk and guiding targeted improvements to test quality

How It Works

Test Management is powered by the Harness CLI (hcli) and supports the following functions:

  1. Stores test execution history per repository

  2. Analyzes test behavior within a 14-day observation window

  3. Detects flaky tests when the same test passes and fails on the same commit

  4. Evaluates policies during pipeline test execution

  5. Tracks quarantined tests without blocking releases

  6. Displays coverage insights in pipeline executions and PRs

Key CLI Commands

Test Management is powered by the Harness CLI (hcli).

Some commands are typically used inside your CI pipelines (for example uploading test results or coverage on every PR), while others are usually run by platform or QA teams from a local environment or admin pipeline (for example managing policies).

CLI Endpoint
Purpose
Example

hcli test-reports

Upload and manage test result data from pipelines

hcli test-reports upload test-results.xml

hcli cov

Analyze and upload code coverage reports

hcli cov upload --file=coverage.out ...

hcli test-management flaky

View and manage flaky test status

hcli test-management flaky get ...

hcli test-management quarantine

Manage quarantined tests

hcli test-management quarantine set ...

hcli test-management policy

Configure automated test policies

hcli test-management policy set ...

To explore all available commands and options, use --help:

Installing hcli

hcli is available automatically when running builds through Harness using any build infrastructure.

For local usage, download the binary:

Move to your PATH or use directly: ./hcli --help

Quick Setup

Automatic Flaky Test detection will be enabled by default.

  1. Run tests in you pipeline.

  2. Upload test results to Harness.

Learn More

Last updated

Was this helpful?