Skip to content

Commit

Permalink
Consider failing tests a failure (#50898)
Browse files Browse the repository at this point in the history
When running `build libs.tests -test` locally, I see the build succeeding even though there's failing tests. This seems to be caused by Helix specific logic in the runner template. It should not apply when we're not running in Helix.
  • Loading branch information
MichalStrehovsky authored Apr 9, 2021
1 parent 8f67ee0 commit 6902c5a
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
7 changes: 4 additions & 3 deletions eng/testing/RunnerTemplate.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,11 @@ echo ----- end %DATE% %TIME% ----- exit code %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%
if not "%HELIX_WORKITEM_PAYLOAD%"=="" (
exit /b 0
)
)
exit /b %ERRORLEVEL%
:: ========================= END Test Execution =================================

:usage
Expand Down
9 changes: 6 additions & 3 deletions eng/testing/RunnerTemplate.sh
Original file line number Diff line number Diff line change
Expand Up @@ -225,8 +225,11 @@ popd >/dev/null
# 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
if [ -n "$HELIX_WORKITEM_PAYLOAD" ]; then
exit 0
fi
fi

exit $test_exitcode
fi

0 comments on commit 6902c5a

Please sign in to comment.