Skip to content
This repository was archived by the owner on Jan 23, 2023. It is now read-only.

Commit d46d422

Browse files
committed
Build coreclr as part of flow job in coverage jobs
1 parent 9265318 commit d46d422

File tree

1 file changed

+48
-40
lines changed

1 file changed

+48
-40
lines changed

netci.groovy

Lines changed: 48 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -1405,9 +1405,9 @@ combinedScenarios.each { scenario ->
14051405
return
14061406
}
14071407
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
14091409
case 'coverage':
1410-
if (os != 'Windows_NT' && os != 'Ubuntu') {
1410+
if (os != 'Windows_NT') {
14111411
return
14121412
}
14131413
if (architecture != 'x64') {
@@ -1678,42 +1678,16 @@ combinedScenarios.each { scenario ->
16781678
{
16791679
buildCommands += "./build.sh skipmscorlib verbose ${lowerConfiguration} ${arch}"
16801680
}
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-
}
16961681
else
16971682
{
16981683
buildCommands += "./build.sh verbose ${lowerConfiguration} ${arch}"
16991684
}
17001685
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-
}
17061686

17071687
// Set time out
17081688
setTestJobTimeOut(newJob, scenario)
17091689
// 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")
17171691
// And pal tests
17181692
Utilities.addXUnitDotNETResults(newJob, '**/pal_tests.xml')
17191693
}
@@ -2057,15 +2031,6 @@ combinedScenarios.each { scenario ->
20572031

20582032
steps {
20592033
// 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-
}
20692034

20702035
// Coreclr build containing the tests and mscorlib
20712036

@@ -2077,6 +2042,23 @@ combinedScenarios.each { scenario ->
20772042
}
20782043

20792044
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+
20802062
// Move coreclr to clr directory
20812063
shell("rm -rf .clr; mkdir .clr; mv * .clr; mv .git .clr; mv .clr clr")
20822064

@@ -2125,6 +2107,15 @@ combinedScenarios.each { scenario ->
21252107
}
21262108
else {
21272109

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+
21282119
def corefxFolder = Utilities.getFolderName('dotnet/corefx') + '/' + Utilities.getFolderName(branch)
21292120

21302121
// 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 ->
21732164

21742165
if (scenario == 'coverage') {
21752166
// Publish coverage reports
2176-
Utilities.addHtmlPublisher(newJob, '${WORKSPACE}/coverage', 'Code Coverage Report', 'coreclr.html')
2167+
Utilities.addArchival(newJob, "${WORKSPACE}/Coverage/reports/**")
21772168
addEmailPublisher(newJob, '[email protected]')
21782169
}
21792170

@@ -2193,7 +2184,23 @@ combinedScenarios.each { scenario ->
21932184
JobReport.Report.addReference(inputCoreCLRBuildName)
21942185
JobReport.Report.addReference(inputWindowTestsBuildName)
21952186
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)) {
21972204
buildFlow("""
21982205
// Build the input jobs in parallel
21992206
parallel (
@@ -2205,6 +2212,7 @@ parallel (
22052212
build(params + [CORECLR_BUILD: coreclrBuildJob.build.number,
22062213
CORECLR_WINDOWS_BUILD: windowsBuildJob.build.number], '${fullTestJobName}')
22072214
""")
2215+
}
22082216
}
22092217

22102218
setMachineAffinity(newFlowJob, os, architecture)

0 commit comments

Comments
 (0)