Skip to content

Commit 3d0d1f7

Browse files
gregmagolanalexeagle
authored andcommitted
fix(builtin): fix bazel coverage masking test failures
1 parent 4dcb37f commit 3d0d1f7

1 file changed

Lines changed: 11 additions & 2 deletions

File tree

internal/node/launcher.sh

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -352,6 +352,15 @@ if [ "${EXPECTED_EXIT_CODE}" != "0" ]; then
352352
fi
353353
fi
354354

355+
# Do not collect coverage for failed tests
356+
if [ ${RESULT} -ne 0 ]; then
357+
if [[ -n "${EXIT_CODE_CAPTURE}" ]]; then
358+
exit 0
359+
else
360+
exit ${RESULT}
361+
fi
362+
fi
363+
355364
# Post process the coverage information after the process has exited
356365
if [[ -n "${COVERAGE_DIR:-}" ]]; then
357366
if [[ -n "${VERBOSE_LOGS:-}" ]]; then
@@ -366,8 +375,8 @@ if [[ -n "${COVERAGE_DIR:-}" ]]; then
366375
RESULT="$?"
367376
set -e
368377

369-
if [ ${RESULT} -ne 0 ]; then
370-
exit ${RESULT}
378+
if [[ -n "${EXIT_CODE_CAPTURE}" ]]; then
379+
echo "${RESULT}" > "${EXIT_CODE_CAPTURE}"
371380
fi
372381
fi
373382

0 commit comments

Comments
 (0)