ceylon test
command should exit with nonzero status if tests fail
#360
Comments
Done. |
Thanks! |
The fix for this has broken the embedded use case because now the tool causes the process to exit. In particular we used to run |
So the |
This does not sound right. Can't the run tool just return with the Success/Failure status, that can be read and interpreted by the embedded runner? |
Well what's the right API to use to do |
The api is |
Well maybe that's the one we should be using in the compiler tests then. But is there a good reason why we can't use the |
I don't see any way how to exit with custom code, without calling |
btw. if it is just for one test in compiler, it would be possible to override |
Folks WTF is going on here? This trivial issue has been open for >6 months now. Can I close it please? |
So here's what I think. I'll add a By default the |
BTW, apparently ATM the |
Right, I just checked and it does. It also does on the JVM but since we fork for the So also, the |
So to recap what I will do: For JS:
For JVM:
So it should all work out. |
Launcher will catch and call exit for us if required, just throw the exit code
OK all done. |
@FroMage after this change, the console output contains exception stacktrace caused by
|
btw. with this approach, it is not possible to exit with custom code, to distinguish what fails |
Yes, for both backends. I could catch it in the ant task, I guess. I figured it was OK as long as we log a failure. But I could hide it, yes.
Why not? It still calls exit with the right exit code, no? Oh, you mean the assert exception. Well OK I can make an exception that contains the exit code I suppose, but how many exit codes do you expect to have to handle? Tests either pass or they don't, no? |
hypothetically (but it is not something what I would like to implement now) there can be following results: success, test failed (propagate assertion exception), test with error (propagate non-assertion exception), test framework crashed but for now it will be enough to not show the stacktrace ;-) |
Should be fixed now. |
Currently,
ceylon test X
always exits with status0
. For automation purposes, it would be much more convenient if it exited with0
only in the case of success, and some other status otherwise (perhaps with different statuses for “tests failed” or “abnormal failure” as well).Not sure whether this belongs in the Ceylon tool or the Java tool. Probably the latter, but the former will have to inform the latter of the outcome somehow.
The text was updated successfully, but these errors were encountered: