summaryrefslogtreecommitdiff
path: root/netci.groovy
diff options
context:
space:
mode:
authorSejong OH <sejooh@microsoft.com>2016-03-23 10:32:25 -0700
committerSejong OH <sejooh@microsoft.com>2016-03-24 11:12:44 -0700
commitde0c3c3d5162581b8bda84169d53c42ec31ddf82 (patch)
treec1b5cf89316154a72c55362786bbe073dec2c85b /netci.groovy
parent07d75e16770635768c063d7626c218de79ab6ee3 (diff)
downloadcoreclr-de0c3c3d5162581b8bda84169d53c42ec31ddf82.tar.gz
coreclr-de0c3c3d5162581b8bda84169d53c42ec31ddf82.tar.bz2
coreclr-de0c3c3d5162581b8bda84169d53c42ec31ddf82.zip
Add --test-env option to tests/runtest.sh to set stress mode environment varibles just before tests run.
Diffstat (limited to 'netci.groovy')
-rwxr-xr-x[-rw-r--r--]netci.groovy59
1 files changed, 40 insertions, 19 deletions
diff --git a/netci.groovy b/netci.groovy
index adbc503cab..747ef5c3da 100644..100755
--- a/netci.groovy
+++ b/netci.groovy
@@ -138,7 +138,6 @@ def static getStressModeDisplayName(def scenario) {
return displayStr
}
-
// Generates the string for creating a file that sets environment variables
// that makes it possible to run stress modes. Writes the script to a file called
// SetStressModes.[sh/cmd]
@@ -157,16 +156,39 @@ def static genStressModeScriptStep(def os, def stressModeName, def stressModeVar
else {
// For these we don't use a script, we use directly
stepScript += "echo Setting variables for ${stressModeName}\n"
+ stepScript += "rm -f ${stepScriptLocation}\n"
stressModeVars.each{ k, v ->
// Write out what we are writing to the script file
stepScript += "echo Setting ${k}=${v}\n"
// Write out the set itself to the script file`
- stepScript += "export ${k}=${v}\n"
+ stepScript += "echo export ${k}=${v} >> ${stepScriptLocation}\n"
}
}
return stepScript
}
+// Corefx doesn't have a support to pass stress mode environment variables. This function
+// generates commands to set or export environment variables
+def static getStressModeEnvSetCmd(def os, def stressModeName) {
+ def envVars = Constants.jitStressModeScenarios[stressModeName]
+ def setEnvVars = ''
+ if (os == 'Windows_NT') {
+ envVars.each{ VarName, Value ->
+ if (VarName != '') {
+ setEnvVars += "set ${VarName}=${Value}\n"
+ }
+ }
+ }
+ else {
+ envVars.each{ VarName, Value ->
+ if (VarName != '') {
+ setEnvVars += "export ${VarName}=${Value}\n"
+ }
+ }
+ }
+ return setEnvVars
+}
+
// Calculates the name of the build job based on some typical parameters.
//
def static getJobName(def configuration, def architecture, def os, def scenario, def isBuildOnly) {
@@ -902,16 +924,10 @@ combinedScenarios.each { scenario ->
buildCommands += 'powershell foreach ($x in get-childitem -force) { if (\$x.name -ne \'clr\') { move-item $x clr }}'
buildCommands += "git clone https://github.com/dotnet/corefx fx"
- def setEnvVar = ''
- def envVars = Constants.jitStressModeScenarios[scenario]
- envVars.each{ VarName, Value ->
- if (VarName != '') {
- setEnvVar += "&& set ${VarName}=${Value} "
- }
- }
+ buildCommands += getStressModeEnvSetCmd(os, scenario);
// Run corefx build and testing
- buildCommands += "cd fx && call \"C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\VC\\vcvarsall.bat\" x86 ${setEnvVar} && Build.cmd /p:ConfigurationGroup=Release /p:BUILDTOOLS_OVERRIDE_RUNTIME=%WORKSPACE%\\clr\\bin\\Product\\Windows_NT.x64.Checked "
+ buildCommands += "cd fx && call \"C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\VC\\vcvarsall.bat\" x86 && Build.cmd /p:ConfigurationGroup=Release /p:BUILDTOOLS_OVERRIDE_RUNTIME=%WORKSPACE%\\clr\\bin\\Product\\Windows_NT.x64.Checked "
}
else {
def stepScriptLocation = "%WORKSPACE%\\bin\\tests\\SetStressModes.bat"
@@ -1031,11 +1047,12 @@ combinedScenarios.each { scenario ->
buildCommands += "git clone https://github.com/dotnet/corefx fx"
// Set environment variable
- def setEnvVar = genStressModeScriptStep(os, scenario, Constants.jitStressModeScenarios[scenario], null)
-
+ def setEnvVar = getStressModeEnvSetCmd(os, scenario)
+
// Build and text corefx
buildCommands += "rm -rf \$WORKSPACE/fx_home; mkdir \$WORKSPACE/fx_home"
- buildCommands += "${setEnvVar} cd fx; export HOME=\$WORKSPACE/fx_home; ./build.sh /p:ConfigurationGroup=Release /p:BUILDTOOLS_OVERRIDE_RUNTIME=\$WORKSPACE/clr/bin/Product/Linux.x64.Checked"
+ buildCommands += setEnvVar
+ buildCommands += "cd fx; export HOME=\$WORKSPACE/fx_home; ./build.sh /p:ConfigurationGroup=Release /p:BUILDTOOLS_OVERRIDE_RUNTIME=\$WORKSPACE/clr/bin/Product/Linux.x64.Checked"
// Archive and process test result
Utilities.addArchival(newJob, "fx/bin/tests/**/testResults.xml")
@@ -1205,7 +1222,7 @@ combinedScenarios.each { scenario ->
}
// Corefx native component.
- // Pull from main folder in corefx for now, once the corefx branchify PR gets merged this will chnage
+ // Pull from main folder in corefx for now, once the corefx branchify PR gets merged this will chnage
def corefxFolder = Utilities.getFolderName('dotnet/corefx')
copyArtifacts("${corefxFolder}/nativecomp_${os.toLowerCase()}_release") {
includePatterns('bin/**')
@@ -1230,24 +1247,28 @@ combinedScenarios.each { scenario ->
// Execute the tests
// If we are running a stress mode, we'll set those variables first
- def stressModeString = ""
+ def testEnvOpt = ""
if (Constants.jitStressModeScenarios.containsKey(scenario)) {
- stressModeString = genStressModeScriptStep(os, scenario, Constants.jitStressModeScenarios[scenario], null)
+ def scriptFileName = "\$WORKSPACE/set_stress_test_env.sh"
+ def createScriptCmds = genStressModeScriptStep(os, scenario, Constants.jitStressModeScenarios[scenario], scriptFileName)
+ if (createScriptCmds != "") {
+ shell("${createScriptCmds}")
+ testEnvOpt = "--test-env=" + scriptFileName
+ }
}
if (isGCStressRelatedTesting(scenario)) {
shell('./init-tools.sh')
}
- shell("""${stressModeString}
- ./tests/runtest.sh \\
+ shell("""./tests/runtest.sh \\
--testRootDir=\"\${WORKSPACE}/bin/tests/Windows_NT.${architecture}.${configuration}\" \\
--testNativeBinDir=\"\${WORKSPACE}/bin/obj/${osGroup}.${architecture}.${configuration}/tests\" \\
--coreClrBinDir=\"\${WORKSPACE}/bin/Product/${osGroup}.${architecture}.${configuration}\" \\
--mscorlibDir=\"\${WORKSPACE}/bin/Product/${osGroup}.${architecture}.${configuration}\" \\
--coreFxBinDir=\"\${WORKSPACE}/bin/${osGroup}.AnyCPU.Release\" \\
--coreFxNativeBinDir=\"\${WORKSPACE}/bin/${osGroup}.${architecture}.Release\" \\
- ${serverGCString}""")
+ ${testEnvOpt} ${serverGCString}""")
}
}