simplecov icon indicating copy to clipboard operation
simplecov copied to clipboard

exit_code not bubbling at_exit in Rails 5 using "rails test"

Open mstewart6 opened this issue 8 years ago • 3 comments

When running rails test for Rails 5, the exit code is not bubbling properly, so I always get a 0 exit code. Changing to run as the deprecated rake test allows the proper exit code to be returned.

The console is properly hitting the exit code checks in both cases as I see the proper error message, I just imagine that the hooks to return the exit code have changed with the switch to using rails instead of rake.

mstewart6 avatar Mar 07 '17 19:03 mstewart6

Thanks for the issue report!

hmm strange... we just exit or process with a proper exit code, so it seems more like rails isn't picking up our exit code or something. Not sure how much we can do there other than look into it and maybe PR to rails.

PragTob avatar Mar 07 '17 20:03 PragTob

After looking more at the rails code, I think there is some modification to the return here that may be necessary based on how they wrap the rails test command. However, a workaround for now is to use rails default instead as it also runs all the tests and isn't wrapped by the system call, so the error code properly bubbles.

Since that works as a workaround, will close this out for anyone else running into this issue.

mstewart6 avatar May 30 '17 17:05 mstewart6

Hi there! Thanks for looking into this, if you could leave code hints that'd be appreciated.

It's good that there is a workaround, but the default should work. So either rails or we need to fix something, given the time, and I'd like to keep this open as a reminder to do so or something that new contributors could have a look at :)

PragTob avatar May 30 '17 20:05 PragTob