CoreFX CI Unix Staging commit (dotnet/coreclr#18750)
authorAndon Andonov <anandono@microsoft.com>
Mon, 9 Jul 2018 17:45:24 +0000 (10:45 -0700)
committerGitHub <noreply@github.com>
Mon, 9 Jul 2018 17:45:24 +0000 (10:45 -0700)
* Modify netci.groovy

* Add script exit codes

* Ad PR Triggers for Ubuntu and OSX10.12

* Remove release PR triggers

* Rename arch

Remove IsJitStressTestScenario assert

* Add correct asserts

* Reformat conditions and add triggers for Release/Checked/Debug

* Change %WORKSPACE% to \${WORKSPACE}

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

src/coreclr/build-test.sh
src/coreclr/netci.groovy
src/coreclr/tests/runtest.sh

index 5339dc1..b5badd0 100755 (executable)
@@ -384,6 +384,7 @@ usage()
     echo "verbose - optional argument to enable verbose build output."
     echo "rebuild - if tests have already been built - rebuild them"
     echo "generatelayoutonly - only pull down dependencies and build coreroot"
+    echo "generatetesthostonly - only pull down dependencies and build coreroot and the CoreFX testhost"
     echo "buildagainstpackages - pull down and build using packages."
     echo "runtests - run tests after building them"
     echo "ziptests - zips CoreCLR tests & Core_Root for a Helix run"
@@ -641,6 +642,10 @@ while :; do
             __GenerateLayoutOnly=1
             ;;
 
+        generatetesthostonly)
+            exit 0
+            ;;
+
         buildagainstpackages)
             __BuildAgainstPackagesArg=1
             ;;
index d012674..9a9cae0 100755 (executable)
@@ -1554,6 +1554,17 @@ def static addTriggers(def job, def branch, def isPR, def architecture, def os,
                         Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} ${configuration} via ILLink", "(?i).*test\\W+${os}\\W+${architecture}\\W+${configuration}\\W+${scenario}.*")
                         break
                     }
+
+                    else  if (scenario == 'corefx_innerloop') {
+                        if (configuration == 'Checked') {
+                            Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} ${configuration} CoreFX Tests")                                
+                        }
+                        else {
+                            Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} ${configuration} CoreFX Tests", "(?i).*test\\W+${os}\\W+${architecture}\\W+${configuration}\\W+CoreFX Tests.*")
+                        }
+                        break
+                    }
+
                     // fall through
 
                 case 'OSX10.12':
@@ -1615,6 +1626,12 @@ def static addTriggers(def job, def branch, def isPR, def architecture, def os,
                             }
                             break
 
