serpapi / turbo_tests

Run RSpec tests on multiple cores. Like parallel_tests but with incremental summarized output. Originally extracted from the Discourse and Rubygems source code.
https://rubygems.org/gems/turbo_tests
MIT License
173 stars 26 forks source link

Fail tests on errors outside of examples #10

Closed ilyazub closed 3 years ago

ilyazub commented 3 years ago

Thanks to @grk (https://github.com/serpapi/turbo_tests/issues/5#issuecomment-802825842) I started fixing #5.

It turns out that Discourse already fixed this in their repo: https://github.com/discourse/discourse/commit/e3e7905d9ebd86943102917b2ff0bfee32035c01, https://github.com/discourse/discourse/commit/1157d2a0ff4150edcff28a4f63099470f6c1d460. This PR mostly back-ports these changes.

Currently, it fails the test suite and prints actual errors.

$ bundle exec turbo_tests 
2 processes for 2 specs, ~ 1 specs per process

An error occurred while loading ./spec/turbo_tests_spec.rb.
Failure/Error: 1/0

ZeroDivisionError:
  divided by 0
# ./spec/turbo_tests_spec.rb:6:in `/'
# ./spec/turbo_tests_spec.rb:6:in `block in <top (required)>'
# ./spec/turbo_tests_spec.rb:1:in `<top (required)>'
..

Finished in 3.58 seconds (files took 3.21 seconds to load)
2 examples, 0 failures, 1 error occurred outside of examples

Fixes #5