pulsar
pulsar copied to clipboard
Return non-zero exit codes when something goes wrong (WIP)
This close #52
Some references around the web (like this) tells that is a standard to return a value of 0
when the command performed successfully and a value different form 0
otherwise.
So this is the exit_status
table for our project:
CASE | EXIT CODE |
---|---|
all commands successfully terminated | 0 |
invalid pulsar parameters | 1 |
other exceptions | 1 |
IMPORTANT
I think this PR will never solve the related issue: there is an unresolvable conflict between Kernel::exit
and simplecov
gem. Maybe the cause is related to at_exit
callback used by simplecov. I noticed many unpredictable weirds behaviors. I tried to keep tests green and full coverage, with many tricks and workarounds but I lost the challenge.
NB. The statement with Kernel::exit
method is not covered by default by ruby built-in coverage mechanism, so in any case we'll get a 100%
coverage result when using this method.
maybe this can help: https://bibwild.wordpress.com/2017/09/15/consider-ttycommand-for-all-your-external-processshell-out-needs-in-ruby/ ?