Fix x86 perf testing
authorMichelle McDaniel <adiaaida@gmail.com>
Tue, 21 Feb 2017 19:35:04 +0000 (11:35 -0800)
committeradiaaida <adiaaida@gmail.com>
Wed, 22 Feb 2017 01:34:59 +0000 (17:34 -0800)
We did not use a different architecture in run-xunit-perf.cmd, so all the
x86 runs were uploading to the same architecture. This change fixes it so
x86jit32 runs upload to their own architecture. Also fixes the delayed
expansion issue for testenv.

Commit migrated from https://github.com/dotnet/coreclr/commit/be7cd4d6b59d65b5a74feb8a698b90b641732cec

src/coreclr/perf.groovy
src/coreclr/tests/scripts/run-xunit-perf.cmd

index 3561e08..f1daa26 100644 (file)
@@ -74,8 +74,8 @@ def static getOSGroup(def os) {
                                        batchFile("py \"%WORKSPACE%\\Microsoft.BenchView.JSONFormat\\tools\\machinedata.py\"")
                                        batchFile("set __TestIntermediateDir=int&&build.cmd ${configuration} ${architecture}")
                                        batchFile("tests\\runtest.cmd ${configuration} ${architecture} GenerateLayoutOnly")
-                                       batchFile("tests\\scripts\\run-xunit-perf.cmd -arch ${architecture} -configuration ${configuration} ${testEnv} -testBinLoc bin\\tests\\Windows_NT.${architecture}.${configuration}\\performance\\perflab\\Perflab -library -uploadToBenchview \"%WORKSPACE%\\Microsoft.Benchview.JSONFormat\\tools\" -runtype ${runType}")
-                                       batchFile("tests\\scripts\\run-xunit-perf.cmd -arch ${architecture} -configuration ${configuration} ${testEnv} -testBinLoc bin\\tests\\Windows_NT.${architecture}.${configuration}\\Jit\\Performance\\CodeQuality -uploadToBenchview \"%WORKSPACE%\\Microsoft.Benchview.JSONFormat\\tools\" -runtype ${runType}")
+                                       batchFile("tests\\scripts\\run-xunit-perf.cmd -arch ${arch} -configuration ${configuration} ${testEnv} -testBinLoc bin\\tests\\Windows_NT.${architecture}.${configuration}\\performance\\perflab\\Perflab -library -uploadToBenchview \"%WORKSPACE%\\Microsoft.Benchview.JSONFormat\\tools\" -runtype ${runType}")
+                                       batchFile("tests\\scripts\\run-xunit-perf.cmd -arch ${arch} -configuration ${configuration} ${testEnv} -testBinLoc bin\\tests\\Windows_NT.${architecture}.${configuration}\\Jit\\Performance\\CodeQuality -uploadToBenchview \"%WORKSPACE%\\Microsoft.Benchview.JSONFormat\\tools\" -runtype ${runType}")
                                }
                        }
 
index 0696fd3..fef05e5 100644 (file)
@@ -4,18 +4,26 @@
 
 @setlocal
 @echo off
+Setlocal EnableDelayedExpansion
 
 rem Set defaults for the file extension, architecture and configuration
 set CORECLR_REPO=%CD%
 set TEST_FILE_EXT=exe
 set TEST_ARCH=x64
+set TEST_ARCHITECTURE=x64
 set TEST_CONFIG=Release
-set TEST_ENV=thisfilewillnotexist
 
 goto :ARGLOOP
 
+
 :SETUP
 
+IF /I [%TEST_ARCHITECTURE%] == [x86jit32] (
+    set TEST_ARCH=x86
+) ELSE (
+    set TEST_ARCH=%TEST_ARCHITECTURE%
+)
+
 set CORECLR_OVERLAY=%CORECLR_REPO%\bin\tests\Windows_NT.%TEST_ARCH%.%TEST_CONFIG%\Tests\Core_Root
 set RUNLOG=%CORECLR_REPO%\bin\Logs\perfrun.log
 
@@ -57,7 +65,7 @@ if not [%BENCHVIEW_PATH%] == [] (
                                     --config-name "%TEST_CONFIG%" ^
                                     --config Configuration "%TEST_CONFIG%" ^
                                     --config OS "Windows_NT" ^
-                                    --arch "%TEST_ARCH%" ^
+                                    --arch "%TEST_ARCHITECTURE%" ^
                                     --machinepool "PerfSnake"
   py "%BENCHVIEW_PATH%\upload.py" submission.json --container coreclr
 )
@@ -80,8 +88,10 @@ xcopy /s %BENCHDIR%*.txt . >> %RUNLOG%
 set CORE_ROOT=%CORECLR_REPO%\sandbox
 
 @rem setup additional environment variables
-if EXIST %TEST_ENV% (
-    call %TEST_ENV%
+if DEFINED TEST_ENV (
+    if EXIST !TEST_ENV! (
+        call %TEST_ENV%
+    )
 )
 
 xunit.performance.run.exe %BENCHNAME%.%TEST_FILE_EXT% -runner xunit.console.netcore.exe -runnerhost corerun.exe -verbose -runid %PERFOUT% > %BENCHNAME%.out
@@ -127,7 +137,7 @@ shift
 goto :ARGLOOP
 )
 IF /I [%1] == [-arch] (
-set TEST_ARCH=%2
+set TEST_ARCHITECTURE=%2
 shift
 shift
 goto :ARGLOOP