minitest

A guide for generating Trunk-compatible test reports for Minitest

1. Generate JUnit

Install the minitest-reporters gem:

gem install minitest-reporters

Configure the JUnitReporter reporter in your test_helper.rb file:

require "minitest/reporters"
Minitest::Reporters.use! Minitest::Reporters::JUnitReporter.new(:reports_dir => "results")

2. Output Location

This will automatically write all test results to JUnit XML files in the results directory.

Disable Retries

You need to disable automatic retries if you previously enabled them. Retries compromise the accurate detection of flaky tests.

Minitest doesn't support retries out of the box, but if you implemented retries or imported a package, remember to disable them.

Next Step

JUnit files generated with minitest are compatible with Trunk Flaky Tests. See CI Providers for a guide on how to upload test results to Trunk.

Last updated