Skip to content

Commit f409a4b

Browse files
author
Shannon Anahata
committed
new test analytics doc for sentry
1 parent 12b68d5 commit f409a4b

File tree

1 file changed

+54
-0
lines changed

1 file changed

+54
-0
lines changed

docs/product/test-analytics/index.mdx

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
---
2+
title: Test Analytics
3+
sidebar_order: 135
4+
description: Learn about how Sentry Prevent's Test Analytics tools can help you improve your code.
5+
---
6+
7+
Sentry Prevent Test Analytics provides actionable insights into your CI test runs, helping you identify flaky tests, track failures, and optimize your test suite for faster, more reliable deployments.
8+
9+
## Why Use Test Analytics?
10+
11+
- **Spot Flaky Tests:** Quickly identify and address tests that fail intermittently, reducing noise and wasted debugging time.
12+
- **Track Failures and Trends:** Monitor cumulative failures, slowest tests, and overall test run efficiency to improve CI reliability.
13+
- **Actionable Insights:** See which lines of code failed within tests, confirm flaky tests, and prioritize fixes.
14+
- **Integrated with Sentry:** Access test analytics alongside your error and performance data for a unified developer experience. Yay
15+
16+
## Getting Started
17+
18+
To use Sentry Prevent Test Analytics, you’ll need to install the [Sentry app]() on your GitHub organization or specific repositories. Once installed, choose your JUnit XML Report language and [set your permissions](#permissions-and-repository-tokens) using a repository secret.
19+
20+
*Insert Arcade GIF or screenshot here*
21+
22+
**There are two ways to upload your test results:**
23+
24+
### 1. Use GitHub Actions to Run Your CI
25+
Add the `getsentry/prevent-action` script to your CI YAML file.
26+
27+
### 2. Use Sentry Prevent’s CLI to Upload Testing Reports
28+
Install the Sentry Prevent CLI using `pip install sentry-prevent-cli` (for Python), or use a binary. Then, upload your test results using the CLI:
29+
30+
```bash
31+
sentry-prevent-cli db upload --report-type test_results --file <report_name>.junit.xml
32+
```
33+
34+
### Run Your Test Suite
35+
Now that you've configured your CI to upload your test results, you can inspect the workflow logs to see if the call to Sentry succeeded. You need to have some failed tests to view the failed tests report.
36+
37+
## Viewing Test Analytics
38+
39+
After your workflow runs, view failed tests in the [failed tests dashboard](), or in your GitHub pull request comments.
40+
41+
*Insert Arcade GIF or screenshot here*
42+
43+
You can see a complete overview of your test analytics in the [test analytics dashboard]().
44+
45+
*insert screenshot here*
46+
47+
## Permissions and Repository Tokens
48+
When configuring Test Analytics, you'll be asked to choose your upload permissions. For GitHub Actions, you can use [OpenID Connect](https://openid.net/developers/how-connect-works/), or generate a repository token. Using the CLI, generate a repository token.
49+
50+
You can find a list of repository tokens on the Sentry Prevent [tokens page]().
51+
52+
## Read Next
53+
54+
<PageGrid />

0 commit comments

Comments
 (0)