Ruby
Test Suite Monitoring for RSpec
Monitor your RSpec test suite health with TestGlance
Get Started in 3 Steps
- 1Install the JUnit formatter gem: `gem install rspec_junit_formatter`
- 2Run RSpec with JUnit output: `rspec --format RspecJunitFormatter --out test-results/rspec.xml`
- 3Add the TestGlance GitHub Action to your CI workflow
Reporter Configuration
rspec --format RspecJunitFormatter --out test-results/rspec.xmlInstall first: gem install rspec_junit_formatter
GitHub Actions Workflow
# .github/workflows/test.yml
name: Tests
on: [push, pull_request]
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ruby/setup-ruby@v1
with:
ruby-version: "3.3"
bundler-cache: true
- name: Run tests
run: bundle exec rspec --format RspecJunitFormatter --out test-results/rspec.xml --format progress
- name: Report to TestGlance
if: always()
uses: testglance/action@v1
with:
api-key: ${{ secrets.TESTGLANCE_API_KEY }}
report-path: test-results/rspec.xmlWhat You Get
- ✓Flaky test detection — automatically identify tests that pass and fail intermittently
- ✓Duration trends — track which tests are getting slower over time
- ✓Health score — a single metric summarizing your test suite reliability
- ✓CI summary — rich test result summaries directly in your GitHub Actions runs
FAQ
How do I generate JUnit XML from RSpec?
Install the rspec_junit_formatter gem and pass it as a formatter: `rspec --format RspecJunitFormatter --out test-results/rspec.xml`. You can use multiple formatters simultaneously.
Does TestGlance work with parallel_tests?
Yes. When using parallel_tests, each process writes its own JUnit XML file. Configure a glob pattern in the TestGlance action to pick up all result files.
Can I track RSpec shared example results?
Yes. Shared examples appear as individual test cases in the JUnit XML output, so TestGlance tracks each inclusion point independently.
Start Monitoring Your RSpec Tests
Free to get started. Set up in under 5 minutes.
Get Started