Getting Started

Trunk Flaky Tests detects flaky tests by analyzing test results from your CI runs. Setup requires configuring test result output and CI upload integration.

Prerequisites

  • Account at app.trunk.io

  • Ability to modify repository CI configuration and add secrets

  • Tests running in CI on both PRs and stable branches (e.g., main)

GitLab and BitBucket support is experimental. Contact us if not using GitHub.

Step 1: Ensure JUnit XML output

Trunk ingests test results in JUnit XML format. If your CI already generates JUnit XML, note the file paths and skip to Step 2.

If not, configure your test frameworks to output JUnit XML:

  • See Test Frameworks for framework-specific configuration

  • Supports multiple frameworks simultaneously

Step 2: Configure CI uploads

Add test result uploads to all CI jobs that run tests.

  1. See CI Providers for integration instructions

  2. Configure uploads in jobs that run on:

    • Pull request branches

    • Stable branches (main, master, develop, etc.)

    • Merge queue branches (if applicable)

Uploads from both PRs and stable branches are required for accurate flaky test detection.

Step 3: Verify integration

  1. Push your changes and trigger a CI run

  2. Check CI logs for successful upload confirmation

  3. Wait 15-30 minutes for results to process, then verify uploads appear at app.trunk.io → your repo → Flaky Tests > Uploads

Uploads tab

Detection timeline

Trunk requires 10+ runs per test to start detecting flaky tests accurately. Depending on your CI velocity, this takes hours to days. High-velocity repos (100+ runs/day) may see first detections within a day.

You'll receive email notification when the first flaky test is detected.

How Trunk detects flaky tests →

Quarantining

Override exit codes for known flaky test failures, allowing CI jobs to pass while tests continue running and uploading results. Requires both UI configuration and CI job modifications.

Use case: Unblock merge queues and critical pipelines without losing test coverage or data.

Configure Quarantining →

Last updated