From 22a2149da7f43d41b344449be3c2d4e22078098f Mon Sep 17 00:00:00 2001 From: Bruce Forstall Date: Tue, 8 Jan 2019 11:02:40 -0800 Subject: [PATCH] Update test reports archiving Two things: 1. Turn "echo" back on after runtests.cmd, so we see in the log file the testReports.zip compression. 2. Change the archiving of testReports.zip to not occur even if the test run fails (this is actually the most interesting case), and don't fail if there is nothing to archive. Commit migrated from https://github.com/dotnet/coreclr/commit/491c4ad85ba6cdfde84a45ee00b7b1ea823cd7a3 --- src/coreclr/netci.groovy | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/coreclr/netci.groovy b/src/coreclr/netci.groovy index 906238b..0f6c650 100755 --- a/src/coreclr/netci.groovy +++ b/src/coreclr/netci.groovy @@ -2271,11 +2271,14 @@ def static calculateBuildCommands(def newJob, def scenario, def branch, def isPR // If we ran the tests, collect the test logs collected by xunit. We want to do this even if the tests fail, so we // must do it in the same batch file as the test run. + buildCommandsStr += "echo on\r\n" // Show the following commands in the log. "echo" doesn't alter the errorlevel. buildCommandsStr += "set saved_errorlevel=%errorlevel%\r\n" buildCommandsStr += "powershell -NoProfile -Command \"Add-Type -Assembly 'System.IO.Compression.FileSystem'; [System.IO.Compression.ZipFile]::CreateFromDirectory('.\\bin\\tests\\${osGroup}.${arch}.${configuration}\\Reports', '.\\bin\\tests\\testReports.zip')\"\r\n"; buildCommandsStr += "exit /b %saved_errorlevel%\r\n" - Utilities.addArchival(newJob, "bin/tests/testReports.zip", "") + def doNotFailIfNothingArchived = true + def archiveOnlyIfSuccessful = false + Utilities.addArchival(newJob, "bin/tests/testReports.zip", "", doNotFailIfNothingArchived, archiveOnlyIfSuccessful) } buildCommands += buildCommandsStr } @@ -3145,6 +3148,7 @@ def static CreateWindowsArmTestJob(def dslFactory, def project, def architecture def runtestCommand = "call %WORKSPACE%\\tests\\runtest.cmd ${architecture} ${configuration} skipgeneratelayout" addCommand("${runtestCommand}") + addCommand("echo on") // Show the following commands in the log. "echo" doesn't alter the errorlevel. addCommand("set saved_errorlevel=%errorlevel%") // Collect the test logs collected by xunit. Ignore errors here. We want to collect these even if the run @@ -3161,7 +3165,10 @@ def static CreateWindowsArmTestJob(def dslFactory, def project, def architecture } // job if (!isCoreFxScenario(scenario)) { - Utilities.addArchival(newJob, "bin/tests/testReports.zip", "") + def doNotFailIfNothingArchived = true + def archiveOnlyIfSuccessful = false + Utilities.addArchival(newJob, "bin/tests/testReports.zip", "", doNotFailIfNothingArchived, archiveOnlyIfSuccessful) + Utilities.addXUnitDotNETResults(newJob, 'bin/**/TestRun*.xml', true) } -- 2.7.4