Skip to content

Commit

Permalink
[Test] Collapse mono runtime tests into single builds using global-bu…
Browse files Browse the repository at this point in the history
…ild-job template (dotnet#62863)

Make mono desktop runs use global build template (removes patching coreclr step).
  • Loading branch information
Nathan Ricci authored Nov 19, 2022
1 parent 0f3a88b commit fe2e4e4
Showing 8 changed files with 282 additions and 35 deletions.
21 changes: 18 additions & 3 deletions eng/pipelines/common/global-build-job.yml
Original file line number Diff line number Diff line change
@@ -37,12 +37,12 @@ parameters:
jobs:
- template: /eng/common/templates/job/job.yml
parameters:
${{ if eq(parameters.hostedOs, '') }}:
${{ if eq(parameters.hostedOs, '') }}:
name: ${{ format('build_{0}{1}_{2}_{3}_{4}', parameters.osGroup, parameters.osSubgroup, parameters.archType, parameters.buildConfig, parameters.nameSuffix) }}
displayName: ${{ format('Build {0}{1} {2} {3} {4}', parameters.osGroup, parameters.osSubgroup, parameters.archType, parameters.buildConfig, parameters.nameSuffix) }}
displayName: ${{ format('Build {0}{1} {2} {3} {4} {5}', parameters.osGroup, parameters.osSubgroup, parameters.archType, parameters.buildConfig, parameters.nameSuffix, parameters.runtimeVariant) }}
${{ if ne(parameters.hostedOs, '') }}:
name: ${{ format('build_{0}{1}_{2}_{3}_{4}_{5}', parameters.osGroup, parameters.osSubgroup, parameters.archType, parameters.hostedOs, parameters.buildConfig, parameters.nameSuffix) }}
displayName: ${{ format('Build {0}{1} {2} {3} {4} {5}', parameters.osGroup, parameters.osSubgroup, parameters.archType, parameters.hostedOs, parameters.buildConfig, parameters.nameSuffix) }}
displayName: ${{ format('Build {0}{1} {2} {3} {4} {5} {6}', parameters.osGroup, parameters.osSubgroup, parameters.archType, parameters.hostedOs, parameters.buildConfig, parameters.nameSuffix, parameters.runtimeVariant) }}
pool: ${{ parameters.pool }}
container: ${{ parameters.container }}
condition: and(succeeded(), ${{ parameters.condition }})
@@ -119,6 +119,21 @@ jobs:
${{ if ne(parameters.isSourceBuild, true) }}:
value: ''

- name: _monoAotBuildshCommand
value: ''

- ${{ if eq(parameters.runtimeVariant, 'llvmaot') }}:
- name: _monoAotBuildshCommand
value: 'mono_aot'

- ${{ if eq(parameters.runtimeVariant, 'llvmfullaot') }}:
- name: _monoAotBuildshCommand
value: 'mono_fullaot'

- ${{ if eq(parameters.archType, 'arm64') }}:
- name: _monoAotCrossCompileArg
value: 'cross'

- ${{ each variable in parameters.variables }}:
- ${{ variable }}

Original file line number Diff line number Diff line change
@@ -13,7 +13,7 @@ parameters:
stagedBuild: false
displayNameArgs: ''
runInUnloadableContext: false
runtimeVariant: ''
runtimeVariant: 'monointerpreter'
variables: {}
pool: ''
dependsOn: []
@@ -26,11 +26,45 @@ parameters:
gatherAssetManifests: false
shouldContinueOnError: false


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


# Build a Mono LLVM AOT cross-compiler for non-amd64 targets (in this case, just arm64)
- ${{ if and(eq(parameters.runtimeFlavor, 'mono'), or(eq(parameters.runtimeVariant, 'llvmaot'), eq(parameters.runtimeVariant, 'llvmfullaot'))) }}:
- ${{ if eq(parameters.archType, 'arm64') }}:
- script: ./build.sh
-subset mono
-c ${{ parameters.buildConfig }}
-arch ${{ parameters.archType }}
/p:BuildMonoAotCrossCompiler=true
/p:BuildMonoAotCrossCompilerOnly=true
/p:MonoLibClang="/usr/lib/llvm-9/lib/libclang-9.so.1"
/p:MonoAOTEnableLLVM=true
/p:MonoAOTLLVMUseCxx11Abi=true
/p:CrossBuild=true
displayName: "Build Mono LLVM AOT cross compiler"

- ${{ if eq(parameters.archType, 'x64') }}:
- ${{ if eq(parameters.runtimeVariant, 'llvmaot') }}:
- script: $(Build.SourcesDirectory)/src/tests/build$(scriptExt) $(logRootNameArg)MonoAot mono_aot ${{ parameters.buildConfig }} ${{ parameters.archType }}
displayName: "LLVM AOT compile CoreCLR tests"
- ${{ if eq(parameters.runtimeVariant, 'llvmfullaot') }}:
- script: $(Build.SourcesDirectory)/src/tests/build$(scriptExt) $(logRootNameArg)MonoAot mono_fullaot ${{ parameters.buildConfig }} ${{ parameters.archType }}
displayName: "LLVM AOT compile CoreCLR tests"
- ${{ if eq(parameters.archType, 'arm64') }}:
- ${{ if eq(parameters.runtimeVariant, 'llvmaot') }}:
- script: $(Build.SourcesDirectory)/src/tests/build$(scriptExt) $(logRootNameArg)MonoAot mono_aot ${{ parameters.buildConfig }} ${{ parameters.archType }} $(_monoAotCrossCompileArg) /p:RuntimeVariant=llvmfullaot -maxcpucount:2
displayName: "LLVM AOT cross-compile CoreCLR tests"
env:
__MonoToolPrefix: aarch64-linux-gnu-
- ${{ if eq(parameters.runtimeVariant, 'llvmfullaot') }}:
- script: $(Build.SourcesDirectory)/src/tests/build$(scriptExt) $(logRootNameArg)MonoAot mono_fullaot ${{ parameters.buildConfig }} ${{ parameters.archType }} $(_monoAotCrossCompileArg) /p:RuntimeVariant=llvmfullaot -maxcpucount:2
displayName: "LLVM AOT cross-compile CoreCLR tests"
env:
__MonoToolPrefix: aarch64-linux-gnu-

# Send tests to Helix
- template: /eng/pipelines/common/templates/runtimes/send-to-helix-step.yml
parameters:
2 changes: 1 addition & 1 deletion eng/pipelines/common/templates/wasm-runtime-tests.yml
Original file line number Diff line number Diff line change
@@ -47,7 +47,7 @@ jobs:
or(
eq(variables['alwaysRunVar'], true),
eq(variables['isDefaultPipeline'], variables['shouldRunOnDefaultPipelines']))
extraStepsTemplate: /eng/pipelines/common/templates/runtimes/wasm-runtime-and-send-to-helix.yml
extraStepsTemplate: //eng/pipelines/common/templates/runtimes/build-runtime-tests-and-send-to-helix.yml
extraStepsParameters:
creator: dotnet-bot
testRunNamePrefixSuffix: Mono_$(_BuildConfig)
115 changes: 87 additions & 28 deletions eng/pipelines/runtime.yml
Original file line number Diff line number Diff line change
@@ -1022,16 +1022,12 @@ extends:
eq(dependencies.evaluate_paths.outputs['SetPathVars_runtimetests.containsChange'], true),
eq(variables['isRollingBuild'], true))
#
# Mono CoreCLR runtime Test executions using live libraries in jit mode
# Only when Mono is changed
- template: /eng/pipelines/common/platform-matrix.yml
parameters:
jobTemplate: /eng/pipelines/common/templates/runtimes/run-test-job.yml
buildConfig: release
runtimeFlavor: mono
platforms:
- OSX_x64
- windows_x64
helixQueueGroup: pr
helixQueuesTemplate: /eng/pipelines/coreclr/templates/helix-queues-setup.yml
@@ -1046,78 +1042,141 @@ extends:
eq(dependencies.evaluate_paths.outputs['SetPathVars_runtimetests.containsChange'], true),
eq(variables['isRollingBuild'], true))
#
# Build the whole product using Mono and run runtime tests
#
- template: /eng/pipelines/common/platform-matrix.yml
parameters:
jobTemplate: /eng/pipelines/common/global-build-job.yml
helixQueuesTemplate: /eng/pipelines/coreclr/templates/helix-queues-setup.yml
buildConfig: Release
runtimeFlavor: mono
platforms:
- OSX_x64
variables:
- name: timeoutPerTestInMinutes
value: 60
- name: timeoutPerTestCollectionInMinutes
value: 180
jobParameters:
testGroup: innerloop
nameSuffix: AllSubsets_Mono_Minijit_RuntimeTests
runtimeVariant: minijit
buildArgs: -s mono+libs+clr.hosts+clr.iltools -c Release
timeoutInMinutes: 180
condition: >-
or(
eq(dependencies.evaluate_paths.outputs['SetPathVars_mono_excluding_wasm.containsChange'], true),
eq(dependencies.evaluate_paths.outputs['SetPathVars_runtimetests.containsChange'], true),
eq(variables['isRollingBuild'], true))
extraStepsTemplate: /eng/pipelines/common/templates/runtimes/build-runtime-tests-and-send-to-helix.yml
extraStepsParameters:
creator: dotnet-bot
testRunNamePrefixSuffix: Mono_Release

