Test Analytics

Learn about how Sentry Prevent's Test Analytics tools can help you improve your code.

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.

  • Spot Flaky Tests: Quickly identify and address tests that fail intermittently, reducing noise and wasted debugging time.
  • Track Failures and Trends: Monitor cumulative failures, slowest tests, and overall test run efficiency to improve CI reliability.
  • Actionable Insights: See which lines of code failed within tests, confirm flaky tests, and prioritize fixes.
  • Integrated with Sentry: Access test analytics alongside your error and performance data for a unified developer experience.

Test Analytics Dashboard

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 using a repository secret.

There are two ways to upload your test results:

Add the getsentry/prevent-action script to your CI YAML file.

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:

Copied
sentry-prevent-cli db upload --report-type test_results --file <report_name>.junit.xml

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.

After your workflow runs, view failed tests in the failed tests dashboard, or in your GitHub pull request comments.

Test Analytics comment

You can see a complete overview of your test analytics in the test analytics dashboard.

When configuring Test Analytics, you'll be asked to choose your upload permissions. For GitHub Actions, you can use OpenID Connect, or generate a repository token. Using the CLI, generate a repository token.

You can find a list of repository tokens on the Sentry Prevent tokens page.

Was this helpful?
Help improve this content
Our documentation is open source and available on GitHub. Your contributions are welcome, whether fixing a typo (drat!) or suggesting an update ("yeah, this would be better").