From 9deea768ba84743811589ab2bec9dbfbaab85df0 Mon Sep 17 00:00:00 2001 From: Alex Perovich Date: Tue, 24 Nov 2020 10:18:44 -0800 Subject: [PATCH 1/2] 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. --- eng/testing/RunnerTemplate.cmd | 8 +++++++- eng/testing/RunnerTemplate.sh | 8 +++++++- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/eng/testing/RunnerTemplate.cmd b/eng/testing/RunnerTemplate.cmd index fe28e9157a6e2..52c6f36e7da32 100644 --- a/eng/testing/RunnerTemplate.cmd +++ b/eng/testing/RunnerTemplate.cmd @@ -62,7 +62,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 diff --git a/eng/testing/RunnerTemplate.sh b/eng/testing/RunnerTemplate.sh index 80b496efe82d7..efa20b182cf45 100644 --- a/eng/testing/RunnerTemplate.sh +++ b/eng/testing/RunnerTemplate.sh @@ -197,4 +197,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 From 6152463e5b259875e6b87ea02b628e1597b01a51 Mon Sep 17 00:00:00 2001 From: Alex Perovich Date: Tue, 24 Nov 2020 10:27:30 -0800 Subject: [PATCH 2/2] Fix if --- eng/testing/RunnerTemplate.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eng/testing/RunnerTemplate.sh b/eng/testing/RunnerTemplate.sh index efa20b182cf45..aa0e7b1e93d5c 100644 --- a/eng/testing/RunnerTemplate.sh +++ b/eng/testing/RunnerTemplate.sh @@ -199,7 +199,7 @@ popd >/dev/null # ======================== END Core File Inspection ========================== # 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 +if [ "$test_exitcode" == "1" ]; then exit 0 else exit $test_exitcode