From 6433ee73714c5ba3abd0c454f951cd8949181bdb Mon Sep 17 00:00:00 2001 From: Sean Gillespie Date: Fri, 2 Jun 2017 10:17:53 -0700 Subject: [PATCH] Return 0 on success from GC Reliability Framework scripts (dotnet/coreclr#11990) * Return 0 on success from GC Reliability Framework scripts * Don't save standard out, Jenkins already does this Commit migrated from https://github.com/dotnet/coreclr/commit/392c4e10e4bbdb16d9e3a0d231433fdc15bca0fb --- src/coreclr/netci.groovy | 9 --------- .../tests/scripts/run-gc-reliability-framework.cmd | 15 ++++++++++++++- .../tests/scripts/run-gc-reliability-framework.sh | 16 +++++++++++++++- 3 files changed, 29 insertions(+), 11 deletions(-) diff --git a/src/coreclr/netci.groovy b/src/coreclr/netci.groovy index b1d24b8..5b583c5 100755 --- a/src/coreclr/netci.groovy +++ b/src/coreclr/netci.groovy @@ -1470,8 +1470,6 @@ def static calculateBuildCommands(def newJob, def scenario, def branch, def isPR else if (isGcReliabilityFramework(scenario)) { buildCommands += "tests\\runtest.cmd ${runtestArguments} GenerateLayoutOnly" buildCommands += "tests\\scripts\\run-gc-reliability-framework.cmd ${arch} ${configuration}" - Utilities.addArchival(newJob, "stdout.txt") - Utilities.addArchival(newJob, "Logs/**") } else if (architecture == 'x64' || architecture == 'x86') { buildCommands += "tests\\runtest.cmd ${runtestArguments}" @@ -2498,13 +2496,6 @@ combinedScenarios.each { scenario -> } } - if (isGcReliabilityFramework(scenario)) - { - // Both of these are emitted by the RF - Utilities.addArchival(newJob, "stdout.txt") - Utilities.addArchival(newJob, "Logs/**") - } - if (scenario == 'coverage') { // Publish coverage reports Utilities.addHtmlPublisher(newJob, '${WORKSPACE}/coverage/Coverage/reports', 'Code Coverage Report', 'coreclr.html') diff --git a/src/coreclr/tests/scripts/run-gc-reliability-framework.cmd b/src/coreclr/tests/scripts/run-gc-reliability-framework.cmd index f9a6ae2..66be1d6 100644 --- a/src/coreclr/tests/scripts/run-gc-reliability-framework.cmd +++ b/src/coreclr/tests/scripts/run-gc-reliability-framework.cmd @@ -6,5 +6,18 @@ set CORE_ROOT=%CD%\bin\tests\Windows_NT.%1.%2\Tests\Core_Root set FRAMEWORK_DIR=%CD%\bin\tests\Windows_NT.%1.%2\GC\Stress\Framework\ReliabilityFramework -powershell "%CORE_ROOT%\CoreRun.exe %FRAMEWORK_DIR%\ReliabilityFramework.exe %FRAMEWORK_DIR%\testmix_gc.config | tee stdout.txt" +powershell "%CORE_ROOT%\CoreRun.exe %FRAMEWORK_DIR%\ReliabilityFramework.exe %FRAMEWORK_DIR%\testmix_gc.config" +if %ERRORLEVEL% == 100 ( + @rem The ReliabilityFramework returns 100 on success and 99 on failure + echo ReliabilityFramework successful + exit /b 0 +) else if %ERRORLEVEL% == 99 ( + echo ReliabilityFramework test failed, some tests failed + exit /b 1 +) else ( + @rem The ReliabilityFramework returns -1 when something is wrong with the + @rem run configuration. It should be obvious from standard out why this happened. + echo ReliabilityFramework returned a strange exit code %ERRORLEVEL%, perhaps some config is wrong? + exit /b 1 +) diff --git a/src/coreclr/tests/scripts/run-gc-reliability-framework.sh b/src/coreclr/tests/scripts/run-gc-reliability-framework.sh index d1c200e..d6b8f03 100755 --- a/src/coreclr/tests/scripts/run-gc-reliability-framework.sh +++ b/src/coreclr/tests/scripts/run-gc-reliability-framework.sh @@ -2,5 +2,19 @@ export CORE_ROOT=`pwd`/bin/tests/Windows_NT.$1.$2/Tests/coreoverlay FRAMEWORK_DIR=`pwd`/bin/tests/Windows_NT.$1.$2/GC/Stress/Framework/ReliabilityFramework -$CORE_ROOT/corerun $FRAMEWORK_DIR/ReliabilityFramework.exe $FRAMEWORK_DIR/testmix_gc.config | tee stdout.txt +$CORE_ROOT/corerun $FRAMEWORK_DIR/ReliabilityFramework.exe $FRAMEWORK_DIR/testmix_gc.config +EXIT_CODE=$? +if [ $EXIT_CODE -eq 100 ] +then + echo "ReliabilityFramework successful" + exit 0 +fi +if [ $EXIT_CODE -eq 99 ] +then + echo "ReliabilityFramework test failed, some tests failed" + exit 1 +fi + +echo "ReliabilityFramework returned a strange exit code $EXIT_CODE, perhaps some config is wrong?" +exit 1 -- 2.7.4