Skip to content

Commit fe2e4e4

Browse files
author
Nathan Ricci
authoredNov 19, 2022
[Test] Collapse mono runtime tests into single builds using global-build-job template (#62863)
Make mono desktop runs use global build template (removes patching coreclr step).
1 parent 0f3a88b commit fe2e4e4

8 files changed

+282
-35
lines changed
 

‎eng/pipelines/common/global-build-job.yml

+18-3
Original file line numberDiff line numberDiff line change
@@ -37,12 +37,12 @@ parameters:
3737
jobs:
3838
- template: /eng/common/templates/job/job.yml
3939
parameters:
40-
${{ if eq(parameters.hostedOs, '') }}:
40+
${{ if eq(parameters.hostedOs, '') }}:
4141
name: ${{ format('build_{0}{1}_{2}_{3}_{4}', parameters.osGroup, parameters.osSubgroup, parameters.archType, parameters.buildConfig, parameters.nameSuffix) }}
42-
displayName: ${{ format('Build {0}{1} {2} {3} {4}', parameters.osGroup, parameters.osSubgroup, parameters.archType, parameters.buildConfig, parameters.nameSuffix) }}
42+
displayName: ${{ format('Build {0}{1} {2} {3} {4} {5}', parameters.osGroup, parameters.osSubgroup, parameters.archType, parameters.buildConfig, parameters.nameSuffix, parameters.runtimeVariant) }}
4343
${{ if ne(parameters.hostedOs, '') }}:
4444
name: ${{ format('build_{0}{1}_{2}_{3}_{4}_{5}', parameters.osGroup, parameters.osSubgroup, parameters.archType, parameters.hostedOs, parameters.buildConfig, parameters.nameSuffix) }}
45-
displayName: ${{ format('Build {0}{1} {2} {3} {4} {5}', parameters.osGroup, parameters.osSubgroup, parameters.archType, parameters.hostedOs, parameters.buildConfig, parameters.nameSuffix) }}
45+
displayName: ${{ format('Build {0}{1} {2} {3} {4} {5} {6}', parameters.osGroup, parameters.osSubgroup, parameters.archType, parameters.hostedOs, parameters.buildConfig, parameters.nameSuffix, parameters.runtimeVariant) }}
4646
pool: ${{ parameters.pool }}
4747
container: ${{ parameters.container }}
4848
condition: and(succeeded(), ${{ parameters.condition }})
@@ -119,6 +119,21 @@ jobs:
119119
${{ if ne(parameters.isSourceBuild, true) }}:
120120
value: ''
121121

122+
- name: _monoAotBuildshCommand
123+
value: ''
124+
125+
- ${{ if eq(parameters.runtimeVariant, 'llvmaot') }}:
126+
- name: _monoAotBuildshCommand
127+
value: 'mono_aot'
128+
129+
- ${{ if eq(parameters.runtimeVariant, 'llvmfullaot') }}:
130+
- name: _monoAotBuildshCommand
131+
value: 'mono_fullaot'
132+
133+
- ${{ if eq(parameters.archType, 'arm64') }}:
134+
- name: _monoAotCrossCompileArg
135+
value: 'cross'
136+
122137
- ${{ each variable in parameters.variables }}:
123138
- ${{ variable }}
124139

‎eng/pipelines/common/templates/runtimes/wasm-runtime-and-send-to-helix.yml ‎eng/pipelines/common/templates/runtimes/build-runtime-tests-and-send-to-helix.yml

+37-3
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ parameters:
1313
stagedBuild: false
1414
displayNameArgs: ''
1515
runInUnloadableContext: false
16-
runtimeVariant: ''
16+
runtimeVariant: 'monointerpreter'
1717
variables: {}
1818
pool: ''
1919
dependsOn: []
@@ -26,11 +26,45 @@ parameters:
2626
gatherAssetManifests: false
2727
shouldContinueOnError: false
2828

29-
3029
steps:
31-
- script: $(Build.SourcesDirectory)/src/tests/build$(scriptExt) /p:RuntimeVariant=${{ parameters.runtimeVariant }} /p:LibrariesConfiguration=${{ parameters.buildConfig }} -ci -mono os Browser wasm $(buildConfigUpper)
30+
- script: $(Build.SourcesDirectory)/src/tests/build$(scriptExt) /p:RuntimeVariant=${{ parameters.runtimeVariant }} /p:LibrariesConfiguration=${{ parameters.buildConfig }} -mono -ci os ${{ parameters.osGroup }} ${{ parameters.archType }} $(buildConfigUpper)
3231
displayName: Build Tests
3332

33+
34+
# Build a Mono LLVM AOT cross-compiler for non-amd64 targets (in this case, just arm64)
35+
- ${{ if and(eq(parameters.runtimeFlavor, 'mono'), or(eq(parameters.runtimeVariant, 'llvmaot'), eq(parameters.runtimeVariant, 'llvmfullaot'))) }}:
36+
- ${{ if eq(parameters.archType, 'arm64') }}:
37+
- script: ./build.sh
38+
-subset mono
39+
-c ${{ parameters.buildConfig }}
40+
-arch ${{ parameters.archType }}
41+
/p:BuildMonoAotCrossCompiler=true
42+
/p:BuildMonoAotCrossCompilerOnly=true
43+
/p:MonoLibClang="/usr/lib/llvm-9/lib/libclang-9.so.1"
44+
/p:MonoAOTEnableLLVM=true
45+
/p:MonoAOTLLVMUseCxx11Abi=true
46+
/p:CrossBuild=true
47+
displayName: "Build Mono LLVM AOT cross compiler"
48+
49+
- ${{ if eq(parameters.archType, 'x64') }}:
50+
- ${{ if eq(parameters.runtimeVariant, 'llvmaot') }}:
51+
- script: $(Build.SourcesDirectory)/src/tests/build$(scriptExt) $(logRootNameArg)MonoAot mono_aot ${{ parameters.buildConfig }} ${{ parameters.archType }}
52+
displayName: "LLVM AOT compile CoreCLR tests"
53+
- ${{ if eq(parameters.runtimeVariant, 'llvmfullaot') }}:
54+
- script: $(Build.SourcesDirectory)/src/tests/build$(scriptExt) $(logRootNameArg)MonoAot mono_fullaot ${{ parameters.buildConfig }} ${{ parameters.archType }}
55+
displayName: "LLVM AOT compile CoreCLR tests"
56+
- ${{ if eq(parameters.archType, 'arm64') }}:
57+
- ${{ if eq(parameters.runtimeVariant, 'llvmaot') }}:
58+
- script: $(Build.SourcesDirectory)/src/tests/build$(scriptExt) $(logRootNameArg)MonoAot mono_aot ${{ parameters.buildConfig }} ${{ parameters.archType }} $(_monoAotCrossCompileArg) /p:RuntimeVariant=llvmfullaot -maxcpucount:2
59+
displayName: "LLVM AOT cross-compile CoreCLR tests"
60+
env:
61+
__MonoToolPrefix: aarch64-linux-gnu-
62+
- ${{ if eq(parameters.runtimeVariant, 'llvmfullaot') }}:
63+
- script: $(Build.SourcesDirectory)/src/tests/build$(scriptExt) $(logRootNameArg)MonoAot mono_fullaot ${{ parameters.buildConfig }} ${{ parameters.archType }} $(_monoAotCrossCompileArg) /p:RuntimeVariant=llvmfullaot -maxcpucount:2
64+
displayName: "LLVM AOT cross-compile CoreCLR tests"
65+
env:
66+
__MonoToolPrefix: aarch64-linux-gnu-
67+
3468
# Send tests to Helix
3569
- template: /eng/pipelines/common/templates/runtimes/send-to-helix-step.yml
3670
parameters:

‎eng/pipelines/common/templates/wasm-runtime-tests.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ jobs:
4747
or(
4848
eq(variables['alwaysRunVar'], true),
4949
eq(variables['isDefaultPipeline'], variables['shouldRunOnDefaultPipelines']))
50-
extraStepsTemplate: /eng/pipelines/common/templates/runtimes/wasm-runtime-and-send-to-helix.yml
50+
extraStepsTemplate: //eng/pipelines/common/templates/runtimes/build-runtime-tests-and-send-to-helix.yml
5151
extraStepsParameters:
5252
creator: dotnet-bot
5353
testRunNamePrefixSuffix: Mono_$(_BuildConfig)

‎eng/pipelines/runtime.yml

+87-28
Original file line numberDiff line numberDiff line change
@@ -1022,16 +1022,12 @@ extends:
10221022
eq(dependencies.evaluate_paths.outputs['SetPathVars_runtimetests.containsChange'], true),
10231023
eq(variables['isRollingBuild'], true))
10241024
1025-
#
1026-
# Mono CoreCLR runtime Test executions using live libraries in jit mode
1027-
# Only when Mono is changed
10281025
- template: /eng/pipelines/common/platform-matrix.yml
10291026
parameters:
10301027
jobTemplate: /eng/pipelines/common/templates/runtimes/run-test-job.yml
10311028
buildConfig: release
10321029
runtimeFlavor: mono
10331030
platforms:
1034-
- OSX_x64
10351031
- windows_x64
10361032
helixQueueGroup: pr
10371033
helixQueuesTemplate: /eng/pipelines/coreclr/templates/helix-queues-setup.yml
@@ -1046,78 +1042,141 @@ extends:
10461042
eq(dependencies.evaluate_paths.outputs['SetPathVars_runtimetests.containsChange'], true),
10471043
eq(variables['isRollingBuild'], true))
10481044
1045+
#
1046+
# Build the whole product using Mono and run runtime tests
1047+
#
1048+
- template: /eng/pipelines/common/platform-matrix.yml
1049+
parameters:
1050+
jobTemplate: /eng/pipelines/common/global-build-job.yml
1051+
helixQueuesTemplate: /eng/pipelines/coreclr/templates/helix-queues-setup.yml
1052+
buildConfig: Release
1053+
runtimeFlavor: mono
1054+
platforms:
1055+
- OSX_x64
1056+
variables:
1057+
- name: timeoutPerTestInMinutes
1058+
value: 60
1059+
- name: timeoutPerTestCollectionInMinutes
1060+
value: 180
1061+
jobParameters:
1062+
testGroup: innerloop
1063+
nameSuffix: AllSubsets_Mono_Minijit_RuntimeTests
1064+
runtimeVariant: minijit
1065+
buildArgs: -s mono+libs+clr.hosts+clr.iltools -c Release
1066+
timeoutInMinutes: 180
1067+
condition: >-
1068+
or(
1069+
eq(dependencies.evaluate_paths.outputs['SetPathVars_mono_excluding_wasm.containsChange'], true),
1070+
eq(dependencies.evaluate_paths.outputs['SetPathVars_runtimetests.containsChange'], true),
1071+
eq(variables['isRollingBuild'], true))
1072+
1073+
extraStepsTemplate: /eng/pipelines/common/templates/runtimes/build-runtime-tests-and-send-to-helix.yml
1074+
extraStepsParameters:
1075+
creator: dotnet-bot
1076+
testRunNamePrefixSuffix: Mono_Release
1077+
10491078
#
10501079
# Mono CoreCLR runtime Test executions using live libraries in interpreter mode
10511080
# Only when Mono is changed
1081+
10521082
- template: /eng/pipelines/common/platform-matrix.yml
10531083
parameters:
1054-
jobTemplate: /eng/pipelines/common/templates/runtimes/run-test-job.yml
1055-
buildConfig: release
1084+
jobTemplate: /eng/pipelines/common/global-build-job.yml
1085+
helixQueuesTemplate: /eng/pipelines/coreclr/templates/helix-queues-setup.yml
1086+
buildConfig: Release
10561087
runtimeFlavor: mono
10571088
platforms:
1058-
- OSX_x64
1059-
helixQueueGroup: pr
1060-
helixQueuesTemplate: /eng/pipelines/coreclr/templates/helix-queues-setup.yml
1089+
- OSX_x64
1090+
variables:
1091+
- name: timeoutPerTestInMinutes
1092+
value: 60
1093+
- name: timeoutPerTestCollectionInMinutes
1094+
value: 180
10611095
jobParameters:
10621096
testGroup: innerloop
1063-
liveLibrariesBuildConfig: ${{ variables.debugOnPrReleaseOnRolling }}
1064-
liveRuntimeBuildConfig: release
1097+
nameSuffix: AllSubsets_Mono_Interpreter_RuntimeTests
10651098
runtimeVariant: monointerpreter
1099+
buildArgs: -s mono+libs+clr.hosts+clr.iltools -c Release
1100+
timeoutInMinutes: 180
10661101
condition: >-
10671102
or(
10681103
eq(dependencies.evaluate_paths.outputs['SetPathVars_mono_excluding_wasm.containsChange'], true),
10691104
eq(dependencies.evaluate_paths.outputs['SetPathVars_runtimetests.containsChange'], true),
10701105
eq(variables['isRollingBuild'], true))
1106+
extraStepsTemplate: /eng/pipelines/common/templates/runtimes/build-runtime-tests-and-send-to-helix.yml
1107+
extraStepsParameters:
1108+
creator: dotnet-bot
1109+
testRunNamePrefixSuffix: Mono_Release
10711110
#
10721111
# Mono CoreCLR runtime Test executions using live libraries and LLVM AOT
10731112
# Only when Mono is changed
10741113
#
10751114
- template: /eng/pipelines/common/platform-matrix.yml
10761115
parameters:
1077-
jobTemplate: /eng/pipelines/common/templates/runtimes/run-test-job.yml
1078-
buildConfig: release
1116+
jobTemplate: /eng/pipelines/common/global-build-job.yml
1117+
helixQueuesTemplate: /eng/pipelines/coreclr/templates/helix-queues-setup.yml
1118+
buildConfig: Release
10791119
runtimeFlavor: mono
10801120
platforms:
1081-
- Linux_x64
1082-
# Disabled pending outcome of https://github.com/dotnet/runtime/issues/60234 investigation
1083-
#- Linux_arm64
1084-
helixQueueGroup: pr
1085-
helixQueuesTemplate: /eng/pipelines/coreclr/templates/helix-queues-setup.yml
1121+
- Linux_x64
1122+
# Disabled pending outcome of https://github.com/dotnet/runtime/issues/60234 investigation
1123+
#- Linux_arm64
1124+
variables:
1125+
- name: timeoutPerTestInMinutes
1126+
value: 60
1127+
- name: timeoutPerTestCollectionInMinutes
1128+
value: 180
10861129
jobParameters:
10871130
testGroup: innerloop
1088-
liveLibrariesBuildConfig: ${{ variables.debugOnPrReleaseOnRolling }}
1089-
liveRuntimeBuildConfig: release
1131+
nameSuffix: AllSubsets_Mono_LLVMAot_RuntimeTests
10901132
runtimeVariant: llvmaot
1133+
buildArgs: -s mono+libs+clr.hosts+clr.iltools -c Release /p:MonoEnableLLVM=true /p:MonoBundleLLVMOptimizer=true /p:MonoLLVMUseCxx11Abi=true
1134+
timeoutInMinutes: 180
1135+
10911136
condition: >-
10921137
or(
10931138
eq(dependencies.evaluate_paths.outputs['SetPathVars_mono_excluding_wasm.containsChange'], true),
10941139
eq(dependencies.evaluate_paths.outputs['SetPathVars_runtimetests.containsChange'], true),
10951140
eq(variables['isRollingBuild'], true))
1141+
extraStepsTemplate: /eng/pipelines/common/templates/runtimes/build-runtime-tests-and-send-to-helix.yml
1142+
extraStepsParameters:
1143+
creator: dotnet-bot
1144+
testRunNamePrefixSuffix: Mono_Release
10961145

