Skip to main content

Test Management

CI pipelines generate large volumes of test data, but most teams lack visibility and control over test health. Unstable tests block releases, failing pipelines slow delivery, and limited insight into coverage makes 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

CapabilityWhat It DoesValue
Flaky DetectionContinuously analyzes historical test results to identify tests with inconsistent pass/fail behavior across runs and environmentsEliminates trust issues in CI by surfacing unreliable tests early and reducing wasted debugging time
QuarantineAutomatically isolates identified flaky tests from pipeline pass/fail status while continuing to execute and track themPreserves delivery velocity without hiding risk, enabling teams to ship while fixing test instability
PoliciesApplies user-defined rules to automatically mark or quarantine tests based on failures, flakiness, or performance signalsAutomates governance and enforces consistent quality standards without manual intervention
Code CoverageCollects and visualizes test coverage for you builds, to show how much code is exercised by testsIncreases 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 EndpointPurposeExample
hcli test-reportsUpload and manage test result data from pipelineshcli test-reports upload test-results.xml
hcli covAnalyze and upload code coverage reportshcli cov upload --file=coverage.out ...
hcli test-management flakyView and manage flaky test statushcli test-management flaky get ...
hcli test-management quarantineManage quarantined testshcli test-management quarantine set ...
hcli test-management policyConfigure automated test policieshcli test-management policy set ...

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

hcli --help
hcli test-management --help
hcli cov --help

Installing hcli

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

For local usage, download the binary:

# macOS (Apple Silicon)
curl -fsSL -o hcli "https://storage.googleapis.com/harness-ti/hcli/v0.7/hcli-darwin-arm64"
chmod +x hcli

# macOS (Intel)
curl -fsSL -o hcli "https://storage.googleapis.com/harness-ti/hcli/v0.7/hcli-darwin-amd64"
chmod +x hcli

# Linux (amd64)
curl -fsSL -o hcli "https://storage.googleapis.com/harness-ti/hcli/v0.7/hcli-linux-amd64"
chmod +x hcli

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.
- run:
script: |-
pytest --junitxml=test-results.xml -v
hcli test-reports upload test-results.xml

Learn More