Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Run tests under CoreCLR #9863

Draft
wants to merge 39 commits into
base: main
Choose a base branch
from
Draft
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
92eca07
Enable the test
grendello Feb 28, 2025
74ff868
Let's see if I got it right :D
grendello Feb 28, 2025
644161c
Fix typos
grendello Feb 28, 2025
e23a870
Fix number two
grendello Feb 28, 2025
3c3c92a
Fix three
grendello Feb 28, 2025
d666811
Let's see how this works
grendello Mar 4, 2025
d68c00a
How about this then
grendello Mar 4, 2025
cbb48c3
Let's see what, if anything, is fixed by this
grendello Mar 5, 2025
f3f5d77
Try to prevent the SetupOSSpecificPropertyes from running when not ne…
grendello Mar 6, 2025
d554791
Does this change anything?
grendello Mar 6, 2025
b219554
Tweaks
grendello Mar 6, 2025
bf432b8
Fix locations of native *.include files
grendello Mar 7, 2025
b1c0044
Update CoreCLR packages in the workload manifest
grendello Mar 7, 2025
2563983
Use `android-arm64`, since it's supported by all the runtimes
grendello Mar 10, 2025
92fac46
CoreCLR doesn't support all RIDs
grendello Mar 10, 2025
03a415d
Switch to `arm64-v8a`, because all runtimes support it
grendello Mar 10, 2025
850d72d
Interpreter isn't supported by CoreCLR
grendello Mar 10, 2025
0e14cdb
Ignore test for unsupported ABIs
grendello Mar 10, 2025
a59e2b1
CoreCLR doesn't support 32-bit ABIs
grendello Mar 10, 2025
b34da37
CoreCLR doesn't support MonoVM-style AOT
grendello Mar 10, 2025
bb59b86
Use only 64-bit ABIs
grendello Mar 10, 2025
bdda54f
Don't do that, we will ignore the entire category eventually
grendello Mar 10, 2025
659b1a6
Switch more tests to 64-bit ABIs
grendello Mar 10, 2025
3053bfe
Let's see what this changes
grendello Mar 11, 2025
fec998d
Address feedback
grendello Mar 10, 2025
68670a5
Address feedback
grendello Mar 11, 2025
b69aa77
Hopefully fix a handful of tests
grendello Mar 11, 2025
ed4bd43
Another portion of fixes, hopefully
grendello Mar 11, 2025
fe6925d
Fix artifact names + some more test fixes
grendello Mar 12, 2025
01149f0
More fixes and fixlets
grendello Mar 12, 2025
94ec4de
A few more steps forward
grendello Mar 13, 2025
be46cbc
Let's see again...
grendello Mar 13, 2025
ded097e
This causes too many problems, alas
grendello Mar 13, 2025
5441eb2
Let's try to see what's going on there...
grendello Mar 17, 2025
0194c8e
A bit more printf debugging
grendello Mar 17, 2025
743e321
Let's see if this fixes DotNetPublish for API 35 on CoreCLR
grendello Mar 17, 2025
d859b56
MonoVM vs CoreCLR ApplicationConfig
grendello Mar 17, 2025
863707d
Maybe that works?
grendello Mar 18, 2025
b5e9376
Fix after rebase
grendello Mar 25, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions build-tools/automation/azure-pipelines.yaml
Original file line number Diff line number Diff line change
@@ -103,12 +103,31 @@ extends:
macTestAgentsUseCleanImages: ${{ parameters.macTestAgentsUseCleanImages }}

- template: /build-tools/automation/yaml-templates/stage-linux-tests.yaml@self
parameters:
runtimeName: "MonoVM"

- template: /build-tools/automation/yaml-templates/stage-msbuild-tests.yaml@self
parameters:
runtimeName: "MonoVM"

- template: /build-tools/automation/yaml-templates/stage-msbuild-emulator-tests.yaml@self
parameters:
usesCleanImages: ${{ parameters.macTestAgentsUseCleanImages }}
runtimeName: "MonoVM"

- template: /build-tools/automation/yaml-templates/stage-linux-tests.yaml@self
parameters:
runtimeName: "CoreCLR"

- template: /build-tools/automation/yaml-templates/stage-msbuild-tests.yaml@self
parameters:
runtimeName: "CoreCLR"
testFilter: $(CoreCLRExcludedNunitCategories)

- template: /build-tools/automation/yaml-templates/stage-msbuild-emulator-tests.yaml@self
parameters:
usesCleanImages: ${{ parameters.macTestAgentsUseCleanImages }}
runtimeName: "CoreCLR"

