summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--build.cmd14
-rw-r--r--netci.groovy511
2 files changed, 287 insertions, 238 deletions
diff --git a/build.cmd b/build.cmd
index b50eca1359..c9a6d8b893 100644
--- a/build.cmd
+++ b/build.cmd
@@ -49,6 +49,8 @@ if /i "%1" == "vs2015" (set __VSVersion=%1&shift&goto Arg_Loop)
if /i "%1" == "skiptestbuild" (set __SkipTestBuild=1&shift&goto Arg_Loop)
if /i "%1" == "docrossgen" (set __DoCrossgen=1&shift&goto Arg_Loop)
+if /i "%1" == "priority" (set __TestPriority=%2&shift&shift&goto Arg_Loop)
+
if /i "%1" == "/toolset_dir" (set __ToolsetDir=%2&shift&shift&goto Arg_Loop)
echo Invalid commandline argument: %1
@@ -294,7 +296,14 @@ if defined __SkipTestBuild (
echo.
echo Commencing build of tests for %__BuildOS%.%__BuildArch%.%__BuildType%
echo.
-call %__ProjectDir%\tests\buildtest.cmd
+set __BuildtestArgs=
+
+if defined __TestPriority (
+ set "__BuildtestArgs=Priority %__TestPriority%"
+)
+
+call %__ProjectDir%\tests\buildtest.cmd %__BuildtestArgs%
+
IF NOT ERRORLEVEL 1 goto SuccessfulBuild
echo Test binaries build failed. Refer !__TestManagedBuildLog! for details.
exit /b 1
@@ -323,4 +332,5 @@ echo linuxmscorlib - Build mscorlib for Linux
echo osxmscorlib - Build mscorlib for OS X
echo skiptestbuild - Skip building tests
echo toolset_dir - toolset directory -- Arm64 use only.
-exit /b 1
+echo Priority (N) where N is a number that signifies the set of tests that will be built and consequently run.
+exit /b 1 \ No newline at end of file
diff --git a/netci.groovy b/netci.groovy
index 014f965f02..8d03f085f4 100644
--- a/netci.groovy
+++ b/netci.groovy
@@ -126,263 +126,298 @@ def static addPRTrigger(def job, def architecture, def os, def configuration, is
}
}
-[true, false].each { isPR ->
- ['arm', 'arm64', 'x64', 'x86'].each { architecture ->
- ['Debug', 'Release'].each { configuration ->
- osList.each { os ->
- // Skip totally unimplemented (in CI) configurations.
- switch (architecture) {
- case 'arm64':
- // Windows or cross compiled Ubuntu
- if (os != 'Windows_NT' && os != 'Ubuntu') {
- println("Skipping ${os} ${architecture}")
- return
- }
- break
- case 'arm':
- // Only Ubuntu cross implemented
- if (os != 'Ubuntu') {
- println("Skipping ${os} ${architecture}")
- return
- }
- break
- case 'x86':
- // Skip non-windows
- if (os != 'Windows_NT') {
- println("Skipping ${os} ${architecture}")
- return
- }
- break
- case 'x64':
- // Everything implemented
- break
- default:
- println("Unknown architecture: ${architecture}");
- assert false
- break
- }
-
- // Calculate names
- def lowerConfiguration = configuration.toLowerCase()
- def jobName = getBuildJobName(configuration, architecture, os)
+[true, false].each { buildPri1Tests ->
+ [true, false].each { isPR ->
+ ['arm', 'arm64', 'x64', 'x86'].each { architecture ->
+ ['Debug', 'Release'].each { configuration ->
+ osList.each { os ->
+ // Skip totally unimplemented (in CI) configurations.
+ switch (architecture) {
+ case 'arm64':
+ // Windows or cross compiled Ubuntu
+ if (os != 'Windows_NT' && os != 'Ubuntu') {
+ println("Skipping ${os} ${architecture}")
+ return
+ }
+ break
+ case 'arm':
+ // Only Ubuntu cross implemented
+ if (os != 'Ubuntu') {
+ println("Skipping ${os} ${architecture}")
+ return
+ }
+ break
+ case 'x86':
+ // Skip non-windows
+ if (os != 'Windows_NT') {
+ println("Skipping ${os} ${architecture}")
+ return
+ }
+ break
+ case 'x64':
+ // Everything implemented
+ break
+ default:
+ println("Unknown architecture: ${architecture}")
+ assert false
+ break
+ }
+
+ //Skip Pri-1 test build unless it's for Windows x64 Release
+ if (buildPri1Tests && (architecture != 'x64' || configuration != 'Release' || os != 'Windows_NT'))
+ {
+ println("Skipping unneeded Priority 1 tests");
+ return
+ }
- // Create the new job
- def newJob = job(Utilities.getFullJobName(project, jobName, isPR)) {}
+ // Calculate names
+ def lowerConfiguration = configuration.toLowerCase()
+ if (buildPri1Tests) {
+ def jobName = getBuildJobName(configuration, architecture, os) + "_pri1"
+ }
+ else {
+ def jobName = getBuildJobName(configuration, architecture, os)
+ }
+
+ // Create the new job
+ def newJob = job(Utilities.getFullJobName(project, jobName, isPR)) {}
- setMachineAffinity(newJob, os, architecture)
- // Add all the standard options
- Utilities.standardJobSetup(newJob, project, isPR)
- if (isPR) {
- addPRTrigger(newJob, architecture, os, configuration, false)
- }
- else {
- Utilities.addGithubPushTrigger(newJob)
- }
+ setMachineAffinity(newJob, os, architecture)
+ // Add all the standard options
+ Utilities.standardJobSetup(newJob, project, isPR)
+ if (isPR) {
+ addPRTrigger(newJob, architecture, os, configuration, false)
+ }
+ else {
+ Utilities.addGithubPushTrigger(newJob)
+ }
- def buildCommands = [];
- def osGroup = getOSGroup(os)
+ def buildCommands = [];
+ def osGroup = getOSGroup(os)
- // Calculate the build steps, archival, and xunit results
- switch (os) {
- case 'Windows_NT':
- switch (architecture) {
- case 'x64':
- case 'x86':
- buildCommands += "build.cmd ${lowerConfiguration} ${architecture}"
-
- // TEMPORARY. Don't run tests for PR jobs on x86
- if (architecture == 'x64' || !isPR) {
- buildCommands += "tests\\runtest.cmd ${lowerConfiguration} ${architecture}"
- }
-
- // Run the rest of the build
- // Build the mscorlib for the other OS's
- buildCommands += "build.cmd ${lowerConfiguration} ${architecture} linuxmscorlib"
- buildCommands += "build.cmd ${lowerConfiguration} ${architecture} freebsdmscorlib"
- buildCommands += "build.cmd ${lowerConfiguration} ${architecture} osxmscorlib"
+ // Calculate the build steps, archival, and xunit results
+ switch (os) {
+ case 'Windows_NT':
+ switch (architecture) {
+ case 'x64':
+ case 'x86':
+ if (buildPri1Tests)
+ {
+ buildCommands += "build.cmd ${lowerConfiguration} ${architecture} Priority 1"
+ }
+ else
+ {
+ buildCommands += "build.cmd ${lowerConfiguration} ${architecture}"
+ }
+ // TEMPORARY. Don't run tests for PR jobs on x86
+ if (architecture == 'x64' || !isPR) {
+ buildCommands += "tests\\runtest.cmd ${lowerConfiguration} ${architecture}"
+ }
- // Zip up the tests directory so that we don't use so much space/time copying
- // 10s of thousands of files around.
- buildCommands += "powershell -Command \"Add-Type -Assembly 'System.IO.Compression.FileSystem'; [System.IO.Compression.ZipFile]::CreateFromDirectory('.\\bin\\tests\\${osGroup}.${architecture}.${configuration}', '.\\bin\\tests\\tests.zip')\"";
+ // Run the rest of the build
+ // Build the mscorlib for the other OS's
+ buildCommands += "build.cmd ${lowerConfiguration} ${architecture} linuxmscorlib"
+ buildCommands += "build.cmd ${lowerConfiguration} ${architecture} freebsdmscorlib"
+ buildCommands += "build.cmd ${lowerConfiguration} ${architecture} osxmscorlib"
- // For windows, pull full test results and test drops for x86/x64
- Utilities.addArchival(newJob, "bin/Product/**,bin/tests/tests.zip")
- // TEMPORARY. Don't run tests for PR jobs on x86
- if (architecture == 'x86' && !isPR) {
- Utilities.addXUnitDotNETResults(newJob, 'bin/**/TestRun*.xml')
- }
- break
- case 'arm64':
- buildCommands += "build.cmd ${lowerConfiguration} ${architecture} skiptestbuild /toolset_dir C:\\ats"
- // Add archival. No xunit results for x64 windows
- Utilities.addArchival(newJob, "bin/Product/**")
- break
- default:
- println("Unknown architecture: ${architecture}");
- assert false
- break
- }
- break
- case 'Ubuntu':
- case 'Debian8.2':
- case 'OSX':
- case 'FreeBSD':
- case 'CentOS7.1':
- case 'OpenSUSE13.2':
- switch (architecture) {
- case 'x64':
- case 'x86':
- // On other OS's we skipmscorlib but run the pal tests
- buildCommands += "./build.sh skipmscorlib verbose ${lowerConfiguration} ${architecture}"
- buildCommands += "src/pal/tests/palsuite/runpaltests.sh \${WORKSPACE}/bin/obj/${osGroup}.${architecture}.${configuration} \${WORKSPACE}/bin/paltestout"
-
- // Basic archiving of the build
- Utilities.addArchival(newJob, "bin/Product/**,bin/obj/*/tests/**")
- // And pal tests
- Utilities.addXUnitDotNETResults(newJob, '**/pal_tests.xml')
- break
- case 'arm64':
- // We don't run the cross build except on Ubuntu
- assert os == 'Ubuntu'
-
- buildCommands += """echo \"Using rootfs in /opt/aarch64-linux-gnu-root\"
- ROOTFS_DIR=/opt/aarch64-linux-gnu-root ./build.sh skipmscorlib arm64 cross verbose ${lowerConfiguration}"""
+ // Zip up the tests directory so that we don't use so much space/time copying
+ // 10s of thousands of files around.
+ buildCommands += "powershell -Command \"Add-Type -Assembly 'System.IO.Compression.FileSystem'; [System.IO.Compression.ZipFile]::CreateFromDirectory('.\\bin\\tests\\${osGroup}.${architecture}.${configuration}', '.\\bin\\tests\\tests.zip')\"";
- // Basic archiving of the build, no pal tests
- Utilities.addArchival(newJob, "bin/Product/**")
- break
- case 'arm':
- // We don't run the cross build except on Ubuntu
- assert os == 'Ubuntu'
+ // For windows, pull full test results and test drops for x86/x64
+ Utilities.addArchival(newJob, "bin/Product/**,bin/tests/tests.zip")
+ // TEMPORARY. Don't run tests for PR jobs on x86
+ if (architecture == 'x86' && !isPR) {
+ Utilities.addXUnitDotNETResults(newJob, 'bin/**/TestRun*.xml')
+ }
+ break
+ case 'arm64':
+ buildCommands += "build.cmd ${lowerConfiguration} ${architecture} skiptestbuild /toolset_dir C:\\ats"
+ // Add archival. No xunit results for x64 windows
+ Utilities.addArchival(newJob, "bin/Product/**")
+ break
+ default:
+ println("Unknown architecture: ${architecture}");
+ assert false
+ break
+ }
+ break
+ case 'Ubuntu':
+ case 'Debian8.2':
+ case 'OSX':
+ case 'FreeBSD':
+ case 'CentOS7.1':
+ case 'OpenSUSE13.2':
+ switch (architecture) {
+ case 'x64':
+ case 'x86':
+ // On other OS's we skipmscorlib but run the pal tests
+ buildCommands += "./build.sh skipmscorlib verbose ${lowerConfiguration} ${architecture}"
+ buildCommands += "src/pal/tests/palsuite/runpaltests.sh \${WORKSPACE}/bin/obj/${osGroup}.${architecture}.${configuration} \${WORKSPACE}/bin/paltestout"
- buildCommands += """echo \"Using rootfs in /opt/arm-liux-genueabihf-root\"
- ROOTFS_DIR=/opt/arm-linux-genueabihf-root ./build.sh skipmscorlib arm cross verbose ${lowerConfiguration}"""
+ // Basic archiving of the build
+ Utilities.addArchival(newJob, "bin/Product/**,bin/obj/*/tests/**")
+ // And pal tests
+ Utilities.addXUnitDotNETResults(newJob, '**/pal_tests.xml')
+ break
+ case 'arm64':
+ // We don't run the cross build except on Ubuntu
+ assert os == 'Ubuntu'
- // Basic archiving of the build, no pal tests
- Utilities.addArchival(newJob, "bin/Product/**")
- break
- default:
- println("Unknown architecture: ${architecture}");
- assert false
- break
- }
- break
- default:
- println("Unknown os: ${os}");
- assert false
- break
- }
+ buildCommands += """echo \"Using rootfs in /opt/aarch64-linux-gnu-root\"
+ ROOTFS_DIR=/opt/aarch64-linux-gnu-root ./build.sh skipmscorlib arm64 cross verbose ${lowerConfiguration}"""
+
+ // Basic archiving of the build, no pal tests
+ Utilities.addArchival(newJob, "bin/Product/**")
+ break
+ case 'arm':
+ // We don't run the cross build except on Ubuntu
+ assert os == 'Ubuntu'
+
+ buildCommands += """echo \"Using rootfs in /opt/arm-liux-genueabihf-root\"
+ ROOTFS_DIR=/opt/arm-linux-genueabihf-root ./build.sh skipmscorlib arm cross verbose ${lowerConfiguration}"""
+
+ // Basic archiving of the build, no pal tests
+ Utilities.addArchival(newJob, "bin/Product/**")
+ break
+ default:
+ println("Unknown architecture: ${architecture}");
+ assert false
+ break
+ }
+ break
+ default:
+ println("Unknown os: ${os}");
+ assert false
+ break
+ }
- newJob.with {
- steps {
- if (os == 'Windows_NT') {
- buildCommands.each { buildCommand ->
- batchFile(buildCommand)
+ newJob.with {
+ steps {
+ if (os == 'Windows_NT') {
+ buildCommands.each { buildCommand ->
+ batchFile(buildCommand)
+ }
}
- }
- else {
- buildCommands.each { buildCommand ->
- shell(buildCommand)
+ else {
+ buildCommands.each { buildCommand ->
+ shell(buildCommand)
+ }
}
}
}
- }
- } // os
- } // configuration
- } // architecture
-} // isPR
+ } // os
+ } // configuration
+ } // architecture
+ } // isPR
+} // buildPri1Tests
// Create the Linux/OSX coreclr test leg for debug and release.
-[true, false].each { isPR ->
- // Architectures. x64 only at this point
- ['x64'].each { architecture ->
- // Put the OS's supported for coreclr cross testing here
- ['Ubuntu', 'OSX'].each { os ->
- ['Debug', 'Release'].each { configuration ->
- def lowerConfiguration = configuration.toLowerCase()
- def osGroup = getOSGroup(os)
- def jobName = getBuildJobName(configuration, architecture, os) + "_tst"
- def inputCoreCLRBuildName = Utilities.getFolderName(project) + '/' +
- Utilities.getFullJobName(project, getBuildJobName(configuration, architecture, os), isPR)
- def inputWindowTestsBuildName = Utilities.getFolderName(project) + '/' +
- Utilities.getFullJobName(project, getBuildJobName(configuration, architecture, 'windows_nt'), isPR)
+[true, false].each { buildPri1Tests ->
+ [true, false].each { isPR ->
+ // Architectures. x64 only at this point
+ ['x64'].each { architecture ->
+ // Put the OS's supported for coreclr cross testing here
+ ['Ubuntu', 'OSX'].each { os ->
+ ['Debug', 'Release'].each { configuration ->
+ // Skip unnecessary Pri1 legs
+ if (buildPri1Tests && (isPR || configuration != 'Release'))
+ {
+ println("Skipping unneeded Pri1 build")
+ return
+ }
+ def lowerConfiguration = configuration.toLowerCase()
+ def osGroup = getOSGroup(os)
+ def jobName = getBuildJobName(configuration, architecture, os) + "_tst"
+ def inputCoreCLRBuildName = Utilities.getFolderName(project) + '/' +
+ Utilities.getFullJobName(project, getBuildJobName(configuration, architecture, os), isPR)
+ if (buildPri1Tests)
+ {
+ def inputWindowTestsBuildName = Utilities.getFolderName(project) + '/' +
+ Utilities.getFullJobName(project, getBuildJobName(configuration, architecture, 'windows_nt') + "_pri1", isPR)
+ }
+ else
+ {
+ def inputWindowTestsBuildName = Utilities.getFolderName(project) + '/' +
+ Utilities.getFullJobName(project, getBuildJobName(configuration, architecture, 'windows_nt'), isPR)
+ }
- def newJob = job(Utilities.getFullJobName(project, jobName, isPR)) {
- // Add parameters for the inputs
+ def newJob = job(Utilities.getFullJobName(project, jobName, isPR)) {
+ // Add parameters for the inputs
- parameters {
- stringParam('CORECLR_WINDOWS_BUILD', '', 'Build number to copy CoreCLR windows test binaries from')
- stringParam('CORECLR_BUILD', '', "Build number to copy CoreCLR ${osGroup} binaries from")
- }
+ parameters {
+ stringParam('CORECLR_WINDOWS_BUILD', '', 'Build number to copy CoreCLR windows test binaries from')
+ stringParam('CORECLR_BUILD', '', "Build number to copy CoreCLR ${osGroup} binaries from")
+ }
- steps {
- // Set up the copies
-
- // Coreclr build we are trying to test
-
- copyArtifacts(inputCoreCLRBuildName) {
- excludePatterns('**/testResults.xml', '**/*.ni.dll')
- buildSelector {
- buildNumber('${CORECLR_BUILD}')
+ steps {
+ // Set up the copies
+
+ // Coreclr build we are trying to test
+
+ copyArtifacts(inputCoreCLRBuildName) {
+ excludePatterns('**/testResults.xml', '**/*.ni.dll')
+ buildSelector {
+ buildNumber('${CORECLR_BUILD}')
+ }
}
- }
- // Coreclr build containing the tests and mscorlib
+ // Coreclr build containing the tests and mscorlib
- copyArtifacts(inputWindowTestsBuildName) {
- excludePatterns('**/testResults.xml', '**/*.ni.dll')
- buildSelector {
- buildNumber('${CORECLR_WINDOWS_BUILD}')
+ copyArtifacts(inputWindowTestsBuildName) {
+ excludePatterns('**/testResults.xml', '**/*.ni.dll')
+ buildSelector {
+ buildNumber('${CORECLR_WINDOWS_BUILD}')
+ }
}
- }
- // Corefx native components
- def corefxNativeCompBinaries =
- copyArtifacts("dotnet_corefx/nativecomp_${os.toLowerCase()}_release") {
- includePatterns('bin/**')
- buildSelector {
- latestSuccessful(true)
+ // Corefx native components
+ def corefxNativeCompBinaries =
+ copyArtifacts("dotnet_corefx/nativecomp_${os.toLowerCase()}_release") {
+ includePatterns('bin/**')
+ buildSelector {
+ latestSuccessful(true)
+ }
}
- }
- // CoreFX Linux binaries
- copyArtifacts("dotnet_corefx/${os.toLowerCase()}_release_bld") {
- includePatterns('bin/build.pack')
- buildSelector {
- latestSuccessful(true)
+ // CoreFX Linux binaries
+ copyArtifacts("dotnet_corefx/${os.toLowerCase()}_release_bld") {
+ includePatterns('bin/build.pack')
+ buildSelector {
+ latestSuccessful(true)
+ }
}
- }
- // Unpack the corefx binaries
- shell("unpacker ./bin/build.pack ./bin")
+ // Unpack the corefx binaries
+ shell("unpacker ./bin/build.pack ./bin")
- // Unzip the tests first. Exit with 0
- shell("unzip -q -o ./bin/tests/tests.zip -d ./bin/tests/Windows_NT.${architecture}.${configuration} || exit 0")
+ // Unzip the tests first. Exit with 0
+ shell("unzip -q -o ./bin/tests/tests.zip -d ./bin/tests/Windows_NT.${architecture}.${configuration} || exit 0")
- // Execute the tests
- 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\"""")
+ // Execute the tests
+ 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\"""")
+ }
}
- }
- setMachineAffinity(newJob, os, architecture)
- Utilities.standardJobSetup(newJob, project, isPR)
- Utilities.addXUnitDotNETResults(newJob, '**/coreclrtests.xml')
+ setMachineAffinity(newJob, os, architecture)
+ Utilities.standardJobSetup(newJob, project, isPR)
+ Utilities.addXUnitDotNETResults(newJob, '**/coreclrtests.xml')
- // Create a build flow to join together the build and tests required to run this
- // test.
- // Windows CoreCLR build and Linux CoreCLR build (in parallel) ->
- // Linux CoreCLR test
- def flowJobName = getBuildJobName(configuration, architecture, os) + "_flow"
- def fullTestJobName = Utilities.getFolderName(project) + '/' + newJob.name
- def newFlowJob = buildFlowJob(Utilities.getFullJobName(project, flowJobName, isPR)) {
- buildFlow("""
+ // Create a build flow to join together the build and tests required to run this
+ // test.
+ // Windows CoreCLR build and Linux CoreCLR build (in parallel) ->
+ // Linux CoreCLR test
+ def flowJobName = getBuildJobName(configuration, architecture, os) + "_flow"
+ def fullTestJobName = Utilities.getFolderName(project) + '/' + newJob.name
+ def newFlowJob = buildFlowJob(Utilities.getFullJobName(project, flowJobName, isPR)) {
+ buildFlow("""
// Build the input jobs in parallel
parallel (
{ coreclrBuildJob = build(params, '${inputCoreCLRBuildName}') },
@@ -393,21 +428,25 @@ parallel (
build(params + [CORECLR_BUILD: coreclrBuildJob.build.number,
CORECLR_WINDOWS_BUILD: windowsBuildJob.build.number], '${fullTestJobName}')
""")
- // Needs a workspace
- configure {
- def buildNeedsWorkspace = it / 'buildNeedsWorkspace'
- buildNeedsWorkspace.setValue('true')
+ // Needs a workspace
+ configure {
+ def buildNeedsWorkspace = it / 'buildNeedsWorkspace'
+ buildNeedsWorkspace.setValue('true')
+ }
}
- }
- Utilities.standardJobSetup(newFlowJob, project, isPR)
- if (isPR) {
- addPRTrigger(newFlowJob, architecture, os, configuration, true)
- }
- else {
- Utilities.addGithubPushTrigger(newFlowJob)
+ Utilities.standardJobSetup(newFlowJob, project, isPR)
+ if (buildPri1Tests) {
+ Utilities.addPeriodicTrigger(newFlowJob, '@daily')
+ }
+ else if (isPR) {
+ addPRTrigger(newFlowJob, architecture, os, configuration, true)
+ }
+ else {
+ Utilities.addGithubPushTrigger(newFlowJob)
+ }
}
}
}
}
-}
+} \ No newline at end of file