fix: leo test now returns non-zero exit status when one or more tests fail#29025
fix: leo test now returns non-zero exit status when one or more tests fail#29025mitchmindtree wants to merge 2 commits intomasterfrom
leo test now returns non-zero exit status when one or more tests fail#29025Conversation
1a3c190 to
9ea9b4d
Compare
d0cd
left a comment
There was a problem hiding this comment.
Looks great @mitchmindtree! Worth mentioning that there's a few places in the CLI where we don't exit with good errors, broadcast failures for one.
|
Thanks @d0cd! I'll keep an eye out for these other sites where we should be exiting with nice errors too. I noticed that the whole process is actually I've attempted to workaround the VM panic issue by using I'm thinking I'll remove the new test for now, but leave an issue to re-add once #28992 is addressed. |
|
It doesn't fix the core issue, but if you adjust the logic so that the assertion isn't trivially false, you should be able to deploy it. One way to do this is make it depend on some input. |
This is achieved by: - Adding a `CliError` `tests_failed` variant. - Returning this error if `total_passed < total`. Also ensures we capture and compare exit codes in integration testing.
Note that the test still fails to exit cleanly with a non-zero exit code, as the VM is still `panic!`ing over the unsatisfied constraint in the same location, as the error handling commits haven't yet made it into the latest canary-v0.4.5 release.
2749af0 to
e394972
Compare
Motivation
leo testshould exit with a non-zero status code #28971To-Do
CliError::tests_failedvariant, return it in the case that one or more tests failed.leo testexits with non-zero exit code on failing tests.REWRITE_EXPECTATIONSto update existing tests to check exit codes.--disable-update-checkflag to leo #29026.