Minitest
In the steps below, we'll start with a Ruby project that has an existing minitest test suite, and we'll add JUnit XML as an additional output format for the test suite. In each step, we'll show the Git diff for the change that we're making.
Add
minitest-cias a dependency.bundle add minitest-ciVerify that your
Gemfilefile includes the new dependency:ruby '2.7.4'
gem 'minitest'
+gem 'minitest-ci'
gem 'rake'Require
minitest/ciin your tests. Find where you're currently requiringminitest(such astest/test_helper.rbin the example below) and update it to requireminitest/cias well.require 'minitest/autorun'
+require 'minitest/ci'minitest-ciwrites the JUnit reports to atest/reportsdirectory at the root of your project. Update your.gitignorefile so that the reports don't get accidentally checked into the repository./.bundle
+/test/reportsCommit these changes to your repository.
git commit -am "Generate JUnit XML test reports with minitest-ci"The final result of these changes should resemble commit ff08dc8 in the buildpulse-example-ruby-minitest repository.