SERVER-118867 output all wrapper script output in CI (#47535)

GitOrigin-RevId: b0269a4fa0a721affb6ea7d2e7d240d3d676b271
This commit is contained in:
Daniel Moody 2026-02-03 20:02:21 -06:00 committed by MongoDB Bot
parent 80741f4287
commit 4fb69be1ff
2 changed files with 23 additions and 5 deletions

View File

@ -147,8 +147,14 @@ if [ "$skip_python" == "1" ]; then
exec "$bazel_real" "$@"
fi
wrapper_output_all=0
if [[ -n "${MONGO_WRAPPER_OUTPUT_ALL}" ]] || [[ -n "${CI}" ]]; then
wrapper_output_all=1
fi
if [[ "$SLOW_PATH" == "1" ]] && [[ -z "${MONGO_WRAPPER_OUTPUT_ALL}" ]]; then
wrapper_redirect_output=0
if [[ "$SLOW_PATH" == "1" ]] && [[ "$wrapper_output_all" == "0" ]]; then
wrapper_redirect_output=1
ORIGINAL_ARGS=("$@")
# Save original terminal output FDs
@ -293,11 +299,15 @@ fi
if [[ $autocomplete_query == 1 ]]; then
plus_targets=$(</tmp/mongo_autocomplete_plus_targets)
query_output=$("${new_args[@]@Q}")
echo $query_output $plus_targets | tr " " "\n" >&3
if [[ "$wrapper_redirect_output" == "1" ]]; then
echo $query_output $plus_targets | tr " " "\n" >&3
else
echo $query_output $plus_targets | tr " " "\n"
fi
else
trap 'cleanup_logfile' EXIT
# Slow path: restore stdout/stderr so Bazel prints normally
if [[ -z "${MONGO_WRAPPER_OUTPUT_ALL}" ]]; then
if [[ "$wrapper_redirect_output" == "1" ]]; then
exec 1>&3 2>&4
fi

View File

@ -86,8 +86,16 @@ rem Set up environment variables for terminal output (for engflow_check.py)
rem On Windows, we use CON device for console output
rem Note: Windows doesn't support file descriptor duplication like Unix,
rem so we'll set these to indicate console output should go to CON
set "MONGO_WRAPPER_STDOUT_FD=CON"
set "MONGO_WRAPPER_STDERR_FD=CON"
if not "%MONGO_WRAPPER_OUTPUT_ALL%"=="" (
set "MONGO_WRAPPER_STDOUT_FD="
set "MONGO_WRAPPER_STDERR_FD="
) else if not "%CI%"=="" (
set "MONGO_WRAPPER_STDOUT_FD="
set "MONGO_WRAPPER_STDERR_FD="
) else (
set "MONGO_WRAPPER_STDOUT_FD=CON"
set "MONGO_WRAPPER_STDERR_FD=CON"
)
rem === Start timing ===
set STARTTIME=%TIME%