- stage: maui_tests
displayName: MAUI Tests
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
parameters:
testOS: '' # 'macOS' or 'Windows'
runtimeName: '' # MonoVM or CoreCLR
jobName: '' # Name of the job
jobDisplayName: '' # Display name of the job
agentCount: 1 # Number of build agents to run in parallel
@@ -42,6 +43,10 @@ jobs:
repositoryAlias: ${{ parameters.repositoryAlias }}
commit: ${{ parameters.commit }}

- template: /build-tools/automation/yaml-templates/select-test-runtime.yaml
parameters:
runtimeName: ${{ parameters.runtimeName }}

- task: DownloadPipelineArtifact@2
inputs:
artifactName: $(TestAssembliesArtifactName)
@@ -51,13 +56,13 @@ jobs:
parameters:
testAssembly: ${{ parameters.xaSourcePath }}/bin/Test$(XA.Build.Configuration)/$(DotNetStableTargetFramework)/Xamarin.Android.Build.Tests.dll
testFilter: ${{ parameters.testFilter }}
testRunTitle: Xamarin.Android.Build.Tests - ${{ parameters.testOS }}
testRunTitle: Xamarin.Android.Build.Tests - ${{ parameters.testOS }} (${{ parameters.runtimeName }})
retryFailedTests: false
xaSourcePath: ${{ parameters.xaSourcePath }}

- template: /build-tools/automation/yaml-templates/upload-results.yaml
parameters:
artifactName: Test Results - MSBuild - ${{ parameters.testOS }}-$(System.JobPositionInPhase)
artifactName: Test Results - MSBuild - ${{ parameters.testOS }}-${{ parameters.runtimeName }}-$(System.JobPositionInPhase)
xaSourcePath: ${{ parameters.xaSourcePath }}
use1ESTemplate: ${{ parameters.use1ESTemplate }}

14 changes: 14 additions & 0 deletions build-tools/automation/yaml-templates/select-test-runtime.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
parameters:
runtimeName: ''

steps:
- pwsh: |
Write-Host "Selecting target runtime: "${{ parameters.runtimeName }}""
if ("${{ parameters.runtimeName }}" -eq "CoreCLR") {
$useMonoRuntime="false"
} else {
$useMonoRuntime="true"
}

Write-Host "##vso[task.setvariable variable=USE_MONO_RUNTIME]$useMonoRuntime"
displayName: select target runtime (MonoVM or CoreCLR)
30 changes: 20 additions & 10 deletions build-tools/automation/yaml-templates/stage-linux-tests.yaml
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
# Runs smoke tests on Linux packages.
parameters:
runtimeName: ''

stages:
- stage: linux_tests
displayName: Linux Tests
- stage: linux_tests_${{ parameters.runtimeName }}
displayName: Linux Tests (${{ parameters.runtimeName }})
dependsOn:
- mac_build
- linux_build
jobs:
# Check - "Xamarin.Android (Linux Tests Linux > Tests > MSBuild)"
- job: linux_tests_smoke_1
displayName: Linux > Tests > MSBuild 1
displayName: Linux > Tests > MSBuild 1 (${{ parameters.runtimeName }})
pool:
name: MAUI-1ESPT
image: $(LinuxPoolImage1ESPT)
@@ -20,26 +22,30 @@ stages:
steps:
- template: /build-tools/automation/yaml-templates/setup-test-environment.yaml

- template: /build-tools/automation/yaml-templates/select-test-runtime.yaml
parameters:
runtimeName: ${{ parameters.runtimeName }}

- task: DownloadPipelineArtifact@2
inputs:
artifactName: $(TestAssembliesArtifactName)
downloadPath: $(System.DefaultWorkingDirectory)/bin/Test$(XA.Build.Configuration)

- template: /build-tools/automation/yaml-templates/run-nunit-tests.yaml
parameters:
testRunTitle: Xamarin.Android.Build.Tests - Linux BuildTest
testRunTitle: Xamarin.Android.Build.Tests - Linux BuildTest (${{ parameters.runtimeName }})
testAssembly: $(System.DefaultWorkingDirectory)/bin/Test$(XA.Build.Configuration)/$(DotNetStableTargetFramework)/Xamarin.Android.Build.Tests.dll
dotNetTestExtraArgs: --filter "Name = BuildTest"

- template: /build-tools/automation/yaml-templates/upload-results.yaml
parameters:
configuration: $(XA.Build.Configuration)
artifactName: Test Results - MSBuild - Linux 1
artifactName: Test Results - MSBuild - Linux 1 - ${{ parameters.runtimeName }}

- template: /build-tools/automation/yaml-templates/fail-on-issue.yaml

