Giter Site home page Giter Site logo

qbart / rspec_junit_formatter Goto Github PK

View Code? Open in Web Editor NEW

This project forked from sj26/rspec_junit_formatter

0.0 2.0 0.0 130 KB

RSpec results formatted as JUnit XML that your CI can read

Home Page: http://rubygems.org/gems/rspec_junit_formatter

License: MIT License

Ruby 100.00%

rspec_junit_formatter's Introduction

RSpec JUnit Formatter

Build results Gem version

RSpec 2 & 3 results that Jenkins can read. Probably a few other CI services, too.

Inspired by the work of Diego Souza on RSpec Formatters after frustration with CI Reporter.

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"
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.

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.

Roadmap

  • It would be nice to split things up into individual test suites, although would this correspond to example groups? The subject? The spec file? Not sure yet.

Development

Run the specs with bundle exec rake spec. Run the specs against a matrix of rspec versions using bundle exec rake spec:all.

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.

rspec_junit_formatter's People

Contributors

sj26 avatar fledman avatar dwwoelfel avatar kylev avatar tonyta avatar booleanbetrayal avatar dsager avatar hanneskaeufler avatar knapo avatar dlackty avatar suweller avatar qbart avatar

Watchers

 avatar James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.