Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion flaky-tests/agents/autofix-flaky-tests.mdx
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
---
title: "Autofix Flaky Tests"

Check warning on line 2 in flaky-tests/agents/autofix-flaky-tests.mdx

View check run for this annotation

Mintlify / Mintlify Validation (trunk-4cab4936) - vale-spellcheck

flaky-tests/agents/autofix-flaky-tests.mdx#L2

Did you really mean 'Autofix'?
---
Trunk can automatically investigate flaky tests in your codebase and raise fix pull requests with suggested solutions.

## Prerequisites

To use the Autofix Flaky Tests feature, you'll need:

Check warning on line 8 in flaky-tests/agents/autofix-flaky-tests.mdx

View check run for this annotation

Mintlify / Mintlify Validation (trunk-4cab4936) - vale-spellcheck

flaky-tests/agents/autofix-flaky-tests.mdx#L8

Did you really mean 'Autofix'?

1. Beta access via waitlist (reach out to us at [support@trunk.io](mailto:support@trunk.io))

Check warning on line 10 in flaky-tests/agents/autofix-flaky-tests.mdx

View check run for this annotation

Mintlify / Mintlify Validation (trunk-4cab4936) - vale-spellcheck

flaky-tests/agents/autofix-flaky-tests.mdx#L10

Did you really mean 'waitlist'?
2. The "Investigate Flaky Tests" setting enabled in your workspace
3. Active installation of the [Trunk GitHub App](../../setup-and-administration/github-app-permissions)

Expand All @@ -29,7 +29,16 @@

Flaky tests can also be analyzed manually via the UI and via the [MCP server](../reference/mcp-reference/fix-flaky-test).

## Autofix with Cursor Automations
### Skipped and failed analyses

When Trunk skips or fails an analysis, the Analysis tab shows a banner explaining what happened. Common reasons an analysis is skipped:

- **Monthly analysis limit reached.** Your repository has used all available analyses for the current billing period. The banner shows how long ago the skip occurred.
- **Analysis already in progress.** A previous run is still queued; Trunk skips a new one to avoid duplicates.

If an analysis fails due to an internal error, the banner notes the failure without exposing internal details. In either case, you can request a new analysis once the blocking condition clears.

### Autofix with Cursor Automations

Check warning on line 41 in flaky-tests/agents/autofix-flaky-tests.mdx

View check run for this annotation

Mintlify / Mintlify Validation (trunk-4cab4936) - vale-spellcheck

flaky-tests/agents/autofix-flaky-tests.mdx#L41

Did you really mean 'Autofix'?

Check warning on line 41 in flaky-tests/agents/autofix-flaky-tests.mdx

View check run for this annotation

Mintlify / Mintlify Validation (trunk-4cab4936) - vale-spellcheck

flaky-tests/agents/autofix-flaky-tests.mdx#L41

Did you really mean 'Automations'?

Whenever an investigation is completed, Trunk will emit a [webhook](../webhooks/index) for `test_case.investigation_completed`. Enable webhooks via [Svix](../webhooks/index).

Expand Down