Skip to content

Commit 75d4283

Browse files
authored
Fix unfailing helix test run when testResults.xml are missing (#86342)
* Attempt to fix unfailing helix test run when testResults.xml are missing * Feedback and docker image attemted fix * Commenting out RHEL7 for a test run to see if there are any remaining problems elsewhere * AlmaLinux 8 instead of RHEL7 * Test docker image * Kdepak asi soudruzi udelali chybu * Fixed docker from centos stream 9 to 8 * Test with different Queue * Fixed docker image name
1 parent 93da0c9 commit 75d4283

File tree

3 files changed

+16
-8
lines changed

3 files changed

+16
-8
lines changed

eng/pipelines/libraries/helix-queues-setup.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,8 @@ jobs:
6363
- ${{ if eq(parameters.platform, 'linux_x64') }}:
6464
- ${{ if and(eq(parameters.jobParameters.interpreter, ''), ne(parameters.jobParameters.isSingleFile, true)) }}:
6565
- ${{ if and(eq(parameters.jobParameters.testScope, 'outerloop'), eq(parameters.jobParameters.runtimeFlavor, 'mono')) }}:
66-
- RedHat.7.Amd64.Open
6766
- SLES.15.Amd64.Open
67+
- (Centos.8.Amd64.Open)[email protected]/dotnet-buildtools/prereqs:centos-stream8-helix
6868
- (Fedora.36.Amd64.Open)[email protected]/dotnet-buildtools/prereqs:fedora-36-helix
6969
- (Ubuntu.2204.Amd64.Open)[email protected]/dotnet-buildtools/prereqs:ubuntu-22.04-helix-amd64
7070
- (Debian.10.Amd64.Open)[email protected]/dotnet-buildtools/prereqs:debian-10-helix-amd64
@@ -77,8 +77,8 @@ jobs:
7777
- (Mariner.2.0.Amd64.Open)[email protected]/dotnet-buildtools/prereqs:cbl-mariner-2.0-helix-amd64
7878
- (openSUSE.15.2.Amd64.Open)[email protected]/dotnet-buildtools/prereqs:opensuse-15.2-helix-amd64
7979
- ${{ if or(ne(parameters.jobParameters.isExtraPlatforms, true), eq(parameters.jobParameters.includeAllPlatforms, true)) }}:
80-
- (Centos.7.Amd64.Open)[email protected]/dotnet-buildtools/prereqs:centos-7-mlnet-helix
81-
- RedHat.7.Amd64.Open
80+
- (Centos.8.Amd64.Open)[email protected]/dotnet-buildtools/prereqs:centos-stream8-helix
81+
- (AlmaLinux.8.Amd64.Open)RedHat.7.Amd64.Open@mcr.microsoft.com/dotnet-buildtools/prereqs:almalinux-8-helix-amd64
8282
- (Debian.10.Amd64.Open)[email protected]/dotnet-buildtools/prereqs:debian-10-helix-amd64
8383
- Ubuntu.1804.Amd64.Open
8484
- ${{ if or(eq(parameters.jobParameters.interpreter, 'true'), eq(parameters.jobParameters.isSingleFile, true)) }}:

eng/testing/RunnerTemplate.cmd

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,8 @@ set EXECUTION_DIR=%~dp0
4444
:: Don't use a globally installed SDK.
4545
set DOTNET_MULTILEVEL_LOOKUP=0
4646

47-
:: ========================= BEGIN Test Execution =============================
48-
echo ----- start %DATE% %TIME% =============== To repro directly: =====================================================
47+
:: ========================= BEGIN Test Execution =============================
48+
echo ----- start %DATE% %TIME% =============== To repro directly: =====================================================
4949
echo pushd %EXECUTION_DIR%
5050
[[RunCommandsEcho]]
5151
echo popd
@@ -54,13 +54,18 @@ pushd %EXECUTION_DIR%
5454
@echo on
5555
[[RunCommands]]
5656
@echo off
57+
if exist testResults.xml (
58+
set "HAS_TEST_RESULTS=1"
59+
)
5760
popd
5861
echo ----- end %DATE% %TIME% ----- exit code %ERRORLEVEL% ----------------------------------------------------------
5962
:: The helix work item should not exit with non-zero if tests ran and produced results
6063
:: The special console runner for runtime returns 1 when tests fail
6164
if %ERRORLEVEL%==1 (
62-
if not "%HELIX_WORKITEM_PAYLOAD%"=="" (
63-
exit /b 0
65+
if %HAS_TEST_RESULTS%==1 (
66+
if not "%HELIX_WORKITEM_PAYLOAD%"=="" (
67+
exit /b 0
68+
)
6469
)
6570
)
6671
exit /b %ERRORLEVEL%

eng/testing/RunnerTemplate.sh

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,9 @@ echo ===========================================================================
166166
pushd $EXECUTION_DIR
167167
[[RunCommands]]
168168
test_exitcode=$?
169+
if [[ -s testResults.xml ]]; then
170+
has_test_results=1;
171+
fi;
169172
popd
170173
echo ----- end $(date) ----- exit code $test_exitcode ----------------------------------------------------------
171174

@@ -230,7 +233,7 @@ popd >/dev/null
230233
# ======================== END Core File Inspection ==========================
231234
# The helix work item should not exit with non-zero if tests ran and produced results
232235
# The special console runner for runtime returns 1 when tests fail
233-
if [[ "$test_exitcode" == "1" ]]; then
236+
if [[ "$test_exitcode" == "1" && "$has_test_results" == "1" ]]; then
234237
if [ -n "$HELIX_WORKITEM_PAYLOAD" ]; then
235238
exit 0
236239
fi

0 commit comments

Comments
 (0)