10971146
#
10981147
# Mono CoreCLR runtime Test executions using live libraries and LLVM Full AOT
10991148
# Only when Mono is changed
11001149
#
11011150
- template: /eng/pipelines/common/platform-matrix.yml
11021151
parameters:
1103-
jobTemplate: /eng/pipelines/common/templates/runtimes/run-test-job.yml
1104-
buildConfig: release
1152+
jobTemplate: /eng/pipelines/common/global-build-job.yml
1153+
helixQueuesTemplate: /eng/pipelines/coreclr/templates/helix-queues-setup.yml
1154+
buildConfig: Release
11051155
runtimeFlavor: mono
11061156
platforms:
1107-
- Linux_x64
1108-
- Linux_arm64
1109-
helixQueueGroup: pr
1110-
helixQueuesTemplate: /eng/pipelines/coreclr/templates/helix-queues-setup.yml
1157+
- Linux_x64
1158+
- Linux_arm64
1159+
variables:
1160+
- name: timeoutPerTestInMinutes
1161+
value: 60
1162+
- name: timeoutPerTestCollectionInMinutes
1163+
value: 180
11111164
jobParameters:
11121165
testGroup: innerloop
1113-
liveLibrariesBuildConfig: ${{ variables.debugOnPrReleaseOnRolling }}
1114-
liveRuntimeBuildConfig: release
1166+
nameSuffix: AllSubsets_Mono_LLVMFullAot_RuntimeTests
11151167
runtimeVariant: llvmfullaot
1168+
buildArgs: -s mono+libs+clr.hosts+clr.iltools -c Release /p:MonoEnableLLVM=true /p:MonoBundleLLVMOptimizer=true /p:MonoLLVMUseCxx11Abi=true
1169+
timeoutInMinutes: 300
1170+
11161171
condition: >-
11171172
or(
11181173
eq(dependencies.evaluate_paths.outputs['SetPathVars_mono_excluding_wasm.containsChange'], true),
11191174
eq(dependencies.evaluate_paths.outputs['SetPathVars_runtimetests.containsChange'], true),
11201175
eq(variables['isRollingBuild'], true))
1176+
extraStepsTemplate: /eng/pipelines/common/templates/runtimes/build-runtime-tests-and-send-to-helix.yml
1177+
extraStepsParameters:
1178+
creator: dotnet-bot
1179+
testRunNamePrefixSuffix: Mono_Release
11211180