- job: linux_tests_smoke_2
displayName: Linux > Tests > MSBuild 2
displayName: Linux > Tests > MSBuild 2 (${{ parameters.runtimeName }})
pool:
name: MAUI-1ESPT
image: $(LinuxPoolImage1ESPT)
@@ -50,26 +56,30 @@ stages:
steps:
- template: /build-tools/automation/yaml-templates/setup-test-environment.yaml

- template: /build-tools/automation/yaml-templates/select-test-runtime.yaml
parameters:
runtimeName: ${{ parameters.runtimeName }}

- task: DownloadPipelineArtifact@2
inputs:
artifactName: $(TestAssembliesArtifactName)
downloadPath: $(System.DefaultWorkingDirectory)/bin/Test$(XA.Build.Configuration)

- template: /build-tools/automation/yaml-templates/run-nunit-tests.yaml
parameters:
testRunTitle: Xamarin.Android.Build.Tests - Linux PackagingTest
testRunTitle: Xamarin.Android.Build.Tests - Linux PackagingTest (${{ parameters.runtimeName }})
testAssembly: $(System.DefaultWorkingDirectory)/bin/Test$(XA.Build.Configuration)/$(DotNetStableTargetFramework)/Xamarin.Android.Build.Tests.dll
dotNetTestExtraArgs: --filter "Name = PackagingTest"

- template: /build-tools/automation/yaml-templates/run-nunit-tests.yaml
parameters:
testRunTitle: Xamarin.Android.Build.Tests - Linux XASdkTests
testRunTitle: Xamarin.Android.Build.Tests - Linux XASdkTests (${{ parameters.runtimeName }})
testAssembly: $(System.DefaultWorkingDirectory)/bin/Test$(XA.Build.Configuration)/$(DotNetStableTargetFramework)/Xamarin.Android.Build.Tests.dll
dotNetTestExtraArgs: --filter "Name = XASdkTests & Name != XamarinLegacySdk"

- template: /build-tools/automation/yaml-templates/run-nunit-tests.yaml
parameters:
testRunTitle: Xamarin.Android.Build.Tests - Linux AndroidDependenciesTests
testRunTitle: Xamarin.Android.Build.Tests - Linux AndroidDependenciesTests (${{ parameters.runtimeName }})
testAssembly: $(System.DefaultWorkingDirectory)/bin/Test$(XA.Build.Configuration)/$(DotNetStableTargetFramework)/Xamarin.Android.Build.Tests.dll
dotNetTestExtraArgs: --filter "Name = AndroidDependenciesTests"

@@ -82,6 +92,6 @@ stages:
- template: /build-tools/automation/yaml-templates/upload-results.yaml
parameters:
configuration: $(XA.Build.Configuration)
artifactName: Test Results - MSBuild - Linux 2
artifactName: Test Results - MSBuild - Linux 2 - ${{ parameters.runtimeName }}

- template: /build-tools/automation/yaml-templates/fail-on-issue.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Runs MSBuild tests against a device running on macOS

parameters:
runtimeName: ''
stageName: msbuilddevice_tests
job_name: 'mac_dotnetdevice_tests'
dependsOn: mac_build
@@ -16,8 +17,8 @@ parameters:
use1ESTemplate: true

stages:
- stage: ${{ parameters.stageName }}
displayName: ${{ parameters.stagePrefix }}MSBuild Emulator Tests
- stage: ${{ parameters.stageName }}_${{ parameters.runtimeName }}
displayName: ${{ parameters.stagePrefix }}MSBuild Emulator Tests (${{ parameters.runtimeName }})
dependsOn: ${{ parameters.dependsOn }}
condition: ${{ parameters.stageCondition }}
jobs:
@@ -44,6 +45,10 @@ stages:
commit: ${{ parameters.commit }}
xaprepareScenario: EmulatorTestDependencies

- template: /build-tools/automation/yaml-templates/select-test-runtime.yaml
parameters:
runtimeName: ${{ parameters.runtimeName }}

- task: DownloadPipelineArtifact@2
inputs:
artifactName: $(TestAssembliesArtifactName)
@@ -85,7 +90,7 @@ stages:
condition: ${{ parameters.shouldFailOnIssue }}

- job: wear_tests
displayName: macOS > Tests > WearOS
displayName: macOS > Tests > WearOS (${{ parameters.runtimeName }})
timeoutInMinutes: 180
cancelTimeoutInMinutes: 2
strategy:
@@ -111,6 +116,10 @@ stages:
commit: ${{ parameters.commit }}
xaprepareScenario: EmulatorTestDependencies

- template: /build-tools/automation/yaml-templates/select-test-runtime.yaml
parameters:
runtimeName: ${{ parameters.runtimeName }}

