[Documentation] Run-command docs should remind user how & why to exit non-zero on failure.
Some jobs encounter errors that seem like they should be fatal errors, but still report job success.
For example, qr1hi-8i9sb-mtxaffgfw6athnp:
grep: //c09a19ea17f72c8da97f8cb64a9b333b+743: No such file or directory
ls: cannot access /keep//keep/c09a19ea17f72c8da97f8cb64a9b333b+743/*.vcf: No such file or directory
These jobs should report failure.
#3 Updated by Tom Clegg over 6 years ago
- Tracker changed from Feature to Bug
If you use run-command, the only way to indicate success/failure is exit status. In both of these cases it looks like the script exits 0, run-command sets
success=true on the task, and Crunch sets
state=Complete. Crunch's part of this looks correct.
The script itself, however, incorrectly exit 0 after encountering errors. Fixing this could be as simple (or not simple) as using "set -e" and "set -o pipefail" in all the right places.
Aside 1: The run-command documentation could certainly be more forthcoming with advice about how to write scripts for it to use. (Currently exit codes are only mentioned in the context of the "ignore exit code" feature, which incidentally should probably be adjusted to explain what a terrible, terrible idea it is to use that feature.)
Aside 2: When you're at the point of giving run-command a shell script which in turn builds and runs another shell script, you're doing it wrong. At some point our docs failed you, by steering you toward using run-command for this instead of writing a Python program that calls