+                        case 'corefx_innerloop':
+                            if (configuration == 'Checked') {
+                                Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} ${configuration} CoreFX Tests")                                
+                            }
+                            break
+
                         default:
                             if (isJitStressScenario(scenario)) {
                                 def displayStr = getStressModeDisplayName(scenario)
@@ -1732,7 +1749,7 @@ def static addTriggers(def job, def branch, def isPR, def architecture, def os,
                             Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} ${configuration} via ILLink", "(?i).*test\\W+${os}\\W+${architecture}\\W+${configuration}\\W+${scenario}.*")
                             break
                         case 'corefx_innerloop':
-                            if (configuration == 'Release' || configuration == 'Checked') {
+                            if (configuration == 'Checked') {
                                 Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} ${configuration} CoreFX Tests")                                
                             }
                             break
@@ -2203,10 +2220,11 @@ def static calculateBuildCommands(def newJob, def scenario, def branch, def isPR
                                 // Create CORE_ROOT and testhost
                                 buildCommands += "build-test.cmd ${lowerConfiguration} ${arch} buildtesthostonly"                                
                                 buildCommands += "tests\\runtest.cmd ${runtestArguments} CoreFXTestsAll"
-                                
+
                                 // Archive and process (only) the test results
                                 Utilities.addArchival(newJob, "bin/Logs/**/testResults.xml")
                                 Utilities.addXUnitDotNETResults(newJob, "bin/Logs/**/testResults.xml")
+
                             }
                             else {
                               def workspaceRelativeFxRoot = "_/fx"
@@ -2394,32 +2412,48 @@ def static calculateBuildCommands(def newJob, def scenario, def branch, def isPR
                         Utilities.addXUnitDotNETResults(newJob, '**/pal_tests.xml')
                     }
                     else {
-                        // Corefx stress testing
-                        assert os == 'Ubuntu'
-                        assert architecture == 'x64'
-                        assert lowerConfiguration == 'checked'
-                        assert isJitStressScenario(scenario)
+                        if(scenario == 'corefx_innerloop') {
+                            assert os == 'Ubuntu' || 'OSX10.12'
+                            assert architecture == 'x64'
 
-                        // Build coreclr
-                        buildCommands += "./build.sh ${lowerConfiguration} ${architecture}"
+                            buildCommands += "./build.sh ${lowerConfiguration} ${architecture} skiptests"
+                            buildCommands += "./build-test.sh ${lowerConfiguration} ${architecture} generatetesthostonly"
+                            buildCommands += "./tests/runtest.sh --corefxtestsall --testHostDir=\${WORKSPACE}/bin/tests/${osGroup}.${architecture}.${configuration}/testhost/ --coreclr-src=\${WORKSPACE}"
+                            
+                            break
+                            // TODO - uncomment once https://github.com/dotnet/coreclr/pull/18753 has been merged
+                            // Archive and process (only) the test results
+                            // Utilities.addArchival(newJob, "bin/Logs/**/testResults.xml")
+                            // Utilities.addXUnitDotNETResults(newJob, "bin/Logs/**/testResults.xml")
+                        }
+                        else {
+                            // Corefx stress testing
+                            assert os == 'Ubuntu'
+                            assert architecture == 'x64'
+                            assert lowerConfiguration == 'checked'
+                            assert isJitStressScenario(scenario)
 
-                        def scriptFileName = "\$WORKSPACE/set_stress_test_env.sh"
+                            // Build coreclr
+                            buildCommands += "./build.sh ${lowerConfiguration} ${architecture}"
 
-                        def envScriptCmds = envScriptCreate(os, scriptFileName)
-                        envScriptCmds += envScriptSetStressModeVariables(os, Constants.jitStressModeScenarios[scenario], scriptFileName)
-                        envScriptCmds += envScriptFinalize(os, scriptFileName)
-                        buildCommands += envScriptCmds
+                            def scriptFileName = "\$WORKSPACE/set_stress_test_env.sh"
 
-                        // Build and text corefx
-                        def workspaceRelativeFxRoot = "_/fx"
-                        def absoluteFxRoot = "\$WORKSPACE/${workspaceRelativeFxRoot}"
-                        def fxBranch = getFxBranch(branch)
+                            def envScriptCmds = envScriptCreate(os, scriptFileName)
+                            envScriptCmds += envScriptSetStressModeVariables(os, Constants.jitStressModeScenarios[scenario], scriptFileName)
+                            envScriptCmds += envScriptFinalize(os, scriptFileName)
+                            buildCommands += envScriptCmds
+
+                            // Build and text corefx
+                            def workspaceRelativeFxRoot = "_/fx"
+                            def absoluteFxRoot = "\$WORKSPACE/${workspaceRelativeFxRoot}"
+                            def fxBranch = getFxBranch(branch)
 
-                        buildCommands += "python -u \$WORKSPACE/tests/scripts/run-corefx-tests.py -arch ${architecture} -ci_arch ${architecture} -build_type ${configuration} -fx_root ${absoluteFxRoot} -fx_branch ${fxBranch} -env_script ${scriptFileName}"
+                            buildCommands += "python -u \$WORKSPACE/tests/scripts/run-corefx-tests.py -arch ${architecture} -ci_arch ${architecture} -build_type ${configuration} -fx_root ${absoluteFxRoot} -fx_branch ${fxBranch} -env_script ${scriptFileName}"
 
-                        // Archive and process (only) the test results
-                        Utilities.addArchival(newJob, "${workspaceRelativeFxRoot}/bin/**/testResults.xml")
-                        Utilities.addXUnitDotNETResults(newJob, "${workspaceRelativeFxRoot}/bin/**/testResults.xml")
+                            // Archive and process (only) the test results
+                            Utilities.addArchival(newJob, "${workspaceRelativeFxRoot}/bin/**/testResults.xml")
+                            Utilities.addXUnitDotNETResults(newJob, "${workspaceRelativeFxRoot}/bin/**/testResults.xml")
+                        }
                     }
                     break
                 case 'armem':
@@ -2773,10 +2807,10 @@ def static shouldGenerateJob(def scenario, def isPR, def architecture, def confi
                 }
                 break
             case 'corefx_innerloop':
-                if (os != 'Windows_NT'|| architecture != 'x64') {
+                if (os != 'Windows_NT' && os != 'Ubuntu' &&  os != 'OSX10.12') {
                     return false
                 }
-                if(configuration != 'Release' && configuration != 'Checked') {
+                if (architecture != 'x64') {
                     return false
                 }
                 break
index c63ed4a..58038f3 100755 (executable)
@@ -67,6 +67,10 @@ function print_usage {
     echo '                                     is zero when launching this script. This option is intended for use in CI.'
     echo '  --xunitOutputPath=<path>         : Create xUnit XML report at the specifed path (default: <test root>/coreclrtests.xml)'
     echo ''
+    echo 'CoreFX Test Options '
+    echo '  --corefxtests                    : Runs CoreFX tests'
+    echo '  --corefxtestsall                 : Runs all available CoreFX tests'
+    echo ''
     echo 'Runtime Code Coverage options:'
     echo '  --coreclr-coverage               : Optional argument to get coreclr code coverage reports'
     echo '  --coreclr-objs=<path>            : Location of root of the object directory'
@@ -1168,6 +1172,12 @@ do
         --runcrossgentests)
             export RunCrossGen=1
             ;;
+        --corefxtests)
+            exit 0
+            ;;
+        --corefxtestsall)
+            exit 0
+            ;;
         --sequential)
             ((maxProcesses = 1))
             ;;