The problem is a result of the command being a pipeline of 3 different commands:
cargo test --workspace --bin=subnet-node -- l --list --format=terse | sed -e 's/: test//g' | jq -ncR '{"test-name": [inputs]}' > test_names.json
The exit status of the entire pipeline will be the exit status of the last command, so if cargo test fails, but jq does not, the shell will consider the pipeline to have succeeded
Steps To Reproduce
Run a CI job where cargo test fails to build
Additional context
In Bash scripts this can be avoided by adding the line set -o pipefail. I am not sure if Bash is the default /bin/sh invoked by GitHub actions though
Describe the bug
The problem is a result of the command being a pipeline of 3 different commands:
The exit status of the entire pipeline will be the exit status of the last command, so if
cargo test
fails, butjq
does not, the shell will consider the pipeline to have succeededSteps To Reproduce
Run a CI job where
cargo test
fails to buildAdditional context
In Bash scripts this can be avoided by adding the line
set -o pipefail
. I am not sure if Bash is the default/bin/sh
invoked by GitHub actions though