Skip to content
Draft
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
16 changes: 14 additions & 2 deletions flaky-tests/test-labels.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ description: Organize and categorize test cases with organization-scoped labels.

# Test Labels

Test labels are organization-scoped tags you can apply to individual test cases to organize, filter, and categorize your test suite. Labels are applied manually today; see [Automatic labeling from monitors](#automatic-labeling-from-monitors) for what's coming.
Test labels are organization-scoped tags you can apply to individual test cases to organize, filter, and categorize your test suite. Labels can also be applied automatically via monitors; see [Automatic labeling from monitors](#automatic-labeling-from-monitors).

<figure><img src="../.gitbook/assets/test-details-labels.png" alt="Labels applied to a test on details page"><figcaption></figcaption></figure>

Expand Down Expand Up @@ -32,8 +32,20 @@ On the tests list, you can filter the table down to test cases that have a parti

### Automatic labeling from monitors

Monitors can automatically apply and remove labels on test cases based on test behavior. When a monitor activates (detects a flaky or broken test), it applies any configured labels to that test case. When the monitor resolves, it removes those labels.

You configure label actions in the **Actions** section of the monitor edit dialog. Use the **Add label** button to select the labels to apply when the monitor fires. You can configure separate sets of labels to apply on activation and remove on resolution.

The monitor list view shows label action chips on any monitor that has a label action configured, so you can see at a glance which monitors are set up to auto-label.

#### How label cleanup works

- **When you disable or delete a monitor:** Any labels that the monitor had applied are automatically removed from all affected test cases.
- **When you change the label set on a monitor's label action:** Trunk reconciles the existing label assignments to match the new configuration.
- **Deleting a label is blocked** if it is still configured in a label action on an active monitor. Remove it from the monitor's label action first.

{% hint style="info" %}
**Coming soon.** Monitors will be able to automatically apply and remove labels on test cases based on test behavior. More details will be published when this is available.
Automatic labeling from monitors is available on paid plans. If you don't see the label action option in your monitor config, contact support to confirm access.
{% endhint %}

### Related
Expand Down
Loading