11221181
#
11231182
# Libraries Release Test Execution against a release mono runtime.

‎src/tests/Common/helixpublishwitharcade.proj

+2
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,7 @@
115115
<Message Text="DotNetCliVersion: $(DotNetCliVersion)" Importance="High" />
116116
<Message Text="DotNetCliPackageType: $(DotNetCliPackageType)" Importance="High" />
117117
<Message Text="HelixRuntimeRid: $(HelixRuntimeRid)" Importance="High" />
118+
<Message Importance="High" Text="TimeoutPerTestInMinutes: $(TimeoutPerTestInMinutes)" />
118119
<Error Condition="'$(_Scenarios)' == ''" Text="_Scenarios not set" />
119120

120121
<ItemGroup>
@@ -548,6 +549,7 @@
548549
DestinationFile="$(MergedPayloadsRootDirectory)\%(MergedPayloads.PayloadGroup).zip" />
549550
</Target>
550551

552+
551553
<PropertyGroup>
552554
<EnableAzurePipelinesReporter>$(PublishTestResults)</EnableAzurePipelinesReporter>
553555
<EnableAzurePipelinesReporter Condition=" '$(EnableAzurePipelinesReporter)' == '' ">false</EnableAzurePipelinesReporter>

‎src/tests/Directory.Build.props