#
# Mono CoreCLR runtime Test executions using live libraries in interpreter mode
# Only when Mono is changed

- template: /eng/pipelines/common/platform-matrix.yml
parameters:
jobTemplate: /eng/pipelines/common/templates/runtimes/run-test-job.yml
buildConfig: release
jobTemplate: /eng/pipelines/common/global-build-job.yml
helixQueuesTemplate: /eng/pipelines/coreclr/templates/helix-queues-setup.yml
buildConfig: Release
runtimeFlavor: mono
platforms:
- OSX_x64
helixQueueGroup: pr
helixQueuesTemplate: /eng/pipelines/coreclr/templates/helix-queues-setup.yml
- OSX_x64
variables:
- name: timeoutPerTestInMinutes
value: 60
- name: timeoutPerTestCollectionInMinutes
value: 180
jobParameters:
testGroup: innerloop
liveLibrariesBuildConfig: ${{ variables.debugOnPrReleaseOnRolling }}
liveRuntimeBuildConfig: release
nameSuffix: AllSubsets_Mono_Interpreter_RuntimeTests
runtimeVariant: monointerpreter
buildArgs: -s mono+libs+clr.hosts+clr.iltools -c Release
timeoutInMinutes: 180
condition: >-
or(
eq(dependencies.evaluate_paths.outputs['SetPathVars_mono_excluding_wasm.containsChange'], true),
eq(dependencies.evaluate_paths.outputs['SetPathVars_runtimetests.containsChange'], true),
eq(variables['isRollingBuild'], true))
extraStepsTemplate: /eng/pipelines/common/templates/runtimes/build-runtime-tests-and-send-to-helix.yml
extraStepsParameters:
creator: dotnet-bot
testRunNamePrefixSuffix: Mono_Release
#
# Mono CoreCLR runtime Test executions using live libraries and LLVM AOT
# Only when Mono is changed
#
- template: /eng/pipelines/common/platform-matrix.yml
parameters:
jobTemplate: /eng/pipelines/common/templates/runtimes/run-test-job.yml
buildConfig: release
jobTemplate: /eng/pipelines/common/global-build-job.yml
helixQueuesTemplate: /eng/pipelines/coreclr/templates/helix-queues-setup.yml
buildConfig: Release
runtimeFlavor: mono
platforms:
- Linux_x64
# Disabled pending outcome of https://github.com/dotnet/runtime/issues/60234 investigation
#- Linux_arm64
helixQueueGroup: pr
helixQueuesTemplate: /eng/pipelines/coreclr/templates/helix-queues-setup.yml
- Linux_x64
# Disabled pending outcome of https://github.com/dotnet/runtime/issues/60234 investigation
#- Linux_arm64
variables:
- name: timeoutPerTestInMinutes
value: 60
- name: timeoutPerTestCollectionInMinutes
value: 180
jobParameters:
testGroup: innerloop
liveLibrariesBuildConfig: ${{ variables.debugOnPrReleaseOnRolling }}
liveRuntimeBuildConfig: release
nameSuffix: AllSubsets_Mono_LLVMAot_RuntimeTests
runtimeVariant: llvmaot
buildArgs: -s mono+libs+clr.hosts+clr.iltools -c Release /p:MonoEnableLLVM=true /p:MonoBundleLLVMOptimizer=true /p:MonoLLVMUseCxx11Abi=true
timeoutInMinutes: 180