- task: DownloadPipelineArtifact@2
inputs:
artifactName: $(TestAssembliesArtifactName)
10 changes: 8 additions & 2 deletions build-tools/automation/yaml-templates/stage-msbuild-tests.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# Runs MSBuild tests that do not require devices on Mac/Windows

parameters:
runtimeName: ''
testFilter: '' # Filter used to select tests (NUnit test selection language, not dotnet test filter language)
stageName: msbuild_dotnet
stageCondition: succeeded()
dependsOn: mac_build
@@ -12,14 +14,16 @@ parameters:
use1ESTemplate: true

stages:
- stage: ${{ parameters.stageName }}
displayName: ${{ parameters.stagePrefix }}MSBuild Tests
- stage: ${{ parameters.stageName }}_${{ parameters.runtimeName }}
displayName: ${{ parameters.stagePrefix }}MSBuild Tests (${{ parameters.runtimeName }})
dependsOn: ${{ parameters.dependsOn }}
condition: ${{ parameters.stageCondition }}
jobs:
- template: /build-tools/automation/yaml-templates/run-msbuild-tests.yaml
parameters:
testOS: macOS
runtimeName: ${{ parameters.runtimeName }}
testFilter: ${{ parameters.testFilter }}
jobName: mac_msbuild_tests
jobDisplayName: macOS > Tests > MSBuild
agentCount: 10
@@ -32,6 +36,8 @@ stages:
- template: /build-tools/automation/yaml-templates/run-msbuild-tests.yaml
parameters:
testOS: Windows
runtimeName: ${{ parameters.runtimeName }}
testFilter: ${{ parameters.testFilter }}
jobName: win_msbuild_tests
jobDisplayName: Windows > Tests > MSBuild
agentCount: 8
2 changes: 2 additions & 0 deletions build-tools/automation/yaml-templates/variables.yaml
Original file line number Diff line number Diff line change
@@ -68,3 +68,5 @@ variables:
value: 'cat != SystemApplication & cat != TimeZoneInfo & cat != Localization'
- name: RunMAUITestJob
value: true
- name: CoreCLRExcludedNunitCategories
value: 'cat != AOT'
Original file line number Diff line number Diff line change
@@ -33,6 +33,13 @@
<!-- HACK: make dotnet restore include Microsoft.NETCore.App.Runtime.NativeAOT.linux-bionic-arm64 -->
<_IsPublishing Condition=" '$(_IsPublishing)' == '' and '$(_AndroidRuntime)' == 'NativeAOT' ">true</_IsPublishing>

<!-- HACK: NativeCompilationDuringPublish is set to `true` by Microsoft.NETCore.Native.targets
by default, which enforces running of the SetupOSSpecificProps target which, if NDK is
present or its bin directory isn't in PATH, will error out not being able to find
llvm-objcopy or objcopy even though the current build doesn't need them because it doesn't
target NativeAOT. Setting it here will hopefully prevent that from happening. -->
<NativeCompilationDuringPublish Condition=" '$(NativeCompilationDuringPublish)' == '' And '$(_AndroidRuntime)' != 'NativeAOT' ">false</NativeCompilationDuringPublish>

<!-- Use $(AndroidMinimumSupportedApiLevel) for $(SupportedOSPlatformVersion) if unset -->
<SupportedOSPlatformVersion Condition=" '$(SupportedOSPlatformVersion)' == '' ">$(AndroidMinimumSupportedApiLevel)</SupportedOSPlatformVersion>
<!-- $(SupportedOSPlatformVersion) must be '21.0', but we should support integer values like '21' -->
Original file line number Diff line number Diff line change
@@ -6,11 +6,13 @@
"packs": [
"Microsoft.Android.Sdk.net10",
"Microsoft.Android.Sdk.net9",
"Microsoft.Android.Ref.36",
"Microsoft.Android.Runtime.Mono.36.android-arm",
"Microsoft.Android.Runtime.Mono.36.android-arm64",
"Microsoft.Android.Runtime.Mono.36.android-x86",
"Microsoft.Android.Runtime.Mono.36.android-x64",
"Microsoft.Android.Ref.35",
"Microsoft.Android.Runtime.Mono.35.android-arm",
"Microsoft.Android.Runtime.Mono.35.android-arm64",
"Microsoft.Android.Runtime.Mono.35.android-x86",
"Microsoft.Android.Runtime.Mono.35.android-x64",
"Microsoft.Android.Runtime.CoreCLR.35.android-arm64",
"Microsoft.Android.Runtime.CoreCLR.35.android-x64",
"Microsoft.Android.Templates"
],
"platforms": [ "win-x64", "win-arm64", "linux-x64", "linux-arm64", "osx-x64", "osx-arm64" ],
Loading