A Pipeline That Never Fails
A CI step runs ./run-tests.sh | tee test.log. The tests fail, but the step is green. Why?
./run-tests.sh | tee test.log
Choose one answer
tee converts every non-zero exit code to zero on purpose.
tee
CI runners ignore exit codes of commands that write to files.
The test script must print the word FAILED on stdout for the CI runner to notice a failure.
FAILED
Without pipefail, a pipeline returns the exit status of tee.
pipefail