Linux e2e4d9bfe136 4.9.36-moby #1 SMP Wed Jul 12 15:29:07 UTC 2017 x86_64 GNU/Linux
Expected Behavior
When code-coverage throws an error, a non-zero value should be returned to the calling process (such as the shell under Linux) so a pipeline can fail for instance.
Actual Behavior
In case of any error, to the shell a zero "0" value is returned.
Reproducible Test Case
Some use cases below.
# Try to invoke with non-existing lcov file...
$ cat my_non_existing_lcov.info | codacy-coverage
cat: coverage/lcov.info1: No such file or directory
[error] "2017-08-15T18:12:26.068Z" { ValidationError: "value" is not allowed to be empty
at Object.exports.process (/usr/local/lib/node_modules/codacy-coverage/node_modules/joi/lib/errors.js:140:17)
at internals.String.internals.Any._validateWithOptions (/usr/local/lib/node_modules/codacy-coverage/node_modules/joi/lib/any.js:654:25)
at module.exports.internals.Any.root.validate (/usr/local/lib/node_modules/codacy-coverage/node_modules/joi/lib/index.js:100:23)
at /usr/local/lib/node_modules/codacy-coverage/lib/impl/lcov.js:11:37
...
$ echo $?
0
# Token incorrect
cat coverage/lcov.info | codacy-coverage
[error] "2017-08-15T18:13:51.688Z" 'Status Code [404] - Error [{"error":"not found"}]'
[error] "2017-08-15T18:13:51.691Z" 'Error sending coverage'
[error] "2017-08-15T18:13:51.691Z" Error: Expected Successful Status Code, but got [404]
at /usr/local/lib/node_modules/codacy-coverage/lib/reporter.js:101:23
$ echo $?
0
# Token not set in ENV
cat coverage/lcov.info | codacy-coverage
[error] "2017-08-15T18:14:25.391Z" 'Error sending coverage'
[error] "2017-08-15T18:14:25.393Z" Error: Token is required
$ echo $?
0
node.js Version (7.4.0)
Operating System (Linux (Docker)
Linux e2e4d9bfe136 4.9.36-moby #1 SMP Wed Jul 12 15:29:07 UTC 2017 x86_64 GNU/Linux
Expected Behavior
When
code-coverage
throws an error, a non-zero value should be returned to the calling process (such as the shell under Linux) so a pipeline can fail for instance.Actual Behavior
In case of any error, to the shell a zero "0" value is returned.
Reproducible Test Case
Some use cases below.