Skip to content

Commit

Permalink
Fix work item exit code for helix tests (#45164)
Browse files Browse the repository at this point in the history
* Fix work item exit code for helix tests

The helix work items are only supposed to return non-zero if they fail
to report tests for some reason.

* Fix if
  • Loading branch information
alexperovich authored Nov 24, 2020
1 parent e04274e commit 50c4607
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
8 changes: 7 additions & 1 deletion eng/testing/RunnerTemplate.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,13 @@ pushd %EXECUTION_DIR%
@echo off
popd
echo ----- end %DATE% %TIME% ----- exit code %ERRORLEVEL% ----------------------------------------------------------
exit /b %ERRORLEVEL%
:: The helix work item should not exit with non-zero if tests ran and produced results
:: The special console runner for runtime returns 1 when tests fail
if %ERRORLEVEL%==1 (
exit /b 0
) else (
exit /b %ERRORLEVEL%
)
:: ========================= END Test Execution =================================

:usage
Expand Down
8 changes: 7 additions & 1 deletion eng/testing/RunnerTemplate.sh
Original file line number Diff line number Diff line change
Expand Up @@ -204,4 +204,10 @@ if [[ "$(uname -s)" == "Linux" && $test_exitcode -ne 0 ]]; then
fi
popd >/dev/null
# ======================== END Core File Inspection ==========================
exit $test_exitcode
# The helix work item should not exit with non-zero if tests ran and produced results
# The special console runner for runtime returns 1 when tests fail
if [ "$test_exitcode" == "1" ]; then
exit 0
else
exit $test_exitcode
fi

0 comments on commit 50c4607

Please sign in to comment.