Hi,
I have a Buildkite step that runs test and reports the coverage.
The ouput/error of the step is redirected into a code_coverage.txt which is passed as an artifact to the next Buildkite steps.
The coverage report is successfully generated and the steps outputs the coverage report into the terminal.
However, if the same coverage report is redirected using the &> operator into the code_coverage.txt file, it is fails to redirect the output of the same into the file and the file is empty.
Working command → make test-coverage MIN_COVERAGE=85 GO_BIN_PATH=/go/bin
New command that does not work → make test-coverage MIN_COVERAGE=85 GO_BIN_PATH=/go/bin &> code_coverage.txt
Can you pls lmk why is this failure happening when I use the &> operator in Buildkite?
Step code :
- label: ":shrek: Run tests & report coverage"
key: "an-test-coverage"
artifact_paths:
- "code_coverage.txt"
plugins:
- docker#v5.9.0:
image: "golang:1.21.1"
volumes:
# Necessary for docker-in-docker testcontainers
- "/var/run/docker.sock:/var/run/docker.sock"
network: "host"
command:
- "sh"
- "-c"
- "cd nest && make test-coverage MIN_COVERAGE=85 GO_BIN_PATH=/go/bin &> code_coverage.txt"