Skip to content

Commit 52d625b

Browse files
author
Shannon Anahata
committed
updating test doc and adding a CLI doc
1 parent d8b83cc commit 52d625b

File tree

2 files changed

+97
-4
lines changed

2 files changed

+97
-4
lines changed

docs/product/test-analytics/index.mdx

Lines changed: 48 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,15 +21,59 @@ Sentry Prevent Test Analytics provides actionable insights into your CI test run
2121

2222
![Test Analytics Dashboard](./img/TA-dash.png)
2323

24-
To use Sentry Prevent Test Analytics, you’ll need to install the [Sentry app](https://github.com/apps/sentry-io) 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.
24+
To use Sentry Prevent Test Analytics, you’ll need to install the [Sentry app](https://github.com/apps/sentry-io) on your GitHub organization or specific repositories. Once installed, choose your JUnit XML Report framework and [set your permissions](#permissions-and-repository-tokens) using a repository secret.
25+
26+
<Alert>
27+
**The only test result file format we support is JUnit XML**. Most test frameworks support outputting test results in this format, with some configuration.
28+
29+
Each testing framework will have slight differences in the JUnit XML format it outputs, but we aim to support all of them.
30+
</Alert>
2531

2632
**There are two ways to upload your test results:**
2733

2834
### 1. Use GitHub Actions to Run Your CI
29-
Add the `getsentry/prevent-action` script to your CI YAML file.
35+
If you are already using GitHub Actions, you can use the `getsentry/prevent-action` script to upload your test results.
36+
37+
```yaml
38+
- name: Upload test results to Sentry
39+
if: ${{ !cancelled() }}
40+
uses: getsentry/prevent-action
41+
with:
42+
token: ${{ secrets.SENTRY_PREVENT_TOKEN }}
43+
```
44+
### 2. Use [Sentry Prevent’s CLI](/product/test-analytics/cli/) to Upload Testing Reports
45+
If you do not use Github Actions, install the Sentry Prevent CLI using `pip install sentry-prevent-cli` (for Python), or use a binary platform.
46+
47+
```bash {tabTitle:macos}
48+
curl -L https://github.com/getsentry/sentry-prevent-cli/releases/latest/download/sentry-prevent-cli-macos -o sentry-prevent-cli
49+
chmod +x sentry-prevent-cli
50+
```
51+
52+
```bash {tabTitle:linux}
53+
curl -L https://github.com/getsentry/sentry-prevent-cli/releases/latest/download/sentry-prevent-cli-linux -o sentry-prevent-cli
54+
chmod +x sentry-prevent-cli
55+
```
56+
57+
```bash {tabTitle:alpine linux}
58+
curl -L https://github.com/getsentry/sentry-prevent-cli/releases/latest/download/sentry-prevent-cli-alpine -o sentry-prevent-cli
59+
chmod +x sentry-prevent-cli
60+
```
61+
62+
```bash {tabTitle:windows}
63+
curl -L https://github.com/getsentry/sentry-prevent-cli/releases/latest/download/sentry-prevent-cli-windows.exe -o sentry-prevent-cli.exe
64+
```
65+
66+
```bash {tabTitle:linux arm64}
67+
curl -L https://github.com/getsentry/sentry-prevent-cli/releases/latest/download/sentry-prevent-cli-linux-arm64 -o sentry-prevent-cli
68+
chmod +x sentry-prevent-cli
69+
```
70+
71+
```bash {tabTitle:alpine linux arm64}
72+
curl -L https://github.com/getsentry/sentry-prevent-cli/releases/latest/download/sentry-prevent-cli-alpine-arm64 -o sentry-prevent-cli
73+
chmod +x sentry-prevent-cli
74+
```
3075

31-
### 2. Use Sentry Prevent’s CLI to Upload Testing Reports
32-
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:
76+
Then, upload your test results using the CLI:
3377

3478
```bash
3579
sentry-prevent-cli db upload --report-type test_results --file <report_name>.junit.xml
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
---
2+
title: Sentry Prevent CLI
3+
sidebar_order: 10
4+
description: Learn how to use the Sentry Prevent CLI to upload test results to Sentry.
5+
---
6+
7+
## Installation
8+
9+
<Alert>
10+
While the snippets below can be used to download and use the CLI directly, it is highly recommended to perform signature and SHASUM verification to ensure integrity of the CLI before use. See [Integrity Checking the Uploader](/product/test-analytics/cli/#integrity-checking-the-uploader) below for more information.
11+
</Alert>
12+
13+
For `Python`, install the Sentry Prevent CLI using `pip install sentry-prevent-cli`. You need to have `Python3` as the default.
14+
15+
```bash
16+
pip install sentry-prevent-cli
17+
```
18+
19+
For `binary platforms`, use the following commands to download the latest version of the Sentry Prevent CLI.
20+
21+
```bash {tabTitle:macos}
22+
curl -L https://github.com/getsentry/sentry-prevent-cli/releases/latest/download/sentry-prevent-cli-macos -o sentry-prevent-cli
23+
chmod +x sentry-prevent-cli
24+
```
25+
26+
```bash {tabTitle:linux}
27+
curl -L https://github.com/getsentry/sentry-prevent-cli/releases/latest/download/sentry-prevent-cli-linux -o sentry-prevent-cli
28+
chmod +x sentry-prevent-cli
29+
```
30+
31+
```bash {tabTitle:alpine linux}
32+
curl -L https://github.com/getsentry/sentry-prevent-cli/releases/latest/download/sentry-prevent-cli-alpine -o sentry-prevent-cli
33+
chmod +x sentry-prevent-cli
34+
```
35+
36+
```bash {tabTitle:windows}
37+
curl -L https://github.com/getsentry/sentry-prevent-cli/releases/latest/download/sentry-prevent-cli-windows.exe -o sentry-prevent-cli.exe
38+
```
39+
40+
```bash {tabTitle:linux arm64}
41+
curl -L https://github.com/getsentry/sentry-prevent-cli/releases/latest/download/sentry-prevent-cli-linux-arm64 -o sentry-prevent-cli
42+
chmod +x sentry-prevent-cli
43+
```
44+
45+
```bash {tabTitle:alpine linux arm64}
46+
curl -L https://github.com/getsentry/sentry-prevent-cli/releases/latest/download/sentry-prevent-cli-alpine-arm64 -o sentry-prevent-cli
47+
chmod +x sentry-prevent-cli
48+
```
49+
## Integrity Checking the Uploader

0 commit comments

Comments
 (0)