condition: >-
or(
eq(dependencies.evaluate_paths.outputs['SetPathVars_mono_excluding_wasm.containsChange'], true),
eq(dependencies.evaluate_paths.outputs['SetPathVars_runtimetests.containsChange'], true),
eq(variables['isRollingBuild'], true))
extraStepsTemplate: /eng/pipelines/common/templates/runtimes/build-runtime-tests-and-send-to-helix.yml
extraStepsParameters:
creator: dotnet-bot
testRunNamePrefixSuffix: Mono_Release

#
# Mono CoreCLR runtime Test executions using live libraries and LLVM Full AOT
# Only when Mono is changed
#
- template: /eng/pipelines/common/platform-matrix.yml
parameters:
jobTemplate: /eng/pipelines/common/templates/runtimes/run-test-job.yml
buildConfig: release
jobTemplate: /eng/pipelines/common/global-build-job.yml
helixQueuesTemplate: /eng/pipelines/coreclr/templates/helix-queues-setup.yml
buildConfig: Release
runtimeFlavor: mono
platforms:
- Linux_x64
- Linux_arm64
helixQueueGroup: pr
helixQueuesTemplate: /eng/pipelines/coreclr/templates/helix-queues-setup.yml
- Linux_x64
- Linux_arm64
variables:
- name: timeoutPerTestInMinutes
value: 60
- name: timeoutPerTestCollectionInMinutes
value: 180
jobParameters:
testGroup: innerloop
liveLibrariesBuildConfig: ${{ variables.debugOnPrReleaseOnRolling }}
liveRuntimeBuildConfig: release
nameSuffix: AllSubsets_Mono_LLVMFullAot_RuntimeTests
runtimeVariant: llvmfullaot
buildArgs: -s mono+libs+clr.hosts+clr.iltools -c Release /p:MonoEnableLLVM=true /p:MonoBundleLLVMOptimizer=true /p:MonoLLVMUseCxx11Abi=true
timeoutInMinutes: 300