+2
Original file line numberDiff line numberDiff line change
@@ -83,9 +83,11 @@
8383

8484
<MonoAot>false</MonoAot>
8585
<MonoAot Condition="'$(__MonoAot)' == '1'">true</MonoAot>
86+
<RuntimeVariant Condition="'$(__MonoAot)' == '1'">llvmaot</RuntimeVariant>
8687

8788
<MonoFullAot>false</MonoFullAot>
8889
<MonoFullAot Condition="'$(__MonoFullAot)' == '1'">true</MonoFullAot>
90+
<RuntimeVariant Condition="'$(__MonoFullAot)' == '1'">llvmfullaot</RuntimeVariant>
8991

9092
<MonoBinDir>$(__MonoBinDir)</MonoBinDir>
9193
</PropertyGroup>

‎src/tests/Directory.Build.targets

+1
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,7 @@
9696
<_WillCLRTestProjectBuild Condition="'$(CLRTestBuildAllTargets)' != 'allTargets' And '$(CLRTestTargetUnsupported)' == 'true'">false</_WillCLRTestProjectBuild>
9797
<_WillCLRTestProjectBuild Condition="'$(DisableProjectBuild)' == 'true'">false</_WillCLRTestProjectBuild>
9898
<_WillCLRTestProjectBuild Condition="'$(NativeAotIncompatible)' == 'true' and '$(TestBuildMode)' == 'nativeaot'">false</_WillCLRTestProjectBuild>
99+
<_WillCLRTestProjectBuild Condition="'$(RuntimeFlavor)' == 'mono' And '$(AlwaysUseCrossgen2)' == 'true'">false</_WillCLRTestProjectBuild>
99100
</PropertyGroup>
100101
<PropertyGroup>
101102
<_CopyNativeProjectBinaries Condition="'$(__CopyNativeTestBinaries)' != '1'">$(__CopyNativeProjectsAfterCombinedTestBuild)</_CopyNativeProjectBinaries>

0 commit comments

Comments
 (0)