Writes RSpec results as JUnit XML that CI services can read
open sourceMITfree
rspec_junit_formatter is an RSpec 3 formatter that writes test results as a JUnit XML file, the format CI services such as Jenkins, Buildkite, CircleCI and GitLab read to show test reports. It runs alongside other formatters, and with parallel_tests it adds the worker number to each output file and suite name, reading the worker index from GitLab, CircleCI, Semaphore, Buildkite or Bitbucket Pipelines when TEST_ENV_NUMBER is unset.
Problems it solves
- show RSpec test results in my CI service's test report
- get JUnit XML out of an RSpec run
- combine RSpec results from parallel CI jobs
Features
- JUnit XML output from RSpec 3
- Works alongside other RSpec formatters
- Readable by Jenkins, Buildkite, CircleCI, GitLab and others
- parallel_tests support with a file and suite name per worker
- Reads the CI node index from GitLab, CircleCI, Semaphore, Buildkite and Bitbucket
Limitations
- Needs Ruby 3.3 or later and RSpec 3.13 or later (below 4)1
Alternatives
The same job
These do what rspec_junit_formatter does.
- minitest-reporters Customizable output formats for Ruby's Minitest
- jest-junit Jest reporter that writes JUnit XML files
- Allure Report Open source HTML test automation report tool
- xcresultparser Parse the binary .xcresult bundles from Xcode builds and test runs
