A node based command for running rspec to conclusion
But our integration tests? The tests that "drove a browser?" Those tests were written in Ruby.
And RSpec + Capybara.
I ❤️ Ruby. And I 💙 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.
If you just run
rspec by itself, it will run all of the specs in
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
- 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
rspec-to-conclusionwill keep repeating this process until all of the specs have passed (👍) or the maximum number of tries has been reached but you still have failures (👎).
- 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
You can focus the number of specs by supplying a parameter:
target specific specs
By default, the maximum number of tries is 5. You can change this to be more or less:
rspec-to-conclusion --tries 10
Any environment variables will be passed onto rspec:
You can get
rspec-to-conclusion by typing:
npm install -g rspec-to-conclusion
rspec must be in your