condition: >-
or(
eq(dependencies.evaluate_paths.outputs['SetPathVars_mono_excluding_wasm.containsChange'], true),
eq(dependencies.evaluate_paths.outputs['SetPathVars_runtimetests.containsChange'], true),
eq(variables['isRollingBuild'], true))
extraStepsTemplate: /eng/pipelines/common/templates/runtimes/build-runtime-tests-and-send-to-helix.yml
extraStepsParameters:
creator: dotnet-bot
testRunNamePrefixSuffix: Mono_Release

#
# Libraries Release Test Execution against a release mono runtime.
2 changes: 2 additions & 0 deletions src/tests/Common/helixpublishwitharcade.proj
Original file line number Diff line number Diff line change
@@ -115,6 +115,7 @@
<Message Text="DotNetCliVersion: $(DotNetCliVersion)" Importance="High" />
<Message Text="DotNetCliPackageType: $(DotNetCliPackageType)" Importance="High" />
<Message Text="HelixRuntimeRid: $(HelixRuntimeRid)" Importance="High" />
<Message Importance="High" Text="TimeoutPerTestInMinutes: $(TimeoutPerTestInMinutes)" />
<Error Condition="'$(_Scenarios)' == ''" Text="_Scenarios not set" />

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


<PropertyGroup>
<EnableAzurePipelinesReporter>$(PublishTestResults)</EnableAzurePipelinesReporter>
<EnableAzurePipelinesReporter Condition=" '$(EnableAzurePipelinesReporter)' == '' ">false</EnableAzurePipelinesReporter>
2 changes: 2 additions & 0 deletions src/tests/Directory.Build.props
Original file line number Diff line number Diff line change
@@ -83,9 +83,11 @@

<MonoAot>false</MonoAot>
<MonoAot Condition="'$(__MonoAot)' == '1'">true</MonoAot>
<RuntimeVariant Condition="'$(__MonoAot)' == '1'">llvmaot</RuntimeVariant>

<MonoFullAot>false</MonoFullAot>
<MonoFullAot Condition="'$(__MonoFullAot)' == '1'">true</MonoFullAot>
<RuntimeVariant Condition="'$(__MonoFullAot)' == '1'">llvmfullaot</RuntimeVariant>

<MonoBinDir>$(__MonoBinDir)</MonoBinDir>
</PropertyGroup>
1 change: 1 addition & 0 deletions src/tests/Directory.Build.targets
Original file line number Diff line number Diff line change
@@ -96,6 +96,7 @@
<_WillCLRTestProjectBuild Condition="'$(CLRTestBuildAllTargets)' != 'allTargets' And '$(CLRTestTargetUnsupported)' == 'true'">false</_WillCLRTestProjectBuild>
<_WillCLRTestProjectBuild Condition="'$(DisableProjectBuild)' == 'true'">false</_WillCLRTestProjectBuild>
<_WillCLRTestProjectBuild Condition="'$(NativeAotIncompatible)' == 'true' and '$(TestBuildMode)' == 'nativeaot'">false</_WillCLRTestProjectBuild>
<_WillCLRTestProjectBuild Condition="'$(RuntimeFlavor)' == 'mono' And '$(AlwaysUseCrossgen2)' == 'true'">false</_WillCLRTestProjectBuild>
</PropertyGroup>
<PropertyGroup>
<_CopyNativeProjectBinaries Condition="'$(__CopyNativeTestBinaries)' != '1'">$(__CopyNativeProjectsAfterCombinedTestBuild)</_CopyNativeProjectBinaries>
Loading

0 comments on commit fe2e4e4

Please sign in to comment.