buildCommands += "tests\\scripts\\run-gc-reliability-framework.cmd ${arch} ${configuration}"
}
else {
- buildCommands += "tests\\runtest.cmd ${runtestArguments}"
+ def buildCommandsStr = "call tests\\runtest.cmd ${runtestArguments}\r\n"
+ if (!isBuildOnly) {
+ // 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 += "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", "")
+ }
+ buildCommands += buildCommandsStr
}
} // end if (!isBuildOnly)
buildCommands += "build.cmd ${lowerConfiguration} arm64 linuxmscorlib"
}
- // Zip up the tests directory so that we don't use so much space/time copying
- // 10s of thousands of files around.
- buildCommands += "powershell -NoProfile -Command \"Add-Type -Assembly 'System.IO.Compression.FileSystem'; [System.IO.Compression.ZipFile]::CreateFromDirectory('.\\bin\\tests\\${osGroup}.${arch}.${configuration}', '.\\bin\\tests\\tests.zip')\"";
-
if (!isJitStressScenario(scenario)) {
+ // Zip up the tests directory so that we don't use so much space/time copying
+ // 10s of thousands of files around.
+ buildCommands += "powershell -NoProfile -Command \"Add-Type -Assembly 'System.IO.Compression.FileSystem'; [System.IO.Compression.ZipFile]::CreateFromDirectory('.\\bin\\tests\\${osGroup}.${arch}.${configuration}', '.\\bin\\tests\\tests.zip')\"";
+
// For Windows, pull full test results and test drops for x86/x64.
// No need to pull for stress mode scenarios (downstream builds use the default scenario)
Utilities.addArchival(newJob, "bin/Product/**,bin/tests/tests.zip", "bin/Product/**/.nuget/**")
// Run runtest.cmd
// Do not run generate layout. It will delete the correct CORE_ROOT, and we do not have a correct product
// dir to copy from.
- def runtestCommand = "%WORKSPACE%\\tests\\runtest.cmd ${architecture} ${configuration} skipgeneratelayout"
+ def runtestCommand = "call %WORKSPACE%\\tests\\runtest.cmd ${architecture} ${configuration} skipgeneratelayout"
addCommand("${runtestCommand}")
+ addCommand("set saved_errorlevel=%errorlevel%")
+
+ // Collect the test logs collected by xunit. Ignore errors here. We want to collect these even if the run
+ // failed for some reason, so it needs to be in this batch file.
+
+ addCommand("powershell -NoProfile -Command \"Add-Type -Assembly 'System.IO.Compression.FileSystem'; [System.IO.Compression.ZipFile]::CreateFromDirectory('.\\bin\\tests\\${osGroup}.${architecture}.${configuration}\\Reports', '.\\bin\\tests\\testReports.zip')\"");
- // Use the smarty errorlevel as the script errorlevel.
- addCommand("exit /b %errorlevel%")
+ // Use the runtest.cmd errorlevel as the script errorlevel.
+ addCommand("exit /b %saved_errorlevel%")
batchFile(buildCommands)
} // non-corefx testing
} // job
if (!isCoreFxScenario(scenario)) {
+ Utilities.addArchival(newJob, "bin/tests/testReports.zip", "")
Utilities.addXUnitDotNETResults(newJob, 'bin/**/TestRun*.xml', true)
}