Skip to content

Commit

Permalink
Merge branch 'main' into native-code-classic-cleanup
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 b233500 + d447bff commit 92c832f
Show file tree
Hide file tree
Showing 43 changed files with 422 additions and 220 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
121 changes: 39 additions & 82 deletions build-tools/automation/azure-pipelines.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,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 @@ -156,7 +155,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 @@ -167,7 +165,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 @@ -178,7 +175,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 @@ -189,7 +185,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 @@ -200,7 +195,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 @@ -295,7 +289,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 @@ -344,7 +337,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 @@ -448,113 +440,78 @@ stages:
target_framework: $(DotNetStableTargetFramework)
provisionatorChannel: ${{ parameters.provisionatorChannel }}

- stage: msbuilddevice_tests
displayName: MSBuild Emulator Tests
- 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
dependsOn: mac_build
condition: and(succeeded(), or(eq(variables['RunAllTests'], true), contains(dependencies.mac_build.outputs['mac_build_create_installers.TestConditions.TestAreas'], 'MSBuildDevice')))
# Disabled on .NET release branches
condition: and(succeeded(), eq(variables.IsRelOrTargetingRel, 'False'), or(eq(variables['RunAllTests'], true), contains(dependencies.mac_build.outputs['mac_build_create_installers.TestConditions.TestAreas'], 'BCL')))
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
# Check - "Xamarin.Android (macOS > Tests > BCL (Emulator))"
- job: mac_bcl_tests
displayName: macOS > Tests > BCL (Emulator)
pool:
vmImage: $(HostedMacImage)
timeoutInMinutes: 180
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
provisionatorChannel: ${{ parameters.provisionatorChannel }}

- 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)
downloadPath: $(System.DefaultWorkingDirectory)/bin/$(XA.Build.Configuration)

- task: MSBuild@1
displayName: install and launch emulator
displayName: build remap-assembly-ref.csproj
inputs:
solution: tests/Mono.Android-Tests/Mono.Android-Tests.csproj
solution: build-tools/remap-assembly-ref/remap-assembly-ref.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
msbuildArguments: /restore /bl:$(System.DefaultWorkingDirectory)/bin/Test$(XA.Build.Configuration)/remap-assembly-ref.binlog

- template: yaml-templates/run-nunit-tests.yaml
- template: yaml-templates/apk-instrumentation.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
configuration: $(XA.Build.Configuration)
testName: Xamarin.Android.Bcl-Tests
project: tests/BCL-Tests/Xamarin.Android.Bcl-Tests/Xamarin.Android.Bcl-Tests.csproj
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
inputs:
testResultsFormat: NUnit
testResultsFiles: TestResult-Xamarin.Android.Bcl_Tests.xunit-$(XA.Build.Configuration).xml
testRunTitle: Xamarin.Android.Bcl-Tests-NUnit

- task: MSBuild@1
displayName: shut down emulator
inputs:
solution: tests/Mono.Android-Tests/Mono.Android-Tests.csproj
solution: tests/BCL-Tests/Xamarin.Android.Bcl-Tests/Xamarin.Android.Bcl-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
msbuildArguments: >-
/t:AcquireAndroidTarget,ReleaseAndroidTarget
/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
artifactName: Test Results - BCL With Emulator - macOS

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

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
1 change: 0 additions & 1 deletion build-tools/automation/yaml-templates/build-windows.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,6 @@ stages:

- 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')))
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ jobs:
- template: run-nunit-tests.yaml
parameters:
useDotNet: false
testRunTitle: TimeZoneInfoTests On Device - macOS
testAssembly: $(System.DefaultWorkingDirectory)/bin/Test$(XA.Build.Configuration)/MSBuildDeviceIntegration/net472/MSBuildDeviceIntegration.dll
nunitConsoleExtraArgs: --where "test == Xamarin.Android.Build.Tests.DeploymentTest.CheckTimeZoneInfoIsCorrectNode${{ parameters.node_id }}"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ parameters:
updateVS: false
jdkTestFolder: $(JAVA_HOME_11_X64)
remove_dotnet: false
installTestSlicer: false

steps:
- checkout: self
Expand Down Expand Up @@ -101,3 +102,6 @@ steps:
arguments: -t:ExtractWorkloadPacks -c ${{ parameters.configuration }} -v:n -bl:${{ parameters.xaSourcePath }}/bin/Test${{ parameters.configuration }}/extract-workloads.binlog

- template: install-apkdiff.yaml

- ${{ if eq(parameters.installTestSlicer, true) }}:
- template: install-dotnet-test-slicer.yaml
Loading

0 comments on commit 92c832f

Please sign in to comment.