RSpec
A guide for generating Trunk-compatible test reports for RSpec using Trunk's RSpec plugin
Last updated
A guide for generating Trunk-compatible test reports for RSpec using Trunk's RSpec plugin
Last updated
You can automatically in your projects running RSpec by integrating with Trunk. This document explains how to use Trunk's RSpec plugin to upload test results to Trunk.
By the end of this guide, you should achieve the following before proceeding to the to configure your CI provider.
Trunk detects flaky tests by analyzing test reports automatically uploaded from your CI jobs. You can do this for your Rspec tests using Trunk's RSpec plugin.
To install the plugin in your project, add the rspec_trunk_flaky_tests
gem to your Gemfile
:
Install the plugin:
Then, load the plugin in spec_helper.rb
:
You need to disable automatic retries if you previously enabled them. Retries compromise the accurate detection of flaky tests.
Before modifying your CI jobs to automatically upload test results to Trunk, try uploading a single test run manually.
You make an upload to Trunk using the following command:
After your upload, you can verify that Trunk has received and processed it successfully in the Uploads tab. Warnings will be displayed if the test report uploaded by the plugin has issues.
Configure your CI to upload test runs to Trunk. Find the guides for your CI framework below:
If you have a step in CI to rerun failed tests with the --only-failures
option, or you're using a package like , remember to disable them.
You can find your Trunk organization URL slug and token in the Settings or by following these .