Skip to content
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

Process exit code on error #18

Open
dump247 opened this issue Apr 25, 2012 · 2 comments
Open

Process exit code on error #18

dump247 opened this issue Apr 25, 2012 · 2 comments

Comments

@dump247
Copy link

dump247 commented Apr 25, 2012

When an error occurs, cover should set the process exit code to something other than zero. This allows calling tools to detect a test failure. At the moment, if a test fails, our build server claims success because cover exits with an exit code of zero.

@itay
Copy link
Owner

itay commented Apr 25, 2012

@dump247 great issue.

One question to get your opinion on: how would you denote a Cover error vs an error induced by the actual program? For example, if I exit with exit code 1, how would you know if it is because Cover failed or your program failed?

Note that if your program failed, Cover will still generate code coverage information. If Cover itself dies, no coverage is likely.

@dump247
Copy link
Author

dump247 commented Apr 26, 2012

For me, it is irrelevant. I just need to know that the process failed so that the build process can halt. I would imagine that is the case for almost everyone else as well. It is easy enough to diagnose the issue afterward and run the build process again, possibly disabling node-cover, if that is determined to be the cause of the problem. If the tests fail and I get some coverage info, that's ok. It will just be ignored. If it is important to someone to distinguish between node and target program failure, one possibility is to return 1 for node and 2 for program. Then write something to stdout that is grep-able. However, I would be surprised if that is relevant to anyone.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants