https://github.com/sj26/rspec_junit_formatter
RSpec results that your CI can read
https://github.com/sj26/rspec_junit_formatter
Keywords
buildkite circleci jenkins junit rspec
Keywords from Contributors
crash-reporting activerecord activejob mvc feature-flag rubygem error-handler rack sinatra oauth2
Last synced: about 4 hours ago
JSON representation
Repository metadata
RSpec results that your CI can read
- Host: GitHub
- URL: https://github.com/sj26/rspec_junit_formatter
- Owner: sj26
- License: mit
- Created: 2011-05-24T08:08:15.000Z (over 14 years ago)
- Default Branch: main
- Last Pushed: 2024-04-29T10:02:43.000Z (over 1 year ago)
- Last Synced: 2025-12-19T21:23:25.542Z (22 days ago)
- Topics: buildkite, circleci, jenkins, junit, rspec
- Language: Ruby
- Homepage: http://rubygems.org/gems/rspec_junit_formatter
- Size: 232 KB
- Stars: 307
- Watchers: 9
- Forks: 127
- Open Issues: 13
- Releases: 7
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
README.md
RSpec JUnit Formatter
RSpec 2 & 3 results that your CI can read. Jenkins, Buildkite, CircleCI, Gitlab, and probably more, too.
Usage
Install the gem:
gem install rspec_junit_formatter
Use it:
rspec --format RspecJunitFormatter --out rspec.xml
You'll get an XML file rspec.xml with your results in it.
You can use it in combination with other formatters, too:
rspec --format progress --format RspecJunitFormatter --out rspec.xml
Using in your project with Bundler
Add it to your Gemfile if you're using Bundler. Put it in the same groups as rspec.
group :test do
gem "rspec"
gem "rspec_junit_formatter", require: false
end
Put the same arguments as the commands above in your .rspec:
--format RspecJunitFormatter
--out rspec.xml
Parallel tests
For use with parallel_tests, add $TEST_ENV_NUMBER in the output file option (in .rspec or .rspec_parallel) to avoid concurrent process write conflicts.
--format RspecJunitFormatter
--out tmp/rspec<%= ENV["TEST_ENV_NUMBER"] %>.xml
The formatter includes $TEST_ENV_NUMBER in the test suite name within the XML, too.
Capturing output
If you like, you can capture the standard output and error streams of each test into the :stdout and :stderr example metadata which will be added to the junit report, e.g.:
# spec_helper.rb
RSpec.configure do |config|
# register around filter that captures stdout and stderr
config.around(:each) do |example|
$stdout = StringIO.new
$stderr = StringIO.new
example.run
example.metadata[:stdout] = $stdout.string
example.metadata[:stderr] = $stderr.string
$stdout = STDOUT
$stderr = STDERR
end
end
Note that this example captures all output from every example all the time, potentially interfering with local debugging. You might like to restrict this to only on CI, or by using rspec filters.
Caveats
- XML can only represent a limited subset of characters which excludes null bytes and most control characters. This gem will use character entities where possible and fall back to replacing invalid characters with Ruby-like escape codes otherwise. For example, the null byte becomes
\0.
Development
Run the specs with bundle exec rake, which uses Appraisal to run the specs against all supported versions of rspec.
Releasing
Bump the gem version in the gemspec, and commit. Then bundle exec rake build to build a gem package, bundle exec rake install to install and test it locally, then bundle exec rake release to tag and push the commits and gem.
License
The MIT License, see LICENSE.
Thanks
Inspired by the work of Diego Souza on RSpec Formatters after frustration with CI Reporter.
Owner metadata
- Name: Samuel Cochran
- Login: sj26
- Email: sj26@sj26.com
- Kind: user
- Description: Founding engineer at @Buildkite.
- Website: http://sj26.com
- Location: Melbourne, Australia
- Twitter: sj26
- Company: @Buildkite
- Icon url: https://avatars.githubusercontent.com/u/14028?u=cbb8ccd4668f985db542b4fd8357fb21ff360700&v=4
- Repositories: 355
- Last ynced at: 2025-10-30T12:36:29.394Z
- Profile URL: https://github.com/sj26
GitHub Events
Total
- Issues event: 5
- Watch event: 6
- Issue comment event: 8
- Pull request event: 3
- Fork event: 3
Last Year
- Issues event: 3
- Watch event: 5
- Issue comment event: 7
- Pull request event: 3
- Fork event: 3
Committers metadata
Last synced: 1 day ago
Total Commits: 181
Total Committers: 24
Avg Commits per committer: 7.542
Development Distribution Score (DDS): 0.215
Commits in past year: 0
Committers in past year: 0
Avg Commits per committer in past year: 0.0
Development Distribution Score (DDS) in past year: 0.0
| Name | Commits | |
|---|---|---|
| Samuel Cochran | s****6@s****m | 142 |
| David Feldman | d****n@a****m | 6 |
| dependabot[bot] | 4****] | 5 |
| fping | f****g@p****m | 3 |
| Vincent Landgraf | V****f@S****e | 2 |
| Daniel Woelfel | d****l@g****m | 2 |
| Kyle VanderBeek | k****v@k****m | 2 |
| Olle Jonsson | o****n@g****m | 2 |
| Tony Ta | t****t@g****m | 2 |
| Brent Dearth | b****t@p****m | 1 |
| Akira Matsuda | r****e@d****p | 1 |
| Daniel Sager | d****l@s****e | 1 |
| Hannes Kaeufler | h****r@g****m | 1 |
| Krzysztof Knapik | k****o@k****t | 1 |
| Matheus Poli | m****o@g****m | 1 |
| Nate Bird | n****d@g****m | 1 |
| Richard Lee | d****y@g****m | 1 |
| Steven Weller | g****b@s****m | 1 |
| bart | w****j@g****m | 1 |
| ssein | s****n@s****m | 1 |
| Tim Rogers | t****m@g****m | 1 |
| Sean Walbran | s****n@s****m | 1 |
| Curtis Stewart | c****t@m****m | 1 |
| r7kamura | r****a@g****m | 1 |
Committer domains:
- momentumsi.com: 1
- socialcast.com: 1
- gocardless.com: 1
- servers.com: 1
- suweller.com: 1
- knapo.net: 1
- sager1.de: 1
- dio.jp: 1
- pedago.com: 1
- kylev.com: 1
- sophos.de: 1
- plansource.com: 1
- avant.com: 1
- sj26.com: 1
Issue and Pull Request metadata
Last synced: 13 days ago
Total issues: 51
Total pull requests: 64
Average time to close issues: 4 months
Average time to close pull requests: 3 months
Total issue authors: 49
Total pull request authors: 50
Average comments per issue: 3.0
Average comments per pull request: 2.55
Merged pull request: 28
Bot issues: 0
Bot pull requests: 6
Past year issues: 3
Past year pull requests: 4
Past year average time to close issues: 3 minutes
Past year average time to close pull requests: about 3 hours
Past year issue authors: 3
Past year pull request authors: 2
Past year average comments per issue: 1.33
Past year average comments per pull request: 1.0
Past year merged pull request: 0
Past year bot issues: 0
Past year bot pull requests: 0
Top Issue Authors
- jantman (2)
- jayhendren (2)
- cyberdisk (1)
- kazuhisa (1)
- shawnzhu (1)
- smythey21 (1)
- zumbrunnen (1)
- esterlinej (1)
- wscourge (1)
- TimAle (1)
- KlotzAndrew (1)
- LukevanTricht (1)
- firedev (1)
- vjain98 (1)
- mcallaway (1)
Top Pull Request Authors
- dependabot[bot] (6)
- olleolleolle (6)
- Drowze (2)
- nourmat (2)
- kylev (2)
- skaestle (2)
- MatheusPoliCamilo (1)
- andreacfm (1)
- threez (1)
- eugeneius (1)
- TimAle (1)
- mackstar (1)
- tonyta (1)
- bschmeck (1)
- maschwenk (1)
Top Issue Labels
Top Pull Request Labels
- dependencies (6)
Package metadata
- Total packages: 3
-
Total downloads:
- rubygems: 480,600,043 total
- Total docker downloads: 941,461,100
- Total dependent packages: 1,420 (may contain duplicates)
- Total dependent repositories: 21,456 (may contain duplicates)
- Total versions: 67
- Total maintainers: 1
gem.coop: rspec_junit_formatter
RSpec results that your continuous integration service can read.
- Homepage: https://github.com/sj26/rspec_junit_formatter
- Documentation: http://www.rubydoc.info/gems/rspec_junit_formatter/
- Licenses: MIT
- Latest release: 0.6.0 (published over 3 years ago)
- Last Synced: 2026-01-09T04:08:43.897Z (2 days ago)
- Versions: 25
- Dependent Packages: 0
- Dependent Repositories: 0
- Downloads: 240,367,079 Total
- Docker Downloads: 470,730,550
-
Rankings:
- Dependent repos count: 0.0%
- Dependent packages count: 0.0%
- Average: 0.082%
- Downloads: 0.106%
- Docker downloads count: 0.221%
- Maintainers (1)
rubygems.org: rspec_junit_formatter
RSpec results that your continuous integration service can read.
- Homepage: https://github.com/sj26/rspec_junit_formatter
- Documentation: http://www.rubydoc.info/gems/rspec_junit_formatter/
- Licenses: MIT
- Latest release: 0.6.0 (published over 3 years ago)
- Last Synced: 2026-01-08T03:57:53.783Z (3 days ago)
- Versions: 25
- Dependent Packages: 1,420
- Dependent Repositories: 21,456
- Downloads: 240,232,964 Total
- Docker Downloads: 470,730,550
-
Rankings:
- Dependent packages count: 0.036%
- Downloads: 0.106%
- Dependent repos count: 0.243%
- Docker downloads count: 0.274%
- Average: 1.05%
- Forks count: 2.367%
- Stargazers count: 3.273%
- Maintainers (1)
proxy.golang.org: github.com/sj26/rspec_junit_formatter
- Homepage:
- Documentation: https://pkg.go.dev/github.com/sj26/rspec_junit_formatter#section-documentation
- Licenses: mit
- Latest release: v0.6.0 (published over 3 years ago)
- Last Synced: 2026-01-09T11:31:17.298Z (1 day ago)
- Versions: 17
- Dependent Packages: 0
- Dependent Repositories: 0
-
Rankings:
- Forks count: 1.508%
- Stargazers count: 1.917%
- Average: 4.942%
- Dependent packages count: 6.999%
- Dependent repos count: 9.346%
Dependencies
- rspec >= 0
- appraisal 2.4.1
- coderay 1.1.3
- diff-lcs 1.5.0
- mini_portile2 2.8.0
- nokogiri 1.13.4
- racc 1.6.0
- rake 13.0.6
- rspec 3.10.0
- rspec-core 3.10.1
- rspec-expectations 3.10.1
- rspec-mocks 3.10.2
- rspec-support 3.10.3
- rspec_junit_formatter 0.5.1
- thor 1.1.0
- appraisal >= 0 development
- bundler >= 0 development
- coderay >= 0 development
- nokogiri ~> 1.8, >= 1.8.2 development
- rake >= 0 development
- actions/checkout v2 composite
- actions/upload-artifact v2 composite
- ruby/setup-ruby v1 composite
Score: 30.021764724049607