npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

rspec-to-conclusion

v1.0.0

Published

Command line utility for running rspec to conclusion

Downloads

4

Readme

rspec-to-conclusion

Circle CI Code Climate Test Coverage

A node based command for running rspec to conclusion

Background

One time, myself, and my friends-- we found ourselves as JavaScript engineers, building JavaScript products, writing JavaScript Unit Tests.. and it was pretty cool.

But our integration tests? The tests that "drove a browser?" Those tests were written in Ruby.

Ruby?

Ruby!

Ruby.

And RSpec + Capybara.

I :heart: Ruby. And I :blue_heart: RSpec.

But.. the big bummer was that the integration tests failed sporadically and a full test run took as long as 45 minutes.

And.. for one reason or another, we couldn't fix the tests directly or delete the problematic ones.

It was a weird time.

And so, for a lark, I wanted to see what would happen if we wrote a small utility that managed rspec runs with JavaScript: :money_with_wings:.

Usage

If you just run rspec by itself, it will run all of the specs in your specs/ directory.

However, if any of these fail, you have to manually parse through the output to see which ones failed, and then run them again.

If you run rspec-to-conclusion it will run all of the specs in your specs/ directory, and it will also:

  • Create an HTML record of the run in rspecToConclusion-1.html, and create a JSON record of the run in rspecToConclusion-1.json
  • Parse the JSON and make note passing and failing specs.
  • If you had any failures, it will start another rspec run and repeat the process above but for only the failed specs.
  • HTML and JSON records of what happened during the second run will be created at: rspecToConclusion-2.html and rspecToConclusion-2.json
  • rspec-to-conclusion will keep repeating this process until all of the specs have passed (:thumbsup:) or the maximum number of tries has been reached but you still have failures (:thumbsdown:).
  • Once the runs have ended, an ascii summary will be printed. An example:
| File Name and Line Number      | Result  | Tries |
| ------------------------------ | ------- | ----- |
| ./spec/always_pend_spec.rb:2   | PENDING | 0     |
| ./spec/always_pend_spec.rb:6   | PENDING | 0     |
| ./spec/always_pass_spec.rb:2   | PASSED  | 1     |
| ./spec/always_pass_spec.rb:6   | PASSED  | 1     |
| ./spec/flakey_spec.rb:2        | PASSED  | 1     |
| ./spec/really_flakey_spec.rb:2 | PASSED  | 1     |
| ./spec/flakey_spec.rb:6        | FAILURE | 2     |
| ./spec/really_flakey_spec.rb:6 | FAILURE | 2     |

Finally, the status code returned by rspec-to-conclusion will be the number of failing specs. So-- if they all passed-- it'll be zero and signal success.

Options

You can focus the number of specs by supplying a parameter:

target specific specs

rspec-to-conclusion specs/for/a/feature

--tries

By default, the maximum number of tries is 5. You can change this to be more or less:

rspec-to-conclusion --tries 10

ENV variables

Any environment variables will be passed onto rspec:

NOT_ON_MY_WATCH=true rspec-to-conclusion

Installation

You can get rspec-to-conclusion by typing:

npm install -g rspec-to-conclusion

Miscellaneous

rspec must be in your PATH.