@@ -1405,9 +1405,9 @@ combinedScenarios.each { scenario ->
1405
1405
return
1406
1406
}
1407
1407
break
1408
- // We need Windows & Ubuntu x64 Release bits for the code coverage build
1408
+ // We need Windows x64 Release bits for the code coverage build
1409
1409
case ' coverage' :
1410
- if (os != ' Windows_NT' && os != ' Ubuntu ' ) {
1410
+ if (os != ' Windows_NT' ) {
1411
1411
return
1412
1412
}
1413
1413
if (architecture != ' x64' ) {
@@ -1678,42 +1678,16 @@ combinedScenarios.each { scenario ->
1678
1678
{
1679
1679
buildCommands + = " ./build.sh skipmscorlib verbose ${ lowerConfiguration} ${ arch} "
1680
1680
}
1681
- else if (scenario == ' coverage' )
1682
- {
1683
- assert os == ' Ubuntu'
1684
- assert lowerConfiguration == ' release'
1685
- buildCommands + = " ./build.sh coverage verbose ${ lowerConfiguration} ${ arch} "
1686
-
1687
- // Remove folders from obj that we don't expect to be covered. May update this later.
1688
- buildCommands + = " rm -rf ./bin/obj/Linux.x64.Release/src/ToolBox"
1689
- buildCommands + = " rm -rf ./bin/obj/Linux.x64.Release/src/debug"
1690
- buildCommands + = " rm -rf ./bin/obj/Linux.x64.Release/src/ilasm"
1691
- buildCommands + = " rm -rf ./bin/obj/Linux.x64.Release/src/ildasm"
1692
- buildCommands + = " rm -rf ./bin/obj/Linux.x64.Release/src/dlls/dbgshim"
1693
- buildCommands + = " rm -rf ./bin/obj/Linux.x64.Release/src/dlls/mscordac"
1694
- buildCommands + = " rm -rf ./bin/obj/Linux.x64.Release/src/dlls/mscordbi"
1695
- }
1696
1681
else
1697
1682
{
1698
1683
buildCommands + = " ./build.sh verbose ${ lowerConfiguration} ${ arch} "
1699
1684
}
1700
1685
buildCommands + = " src/pal/tests/palsuite/runpaltests.sh \$ {WORKSPACE}/bin/obj/${ osGroup} .${ arch} .${ configuration} \$ {WORKSPACE}/bin/paltestout"
1701
-
1702
- // Delete PAL test obj files after we run them, if this is a coverage job
1703
- if (scenario == ' coverage' ) {
1704
- buildCommands + = " rm -rf ./bin/obj/Linux.x64.Release/src/pal/tests"
1705
- }
1706
1686
1707
1687
// Set time out
1708
1688
setTestJobTimeOut(newJob, scenario)
1709
1689
// Basic archiving of the build
1710
- if (scenario == ' coverage' )
1711
- {
1712
- Utilities . addArchival(newJob, " bin/Product/**,bin/obj/**" )
1713
- }
1714
- else {
1715
- Utilities . addArchival(newJob, " bin/Product/**,bin/obj/*/tests/**/*.dylib,bin/obj/*/tests/**/*.so" )
1716
- }
1690
+ Utilities . addArchival(newJob, " bin/Product/**,bin/obj/*/tests/**/*.dylib,bin/obj/*/tests/**/*.so" )
1717
1691
// And pal tests
1718
1692
Utilities . addXUnitDotNETResults(newJob, ' **/pal_tests.xml' )
1719
1693
}
@@ -2057,15 +2031,6 @@ combinedScenarios.each { scenario ->
2057
2031
2058
2032
steps {
2059
2033
// Set up the copies
2060
-
2061
- // Coreclr build we are trying to test
2062
-
2063
- copyArtifacts(inputCoreCLRBuildName) {
2064
- excludePatterns(' **/testResults.xml' , ' **/*.ni.dll' )
2065
- buildSelector {
2066
- buildNumber(' ${CORECLR_BUILD}' )
2067
- }
2068
- }
2069
2034
2070
2035
// Coreclr build containing the tests and mscorlib
2071
2036
@@ -2077,6 +2042,23 @@ combinedScenarios.each { scenario ->
2077
2042
}
2078
2043
2079
2044
if (scenario == ' coverage' ) {
2045
+ shell(" ./build.sh coverage verbose ${ lowerConfiguration} ${ architecture} " )
2046
+
2047
+ // Remove folders from obj that we don't expect to be covered. May update this later.
2048
+ shell(" rm -rf ./bin/obj/Linux.x64.Release/src/ToolBox" )
2049
+ shell(" rm -rf ./bin/obj/Linux.x64.Release/src/debug" )
2050
+ shell(" rm -rf ./bin/obj/Linux.x64.Release/src/ilasm" )
2051
+ shell(" rm -rf ./bin/obj/Linux.x64.Release/src/ildasm" )
2052
+ shell(" rm -rf ./bin/obj/Linux.x64.Release/src/dlls/dbgshim" )
2053
+ shell(" rm -rf ./bin/obj/Linux.x64.Release/src/dlls/mscordac" )
2054
+ shell(" rm -rf ./bin/obj/Linux.x64.Release/src/dlls/mscordbi" )
2055
+
2056
+ // Run PAL tests
2057
+ shell(" src/pal/tests/palsuite/runpaltests.sh \$ {WORKSPACE}/bin/obj/${ osGroup} .${ architecture} .${ configuration} \$ {WORKSPACE}/bin/paltestout" )
2058
+
2059
+ // Remove obj files for PAL tests so they're not included in coverage results
2060
+ shell(" rm -rf ./bin/obj/Linux.x64.Release/src/pal/tests" )
2061
+
2080
2062
// Move coreclr to clr directory
2081
2063
shell(" rm -rf .clr; mkdir .clr; mv * .clr; mv .git .clr; mv .clr clr" )
2082
2064
@@ -2125,6 +2107,15 @@ combinedScenarios.each { scenario ->
2125
2107
}
2126
2108
else {
2127
2109
2110
+ // Coreclr build we are trying to test
2111
+
2112
+ copyArtifacts(inputCoreCLRBuildName) {
2113
+ excludePatterns(' **/testResults.xml' , ' **/*.ni.dll' )
2114
+ buildSelector {
2115
+ buildNumber(' ${CORECLR_BUILD}' )
2116
+ }
2117
+ }
2118
+
2128
2119
def corefxFolder = Utilities . getFolderName(' dotnet/corefx' ) + ' /' + Utilities . getFolderName(branch)
2129
2120
2130
2121
// Corefx components. We now have full stack builds on all distros we test here, so we can copy straight from CoreFX jobs.
@@ -2173,7 +2164,7 @@ combinedScenarios.each { scenario ->
2173
2164
2174
2165
if (scenario == ' coverage' ) {
2175
2166
// Publish coverage reports
2176
- Utilities . addHtmlPublisher (newJob, ' ${WORKSPACE}/coverage ' , ' Code Coverage Report ' , ' coreclr.html ' )
2167
+ Utilities . addArchival (newJob, " ${ WORKSPACE} /Coverage/reports/** " )
2177
2168
addEmailPublisher(newJob,
' [email protected] ' )
2178
2169
}
2179
2170
@@ -2193,7 +2184,23 @@ combinedScenarios.each { scenario ->
2193
2184
JobReport.Report . addReference(inputCoreCLRBuildName)
2194
2185
JobReport.Report . addReference(inputWindowTestsBuildName)
2195
2186
JobReport.Report . addReference(fullTestJobName)
2196
- def newFlowJob = buildFlowJob(Utilities . getFullJobName(project, flowJobName, isPR, folder)) {
2187
+ def newFlowJob;
2188
+
2189
+ // If this is a coverage job, we don't copy any input coreCLR build - instead, we build it as part of the flow job,
2190
+ // so that coverage data can be preserved.
2191
+ if (scenario == ' coverage' ) {
2192
+ newFlowJob = buildFlowJob(Utilities . getFullJobName(project, flowJobName, isPR, folder)) {
2193
+ buildFlow("""
2194
+ // Build the input Windows job
2195
+ windowsBuildJob = build(params, '${ inputWindowTestsBuildName} ')
2196
+
2197
+ // And then build the test build
2198
+ build(params + [CORECLR_WINDOWS_BUILD: windowsBuildJob.build.number], '${ fullTestJobName} ')
2199
+ """ )
2200
+ }
2201
+ // Normal jobs copy a Windows build & a non-Windows build
2202
+ } else {
2203
+ newFlowJob = buildFlowJob(Utilities . getFullJobName(project, flowJobName, isPR, folder)) {
2197
2204
buildFlow("""
2198
2205
// Build the input jobs in parallel
2199
2206
parallel (
@@ -2205,6 +2212,7 @@ parallel (
2205
2212
build(params + [CORECLR_BUILD: coreclrBuildJob.build.number,
2206
2213
CORECLR_WINDOWS_BUILD: windowsBuildJob.build.number], '${ fullTestJobName} ')
2207
2214
""" )
2215
+ }
2208
2216
}
2209
2217
2210
2218
setMachineAffinity(newFlowJob, os, architecture)
0 commit comments