-
Notifications
You must be signed in to change notification settings - Fork 95
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Don't exit on successful RSpec and Cucumber runs #25
Conversation
Knapsack runners should coexist with other Rake tasks. Exiting even when the tests ran successfully was preventing any subsequent Rake tasks from running.
@ciembor Will this change break your rerun failing specs solution? http://blog.lunarlogic.io/2015/randomly-failing-cucumber-scenarios-in-continuous-integration-system/ Related old PR #17 @sentience Thanks for PR. Is that mean when the first test suite failed then chain is stopped. The second test suite won't be executed? |
@ArturT Currently if you run a set of Rake tasks and the first task fails, the task will normally Calling My fix makes knapsack’s runners behave the way Rake tasks are expected to behave. If there’s a use case where it’s desirable for a task to force Rake to exit with a successful status code, I’d be surprised, but of course very interested! :) |
Don't exit on successful RSpec and Cucumber runs
@sentience Thanks for clarification and PR! I'm going to release new version of the gem today. |
@@ -15,7 +15,7 @@ def self.run(args) | |||
cmd = %Q[bundle exec rspec #{args} --default-path #{allocator.test_dir} -- #{allocator.stringify_node_tests}] | |||
|
|||
system(cmd) | |||
exit($?.exitstatus) | |||
exit($?.exitstatus) unless $?.exitstatus == 0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
or $?.success?
or $?.exitstatus.zero?
:tmyk:
|
I will do change today so no need for such tiny PR :) |
In our CI setup, we run a single Rake task that invokes multiple test suites, including RSpec and Cucumber. We wish to use Knapsack to parallelise the RSpec and Cucumber suites; however, both
RSpecRunner
andCucumberRunner
end with a call toexit
, which exits Rake whether or not the suite ran successfully. This prevented any subsequent Rake tasks from running.Knapsack’s runners should coexist with other Rake tasks, including any that may depend on the Knapsack tasks running first.
This change only
exit
s from Knapsack when the child process exited with a non-zero status.