Skip to content

Commit

Permalink
Merge branch 'main' into classloader-thread-init
Browse files Browse the repository at this point in the history
* main:
  [ci] Use AZDO built-in parallelization strategy. (dotnet#7804)
  Bump to dotnet/installer@e3ab0b5 8.0.100-preview.2.23123.10 (dotnet#7813)
  [ci] Run nunit tests with stable .NET version (dotnet#7826)
  [monodroid] Update p/invoke symbol names from net8 alpha1 (dotnet#7829)
  Localized file check-in by OneLocBuild (dotnet#7827)
  • Loading branch information
grendello committed Feb 28, 2023
2 parents 68e7bc7 + d447bff commit 63dbe1e
Show file tree
Hide file tree
Showing 43 changed files with 394 additions and 249 deletions.
1 change: 1 addition & 0 deletions build-tools/automation/azure-pipelines-nightly.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,7 @@ stages:
extraBuildArgs: /p:TestAvdApiLevel=$(avdApiLevel) /p:TestAvdAbi=$(avdAbi) /p:TestAvdType=$(avdType)
artifactSource: bin/Test$(XA.Build.Configuration)/Mono.Android_Tests-Signed.apk
artifactFolder: Default
useDotNet: false

- task: MSBuild@1
displayName: shut down emulator
Expand Down
137 changes: 18 additions & 119 deletions build-tools/automation/azure-pipelines.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,7 @@ stages:
testResultsFiles: TestResult-Xamarin.Android.JcwGen_Tests-$(ApkTestConfiguration).xml
artifactSource: bin/Test$(ApkTestConfiguration)/Xamarin.Android.JcwGen_Tests-Signed.apk
artifactFolder: Default
useDotNet: false

- template: yaml-templates/apk-instrumentation.yaml
parameters:
Expand All @@ -142,6 +143,7 @@ stages:
artifactSource: bin/Test$(ApkTestConfiguration)/Xamarin.Android.JcwGen_Tests-Signed.apk
artifactFolder: FastDev_Assemblies_Dexes
extraBuildArgs: /p:AndroidFastDeploymentType=Assemblies:Dexes
useDotNet: false

- template: yaml-templates/apk-instrumentation.yaml
parameters:
Expand All @@ -151,6 +153,7 @@ stages:
testResultsFiles: TestResult-Xamarin.Android.Locale_Tests-$(ApkTestConfiguration).xml
artifactSource: bin/Test$(ApkTestConfiguration)/Xamarin.Android.Locale_Tests-Signed.apk
artifactFolder: Default
useDotNet: false

- template: yaml-templates/apk-instrumentation.yaml
parameters:
Expand All @@ -161,6 +164,7 @@ stages:
extraBuildArgs: /p:AotAssemblies=True
artifactSource: bin/Test$(ApkTestConfiguration)/Xamarin.Android.Locale_Tests-Signed.apk
artifactFolder: Aot
useDotNet: false

- template: yaml-templates/apk-instrumentation.yaml
parameters:
Expand All @@ -171,6 +175,7 @@ stages:
extraBuildArgs: /p:AotAssemblies=True /p:AndroidEnableProfiledAot=true
artifactSource: bin/Test$(ApkTestConfiguration)/Xamarin.Android.Locale_Tests-Signed.apk
artifactFolder: Profiled-Aot
useDotNet: false

- template: yaml-templates/apk-instrumentation.yaml
parameters:
Expand All @@ -180,6 +185,7 @@ stages:
testResultsFiles: TestResult-Xamarin.Android.EmbeddedDSO_Test.nunit-$(ApkTestConfiguration).xml
artifactSource: bin/Test$(ApkTestConfiguration)/Xamarin.Android.EmbeddedDSO_Test-Signed.apk
artifactFolder: Default
useDotNet: false

- template: yaml-templates/apk-instrumentation.yaml
parameters:
Expand All @@ -189,6 +195,7 @@ stages:
testResultsFiles: TestResult-apkdiff-Xamarin.Forms_Performance_Integration-Signed-$(ApkTestConfiguration).xml
artifactSource: bin/Test$(ApkTestConfiguration)/Xamarin.Forms_Performance_Integration-Signed.apk
artifactFolder: Default
useDotNet: false

- template: yaml-templates/apk-instrumentation.yaml
parameters:
Expand All @@ -199,6 +206,7 @@ stages:
extraBuildArgs: /p:AotAssemblies=true
artifactSource: bin/Test$(ApkTestConfiguration)/Xamarin.Forms_Performance_Integration-Signed.apk
artifactFolder: Aot
useDotNet: false

- template: yaml-templates/apk-instrumentation.yaml
parameters:
Expand All @@ -209,6 +217,7 @@ stages:
extraBuildArgs: /p:AotAssemblies=True /p:AndroidEnableProfiledAot=true
artifactSource: bin/Test$(ApkTestConfiguration)/Xamarin.Forms_Performance_Integration-Signed.apk
artifactFolder: Profiled-Aot
useDotNet: false

- template: yaml-templates/apk-instrumentation.yaml
parameters:
Expand All @@ -219,6 +228,7 @@ stages:
extraBuildArgs: /p:BundleAssemblies=true
artifactSource: bin/Test$(ApkTestConfiguration)/Xamarin.Forms_Performance_Integration-Signed.apk
artifactFolder: Bundle
useDotNet: false

- template: yaml-templates/apk-instrumentation.yaml
parameters:
Expand All @@ -228,6 +238,7 @@ stages:
testResultsFiles: TestResult-apkdiff-com.companyname.vsandroidapp-Signed-$(ApkTestConfiguration).xml
artifactSource: bin/Test$(ApkTestConfiguration)/com.companyname.vsandroidapp-Signed.apk
artifactFolder: Default
useDotNet: false

- task: MSBuild@1
displayName: shut down emulator
Expand Down Expand Up @@ -347,7 +358,6 @@ stages:
testResultsFiles: TestResult-Mono.Android.NET_Tests-$(XA.Build.Configuration).xml
artifactSource: bin/Test$(XA.Build.Configuration)/$(DotNetTargetFramework)-android/Mono.Android.NET_Tests-Signed.aab
artifactFolder: $(DotNetTargetFramework)-$(XA.Build.Configuration)
useDotNet: true

- template: yaml-templates/apk-instrumentation.yaml
parameters:
Expand All @@ -358,7 +368,6 @@ stages:
testResultsFiles: TestResult-Mono.Android.NET_Tests-Debug.xml
artifactSource: bin/Test$(XA.Build.Configuration)/$(DotNetTargetFramework)-android/Mono.Android.NET_Tests-Signed.apk
artifactFolder: $(DotNetTargetFramework)-Debug
useDotNet: true

- template: yaml-templates/apk-instrumentation.yaml
parameters:
Expand All @@ -369,7 +378,6 @@ stages:
extraBuildArgs: -p:TestsFlavor=NoAab -p:AndroidPackageFormat=apk
artifactSource: bin/Test$(XA.Build.Configuration)/$(DotNetTargetFramework)-android/Mono.Android.NET_Tests-Signed.apk
artifactFolder: $(DotNetTargetFramework)-NoAab
useDotNet: true

- template: yaml-templates/apk-instrumentation.yaml
parameters:
Expand All @@ -380,7 +388,6 @@ stages:
extraBuildArgs: -p:TestsFlavor=Interpreter -p:UseInterpreter=True
artifactSource: bin/Test$(XA.Build.Configuration)/$(DotNetTargetFramework)-android/Mono.Android.NET_Tests-Signed.aab
artifactFolder: $(DotNetTargetFramework)-Interpreter
useDotNet: true

- template: yaml-templates/apk-instrumentation.yaml
parameters:
Expand All @@ -391,7 +398,6 @@ stages:
extraBuildArgs: -p:TestsFlavor=NoAot -p:RunAOTCompilation=false
artifactSource: bin/Test$(XA.Build.Configuration)/$(DotNetTargetFramework)-android/Mono.Android.NET_Tests-Signed.aab
artifactFolder: $(DotNetTargetFramework)-NoAot
useDotNet: true

- template: yaml-templates/apk-instrumentation.yaml
parameters:
Expand All @@ -402,7 +408,6 @@ stages:
extraBuildArgs: -p:TestsFlavor=AotLlvm -p:EnableLLVM=true -p:AndroidEnableProfiledAot=false
artifactSource: bin/Test$(XA.Build.Configuration)/$(DotNetTargetFramework)-android/Mono.Android.NET_Tests-Signed.aab
artifactFolder: $(DotNetTargetFramework)-AotLlvm
useDotNet: true

- task: MSBuild@1
displayName: shut down emulator
Expand Down Expand Up @@ -497,7 +502,6 @@ stages:

- template: yaml-templates/run-nunit-tests.yaml
parameters:
useDotNet: true
testRunTitle: MSBuildDeviceIntegration Smoke - macOS
testAssembly: $(System.DefaultWorkingDirectory)/bin/Test$(XA.Build.Configuration)/MSBuildDeviceIntegration/$(DotNetStableTargetFramework)/MSBuildDeviceIntegration.dll
dotNetTestExtraArgs: --filter "TestCategory = SmokeTests $(DotNetNUnitCategories)"
Expand Down Expand Up @@ -546,7 +550,6 @@ stages:

- template: yaml-templates/run-nunit-tests.yaml
parameters:
useDotNet: true
testRunTitle: Xamarin.Android.Build.Tests - Linux .NET 6 Smoke Tests
testAssembly: $(System.DefaultWorkingDirectory)/bin/Test$(XA.Build.Configuration)/$(DotNetStableTargetFramework)/Xamarin.Android.Build.Tests.dll
dotNetTestExtraArgs: --filter "TestCategory = SmokeTests $(DotNetNUnitCategories)"
Expand Down Expand Up @@ -649,117 +652,12 @@ stages:
nunit_categories: $(DotNetNUnitCategories) & TestCategory != SmokeTests
target_framework: $(DotNetStableTargetFramework)
provisionatorChannel: ${{ parameters.provisionatorChannel }}

- stage: msbuilddevice_tests
displayName: MSBuild Emulator Tests
dependsOn: mac_build
condition: and(succeeded(), or(eq(variables['RunAllTests'], true), contains(dependencies.mac_build.outputs['mac_build_create_installers.TestConditions.TestAreas'], 'MSBuildDevice')))
jobs:
# Check - "Xamarin.Android (macOS > Tests > MSBuild+Emulator One .NET #N)"
- template: yaml-templates/run-msbuild-device-tests.yaml
parameters:
node_id: 1
job_name: mac_dotnetdevice_tests_1
job_suffix: One .NET
nunit_categories: $(DotNetNUnitCategories)
target_framework: $(DotNetStableTargetFramework)
provisionatorChannel: ${{ parameters.provisionatorChannel }}

- template: yaml-templates/run-msbuild-device-tests.yaml
parameters:
node_id: 2
job_name: mac_dotnetdevice_tests_2
job_suffix: One .NET
nunit_categories: $(DotNetNUnitCategories)
target_framework: $(DotNetStableTargetFramework)
provisionatorChannel: ${{ parameters.provisionatorChannel }}

- template: yaml-templates/run-msbuild-device-tests.yaml
parameters:
node_id: 3
job_name: mac_dotnetdevice_tests_3
job_suffix: One .NET
nunit_categories: $(DotNetNUnitCategories)
target_framework: $(DotNetStableTargetFramework)
provisionatorChannel: ${{ parameters.provisionatorChannel }}

- template: yaml-templates/run-msbuild-device-tests.yaml
parameters:
node_id: 4
job_name: mac_dotnetdevice_tests_4
job_suffix: One .NET
nunit_categories: $(DotNetNUnitCategories)
target_framework: $(DotNetStableTargetFramework)
provisionatorChannel: ${{ parameters.provisionatorChannel }}

- job: wear_tests
displayName: macOS > Tests > WearOS
timeoutInMinutes: 180
cancelTimeoutInMinutes: 2
strategy:
matrix:
Android30-x86:
avdApiLevel: 30
avdAbi: x86
avdType: android-wear
deviceName: wear_square
pool:
vmImage: $(HostedMacImage)
workspace:
clean: all
steps:
- template: yaml-templates/setup-test-environment.yaml
parameters:
configuration: $(XA.Build.Configuration)

- template: yaml-templates/run-xaprepare.yaml
parameters:
displayName: install required brew tools and prepare java.interop
arguments: --s=Required --auto-provision=yes --auto-provision-uses-sudo=yes

- template: yaml-templates/run-xaprepare.yaml
parameters:
displayName: install emulator
arguments: --s=EmulatorTestDependencies

- script: echo "##vso[task.setvariable variable=Java8SdkDirectory]$JAVA_HOME_8_X64"
displayName: set Java8SdkDirectory

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

- task: MSBuild@1
displayName: install and launch emulator
inputs:
solution: tests/Mono.Android-Tests/Mono.Android-Tests.csproj
configuration: $(XA.Build.Configuration)
msbuildArguments: /t:InstallAvdImage;AcquireAndroidTarget /p:TestDeviceName=$(deviceName) /p:TestAvdApiLevel=$(avdApiLevel) /p:TestAvdAbi=$(avdAbi) /p:TestAvdType=$(avdType) /bl:$(System.DefaultWorkingDirectory)/bin/Test$(XA.Build.Configuration)/install-emulator-$(avdApiLevel).binlog

- template: yaml-templates/run-nunit-tests.yaml
parameters:
useDotNet: true
testRunTitle: WearOS On Device - macOS
testAssembly: $(System.DefaultWorkingDirectory)/bin/Test$(XA.Build.Configuration)/MSBuildDeviceIntegration/$(DotNetStableTargetFramework)/MSBuildDeviceIntegration.dll
dotNetTestExtraArgs: --filter "TestCategory = WearOS"
testResultsFile: TestResult-WearOS--$(XA.Build.Configuration).xml

- task: MSBuild@1
displayName: shut down emulator
inputs:
solution: tests/Mono.Android-Tests/Mono.Android-Tests.csproj
configuration: $(XA.Build.Configuration)
msbuildArguments: /t:AcquireAndroidTarget,ReleaseAndroidTarget /p:TestDeviceName=$(deviceName) /p:TestAvdApiLevel=$(avdApiLevel) /p:TestAvdAbi=$(avdAbi) /p:TestAvdType=$(avdType) /bl:$(System.DefaultWorkingDirectory)/bin/Test$(XA.Build.Configuration)/shutdown-emulator.binlog
condition: always()

- template: yaml-templates/upload-results.yaml
parameters:
configuration: $(XA.Build.Configuration)
artifactName: Test Results - Emulator $(avdApiLevel)-$(avdAbi)-$(avdType) - macOS

- template: yaml-templates/fail-on-issue.yaml


- template: yaml-templates/stage-msbuild-emulator-tests.yaml
parameters:
provisionatorChannel: ${{ parameters.provisionatorChannel }}
stageCondition: and(succeeded(), or(eq(variables['RunAllTests'], true), contains(dependencies.mac_build.outputs['mac_build_create_installers.TestConditions.TestAreas'], 'MSBuildDevice')))
nunit_categories: '& cat != DotNetIgnore & cat != HybridAOT & cat != MkBundle & cat != MonoSymbolicate & cat != PackagesConfig & cat != StaticProject & cat != SystemApplication'

- stage: bcl_tests
displayName: BCL Emulator Tests
Expand Down Expand Up @@ -805,6 +703,7 @@ stages:
testResultsFiles: TestResult-Xamarin.Android.Bcl_Tests.nunit-$(XA.Build.Configuration).xml
artifactSource: bin/Test$(XA.Build.Configuration)/Xamarin.Android.Bcl_Tests-Signed.apk
artifactFolder: Default
useDotNet: false

- task: PublishTestResults@2
displayName: publish Xamarin.Android.Bcl-Tests-XUnit results
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ parameters:
testResultsFormat: NUnit
artifactSource: ""
artifactFolder: ""
useDotNet: false
useDotNet: true
condition: succeeded()

steps:
Expand Down
2 changes: 1 addition & 1 deletion build-tools/automation/yaml-templates/build-windows.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -116,14 +116,14 @@ stages:

- template: run-nunit-tests.yaml
parameters:
useDotNet: false
testRunTitle: Smoke MSBuild Tests - Windows Build Tree
testAssembly: $(System.DefaultWorkingDirectory)\bin\Test$(XA.Build.Configuration)\net472\Xamarin.Android.Build.Tests.dll
testResultsFile: TestResult-SmokeMSBuildTests-WinBuildTree-$(XA.Build.Configuration).xml
nunitConsoleExtraArgs: --where "cat == SmokeTests"

- template: run-nunit-tests.yaml
parameters:
useDotNet: true
testRunTitle: Smoke MSBuild Tests - Windows Dotnet Build
testAssembly: $(System.DefaultWorkingDirectory)\bin\Test$(XA.Build.Configuration)\$(DotNetStableTargetFramework)\Xamarin.Android.Build.Tests.dll
testResultsFile: TestResult-SmokeMSBuildTests-WinDotnetBuild-$(XA.Build.Configuration).xml
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
parameters:
version: '0.1.0-alpha1'
condition: succeeded()
continueOnError: true

steps:
- powershell: dotnet tool uninstall dotnet-test-slicer -g
displayName: uninstall dotnet-test-slicer
ignoreLASTEXITCODE: true
condition: ${{ parameters.condition }}

- script: dotnet tool update dotnet-test-slicer --version ${{ parameters.version }} --add-source https://api.nuget.org/v3/index.json -g
displayName: install dotnet-test-slicer ${{ parameters.version }}
condition: ${{ parameters.condition }}
continueOnError: ${{ parameters.continueOnError }}
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ jobs:
parameters:
testRunTitle: LocalizationTests On Device - macOS
testAssembly: $(System.DefaultWorkingDirectory)/bin/Test$(XA.Build.Configuration)/MSBuildDeviceIntegration/$(DotNetStableTargetFramework)/MSBuildDeviceIntegration.dll
useDotNet: true
dotNetTestExtraArgs: --filter "Name~CheckLocalizationIsCorrectNode${{ parameters.node_id }}"
testResultsFile: TestResult-LocalizationTests-Node${{ parameters.node_id }}-$(XA.Build.Configuration).xml

Expand Down
26 changes: 22 additions & 4 deletions build-tools/automation/yaml-templates/run-nunit-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,15 @@ parameters:
testResultsFile: TestResult.xml
nunitConsoleExtraArgs: ''
dotNetTestExtraArgs: ''
useDotNet: false
useDotNet: true
useDotNetPreview: false
workers: $(NUnit.NumberOfTestWorkers)
condition: succeeded()
timeoutInMinutes: 0
retryCountOnTaskFailure: 0

steps:
- ${{ if eq(parameters.useDotNet, false) }}:
- ${{ if and(eq(parameters.useDotNet, false), eq(parameters.useDotNetPreview, false)) }}:
- powershell: |
Write-Host '##vso[task.setvariable variable=TestResultsFormat]NUnit'
if ([Environment]::OSVersion.Platform -eq "Unix") {
Expand All @@ -28,7 +31,7 @@ steps:
condition: ${{ parameters.condition }}
continueOnError: true
- ${{ if eq(parameters.useDotNet, true) }}:
- ${{ if and(eq(parameters.useDotNet, true), eq(parameters.useDotNetPreview, true)) }}:
- powershell: Write-Host '##vso[task.setvariable variable=TestResultsFormat]VSTest'
- template: run-dotnet-preview.yaml
parameters:
Expand All @@ -43,11 +46,26 @@ steps:
displayName: run ${{ parameters.testRunTitle }}
condition: ${{ parameters.condition }}

- ${{ if and(eq(parameters.useDotNet, true), eq(parameters.useDotNetPreview, false)) }}:
- task: DotNetCoreCLI@2
inputs:
command: test
projects: ${{ parameters.testAssembly }}
arguments: >-
${{ parameters.dotNetTestExtraArgs }} -- NUnit.NumberOfTestWorkers=${{ parameters.workers }}
publishTestResults: true
testRunTitle: ${{ parameters.testRunTitle }}
displayName: run ${{ parameters.testRunTitle }}
condition: ${{ parameters.condition }}
continueOnError: true
timeoutInMinutes: ${{ parameters.timeoutInMinutes }}
retryCountOnTaskFailure: ${{ parameters.retryCountOnTaskFailure }}

- template: kill-processes.yaml

- task: PublishTestResults@2
inputs:
testResultsFormat: $(TestResultsFormat)
testResultsFiles: ${{ parameters.testResultsFile }}
testRunTitle: ${{ parameters.testRunTitle }}
condition: ${{ parameters.condition }}
condition: and(${{ parameters.condition }}, or(ne('${{ parameters.useDotNet }}', 'true'), eq('${{ parameters.useDotNetPreview }}', 'true')))
Loading

0 comments on commit 63dbe1e

Please sign in to comment.