diff --git a/build-tools/automation/azure-pipelines.yaml b/build-tools/automation/azure-pipelines.yaml index 361c7eb74fc..a4a9311e0bd 100644 --- a/build-tools/automation/azure-pipelines.yaml +++ b/build-tools/automation/azure-pipelines.yaml @@ -104,167 +104,9 @@ extends: - template: /build-tools/automation/yaml-templates/build-linux.yaml@self - - stage: smoke_tests - displayName: Package Tests - dependsOn: mac_build - jobs: - # Check - "Xamarin.Android (Package Tests macOS > Tests > APKs .NET)" - - job: mac_apk_tests_net - displayName: macOS > Tests > APKs .NET - pool: - name: Azure Pipelines - vmImage: $(HostedMacImage) - os: macOS - timeoutInMinutes: 180 - workspace: - clean: all - steps: - - template: /build-tools/automation/yaml-templates/setup-test-environment.yaml@self - parameters: - xaprepareScenario: EmulatorTestDependencies - - - task: DownloadPipelineArtifact@2 - inputs: - artifactName: $(TestAssembliesArtifactName) - downloadPath: $(System.DefaultWorkingDirectory)/bin/Test$(XA.Build.Configuration) - - # Set up dependencies to run tests in both debug and release configurations - - task: DotNetCoreCLI@2 - displayName: build Xamarin.Android.Tools.BootstrapTasks.csproj - inputs: - projects: $(System.DefaultWorkingDirectory)/build-tools/Xamarin.Android.Tools.BootstrapTasks/Xamarin.Android.Tools.BootstrapTasks.csproj - arguments: -c Debug -bl:$(System.DefaultWorkingDirectory)/bin/TestDebug/BootstrapTasks.binlog - - - template: /build-tools/automation/yaml-templates/run-dotnet-preview.yaml@self - parameters: - project: Xamarin.Android.sln - arguments: >- - -t:PrepareJavaInterop -c Debug --no-restore - -p:DotNetPreviewTool=$(System.DefaultWorkingDirectory)/bin/$(XA.Build.Configuration)/dotnet/dotnet - displayName: prepare java.interop Debug - continueOnError: false - - - template: /build-tools/automation/yaml-templates/run-dotnet-preview.yaml@self - parameters: - project: Xamarin.Android.sln - arguments: -t:PrepareJavaInterop -c $(XA.Build.Configuration) --no-restore - displayName: prepare java.interop $(XA.Build.Configuration) - continueOnError: false - - - template: /build-tools/automation/yaml-templates/run-dotnet-preview.yaml@self - parameters: - command: test - project: src/Microsoft.Android.Sdk.Analysis/Tests/Microsoft.Android.Sdk.Analysis.Tests.csproj - arguments: -c $(XA.Build.Configuration) - displayName: Test Microsoft.Android.Sdk.Analysis $(XA.Build.Configuration) - continueOnError: false - - - template: /build-tools/automation/yaml-templates/start-stop-emulator.yaml@self - - - template: /build-tools/automation/yaml-templates/apk-instrumentation.yaml@self - parameters: - buildConfiguration: $(XA.Build.Configuration) - configuration: Debug - testName: Mono.Android.NET_Tests-Debug - project: tests/Mono.Android-Tests/Runtime-Microsoft.Android.Sdk/Mono.Android.NET-Tests.csproj - testResultsFiles: TestResult-Mono.Android.NET_Tests-Debug.xml - artifactSource: bin/TestDebug/$(DotNetTargetFramework)-android/Mono.Android.NET_Tests-Signed.apk - artifactFolder: $(DotNetTargetFramework)-Debug - - - template: /build-tools/automation/yaml-templates/apk-instrumentation.yaml@self - parameters: - configuration: $(XA.Build.Configuration) - testName: Mono.Android.NET_Tests-$(XA.Build.Configuration) - project: tests/Mono.Android-Tests/Runtime-Microsoft.Android.Sdk/Mono.Android.NET-Tests.csproj - 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) - - - template: /build-tools/automation/yaml-templates/apk-instrumentation.yaml@self - parameters: - configuration: $(XA.Build.Configuration) - testName: Mono.Android.NET_Tests-NoAab - project: tests/Mono.Android-Tests/Runtime-Microsoft.Android.Sdk/Mono.Android.NET-Tests.csproj - testResultsFiles: TestResult-Mono.Android.NET_Tests-$(XA.Build.Configuration)NoAab.xml - extraBuildArgs: -p:TestsFlavor=NoAab -p:AndroidPackageFormat=apk - artifactSource: bin/Test$(XA.Build.Configuration)/$(DotNetTargetFramework)-android/Mono.Android.NET_Tests-Signed.apk - artifactFolder: $(DotNetTargetFramework)-NoAab - - - template: /build-tools/automation/yaml-templates/apk-instrumentation.yaml@self - parameters: - configuration: $(XA.Build.Configuration) - testName: Mono.Android.NET_Tests-Interpreter - project: tests/Mono.Android-Tests/Runtime-Microsoft.Android.Sdk/Mono.Android.NET-Tests.csproj - testResultsFiles: TestResult-Mono.Android.NET_Tests-$(XA.Build.Configuration)Interpreter.xml - extraBuildArgs: -p:TestsFlavor=Interpreter -p:UseInterpreter=True - artifactSource: bin/Test$(XA.Build.Configuration)/$(DotNetTargetFramework)-android/Mono.Android.NET_Tests-Signed.aab - artifactFolder: $(DotNetTargetFramework)-Interpreter - - - template: /build-tools/automation/yaml-templates/apk-instrumentation.yaml@self - parameters: - configuration: $(XA.Build.Configuration) - testName: Mono.Android.NET_Tests-NoAot - project: tests/Mono.Android-Tests/Runtime-Microsoft.Android.Sdk/Mono.Android.NET-Tests.csproj - testResultsFiles: TestResult-Mono.Android.NET_Tests-$(XA.Build.Configuration)NoAot.xml - extraBuildArgs: -p:TestsFlavor=NoAot -p:RunAOTCompilation=false - artifactSource: bin/Test$(XA.Build.Configuration)/$(DotNetTargetFramework)-android/Mono.Android.NET_Tests-Signed.aab - artifactFolder: $(DotNetTargetFramework)-NoAot - - - template: /build-tools/automation/yaml-templates/apk-instrumentation.yaml@self - parameters: - configuration: $(XA.Build.Configuration) - testName: Mono.Android.NET_Tests-TrimModePartial - project: tests/Mono.Android-Tests/Runtime-Microsoft.Android.Sdk/Mono.Android.NET-Tests.csproj - testResultsFiles: TestResult-Mono.Android.NET_Tests-$(XA.Build.Configuration)TrimModePartial.xml - extraBuildArgs: -p:TestsFlavor=TrimModePartial -p:TrimMode=partial - artifactSource: bin/Test$(XA.Build.Configuration)/$(DotNetTargetFramework)-android/Mono.Android.NET_Tests-Signed.aab - artifactFolder: $(DotNetTargetFramework)-TrimModePartial - - - template: /build-tools/automation/yaml-templates/apk-instrumentation.yaml@self - parameters: - configuration: $(XA.Build.Configuration) - testName: Mono.Android.NET_Tests-AotLlvm - project: tests/Mono.Android-Tests/Runtime-Microsoft.Android.Sdk/Mono.Android.NET-Tests.csproj - testResultsFiles: TestResult-Mono.Android.NET_Tests-$(XA.Build.Configuration)AotLlvm.xml - 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 - - - template: /build-tools/automation/yaml-templates/apk-instrumentation.yaml@self - parameters: - configuration: $(XA.Build.Configuration) - testName: Xamarin.Android.JcwGen_Tests - project: tests/CodeGen-Binding/Xamarin.Android.JcwGen-Tests/Xamarin.Android.JcwGen-Tests.csproj - testResultsFiles: TestResult-Xamarin.Android.JcwGen_Tests-$(XA.Build.Configuration).xml - artifactSource: bin/Test$(XA.Build.Configuration)/$(DotNetTargetFramework)-android/Xamarin.Android.JcwGen_Tests-Signed.apk - artifactFolder: $(DotNetTargetFramework)-Default - - - template: /build-tools/automation/yaml-templates/run-nunit-tests.yaml@self - parameters: - testRunTitle: Xamarin.Android.Tools.Aidl-Tests - macOS - testAssembly: $(System.DefaultWorkingDirectory)/bin/Test$(XA.Build.Configuration)/$(DotNetStableTargetFramework)/Xamarin.Android.Tools.Aidl-Tests.dll - - - task: ShellScript@2 - displayName: Test dotnet-local.sh - inputs: - scriptPath: dotnet-local.sh - args: build samples/HelloWorld/HelloWorld/HelloWorld.DotNet.csproj - - - ${{ if ne(parameters.macTestAgentsUseCleanImages, true) }}: - - template: /build-tools/automation/yaml-templates/start-stop-emulator.yaml@self - parameters: - command: stop - - - template: /build-tools/automation/yaml-templates/upload-results.yaml@self - parameters: - artifactName: Test Results - APKs .NET $(XA.Build.Configuration) - macOS - - - template: /build-tools/automation/yaml-templates/upload-results.yaml@self - parameters: - artifactName: Test Results - APKs .NET Debug - macOS - configuration: Debug - - - template: /build-tools/automation/yaml-templates/fail-on-issue.yaml@self + - template: /build-tools/automation/yaml-templates/stage-package-tests.yaml@self + parameters: + macTestAgentsUseCleanImages: ${{ parameters.macTestAgentsUseCleanImages }} - stage: linux_tests displayName: Linux Tests diff --git a/build-tools/automation/yaml-templates/stage-package-tests.yaml b/build-tools/automation/yaml-templates/stage-package-tests.yaml new file mode 100644 index 00000000000..b8e156c4191 --- /dev/null +++ b/build-tools/automation/yaml-templates/stage-package-tests.yaml @@ -0,0 +1,235 @@ +# Runs primarily the Mono.Android-Tests suite, using the emulator. + +parameters: + macTestAgentsUseCleanImages: + +stages: +- stage: smoke_tests + displayName: Package Tests + dependsOn: mac_build + jobs: +# Check - "Xamarin.Android (Package Tests macOS > Tests > APKs .NET)" + - job: mac_apk_tests_net_1 + displayName: macOS > Tests > APKs 1 + pool: + name: Azure Pipelines + vmImage: $(HostedMacImage) + os: macOS + timeoutInMinutes: 180 + workspace: + clean: all + steps: + - template: /build-tools/automation/yaml-templates/setup-test-environment.yaml@self + parameters: + xaprepareScenario: EmulatorTestDependencies + + - task: DownloadPipelineArtifact@2 + inputs: + artifactName: $(TestAssembliesArtifactName) + downloadPath: $(System.DefaultWorkingDirectory)/bin/Test$(XA.Build.Configuration) + + # Set up dependencies to run tests in both debug and release configurations + - task: DotNetCoreCLI@2 + displayName: build Xamarin.Android.Tools.BootstrapTasks.csproj + inputs: + projects: $(System.DefaultWorkingDirectory)/build-tools/Xamarin.Android.Tools.BootstrapTasks/Xamarin.Android.Tools.BootstrapTasks.csproj + arguments: -c Debug -bl:$(System.DefaultWorkingDirectory)/bin/TestDebug/BootstrapTasks.binlog + + - template: /build-tools/automation/yaml-templates/run-dotnet-preview.yaml@self + parameters: + project: Xamarin.Android.sln + arguments: >- + -t:PrepareJavaInterop -c Debug --no-restore + -p:DotNetPreviewTool=$(System.DefaultWorkingDirectory)/bin/$(XA.Build.Configuration)/dotnet/dotnet + displayName: prepare java.interop Debug + continueOnError: false + + - template: /build-tools/automation/yaml-templates/run-dotnet-preview.yaml@self + parameters: + project: Xamarin.Android.sln + arguments: -t:PrepareJavaInterop -c $(XA.Build.Configuration) --no-restore + displayName: prepare java.interop $(XA.Build.Configuration) + continueOnError: false + + - template: /build-tools/automation/yaml-templates/run-dotnet-preview.yaml@self + parameters: + command: test + project: src/Microsoft.Android.Sdk.Analysis/Tests/Microsoft.Android.Sdk.Analysis.Tests.csproj + arguments: -c $(XA.Build.Configuration) + displayName: Test Microsoft.Android.Sdk.Analysis $(XA.Build.Configuration) + continueOnError: false + + - template: /build-tools/automation/yaml-templates/start-stop-emulator.yaml@self + + - template: /build-tools/automation/yaml-templates/apk-instrumentation.yaml@self + parameters: + buildConfiguration: $(XA.Build.Configuration) + configuration: Debug + testName: Mono.Android.NET_Tests-Debug + project: tests/Mono.Android-Tests/Runtime-Microsoft.Android.Sdk/Mono.Android.NET-Tests.csproj + testResultsFiles: TestResult-Mono.Android.NET_Tests-Debug.xml + artifactSource: bin/TestDebug/$(DotNetTargetFramework)-android/Mono.Android.NET_Tests-Signed.apk + artifactFolder: $(DotNetTargetFramework)-Debug + + - template: /build-tools/automation/yaml-templates/apk-instrumentation.yaml@self + parameters: + configuration: $(XA.Build.Configuration) + testName: Mono.Android.NET_Tests-$(XA.Build.Configuration) + project: tests/Mono.Android-Tests/Runtime-Microsoft.Android.Sdk/Mono.Android.NET-Tests.csproj + 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) + + - template: /build-tools/automation/yaml-templates/apk-instrumentation.yaml@self + parameters: + configuration: $(XA.Build.Configuration) + testName: Mono.Android.NET_Tests-NoAab + project: tests/Mono.Android-Tests/Runtime-Microsoft.Android.Sdk/Mono.Android.NET-Tests.csproj + testResultsFiles: TestResult-Mono.Android.NET_Tests-$(XA.Build.Configuration)NoAab.xml + extraBuildArgs: -p:TestsFlavor=NoAab -p:AndroidPackageFormat=apk + artifactSource: bin/Test$(XA.Build.Configuration)/$(DotNetTargetFramework)-android/Mono.Android.NET_Tests-Signed.apk + artifactFolder: $(DotNetTargetFramework)-NoAab + + - template: /build-tools/automation/yaml-templates/apk-instrumentation.yaml@self + parameters: + configuration: $(XA.Build.Configuration) + testName: Mono.Android.NET_Tests-Interpreter + project: tests/Mono.Android-Tests/Runtime-Microsoft.Android.Sdk/Mono.Android.NET-Tests.csproj + testResultsFiles: TestResult-Mono.Android.NET_Tests-$(XA.Build.Configuration)Interpreter.xml + extraBuildArgs: -p:TestsFlavor=Interpreter -p:UseInterpreter=True + artifactSource: bin/Test$(XA.Build.Configuration)/$(DotNetTargetFramework)-android/Mono.Android.NET_Tests-Signed.aab + artifactFolder: $(DotNetTargetFramework)-Interpreter + + - ${{ if ne(parameters.macTestAgentsUseCleanImages, true) }}: + - template: /build-tools/automation/yaml-templates/start-stop-emulator.yaml@self + parameters: + command: stop + + - template: /build-tools/automation/yaml-templates/upload-results.yaml@self + parameters: + artifactName: Test Results - APKs .NET $(XA.Build.Configuration) - macOS 1 + + - template: /build-tools/automation/yaml-templates/upload-results.yaml@self + parameters: + artifactName: Test Results - APKs .NET Debug - macOS 1 + configuration: Debug + + - template: /build-tools/automation/yaml-templates/fail-on-issue.yaml@self + + - job: mac_apk_tests_net_2 + displayName: macOS > Tests > APKs 2 + pool: + name: Azure Pipelines + vmImage: $(HostedMacImage) + os: macOS + timeoutInMinutes: 180 + workspace: + clean: all + steps: + - template: /build-tools/automation/yaml-templates/setup-test-environment.yaml@self + parameters: + xaprepareScenario: EmulatorTestDependencies + + - task: DownloadPipelineArtifact@2 + inputs: + artifactName: $(TestAssembliesArtifactName) + downloadPath: $(System.DefaultWorkingDirectory)/bin/Test$(XA.Build.Configuration) + + # Set up dependencies to run tests in both debug and release configurations + - task: DotNetCoreCLI@2 + displayName: build Xamarin.Android.Tools.BootstrapTasks.csproj + inputs: + projects: $(System.DefaultWorkingDirectory)/build-tools/Xamarin.Android.Tools.BootstrapTasks/Xamarin.Android.Tools.BootstrapTasks.csproj + arguments: -c Debug -bl:$(System.DefaultWorkingDirectory)/bin/TestDebug/BootstrapTasks.binlog + + - template: /build-tools/automation/yaml-templates/run-dotnet-preview.yaml@self + parameters: + project: Xamarin.Android.sln + arguments: >- + -t:PrepareJavaInterop -c Debug --no-restore + -p:DotNetPreviewTool=$(System.DefaultWorkingDirectory)/bin/$(XA.Build.Configuration)/dotnet/dotnet + displayName: prepare java.interop Debug + continueOnError: false + + - template: /build-tools/automation/yaml-templates/run-dotnet-preview.yaml@self + parameters: + project: Xamarin.Android.sln + arguments: -t:PrepareJavaInterop -c $(XA.Build.Configuration) --no-restore + displayName: prepare java.interop $(XA.Build.Configuration) + continueOnError: false + + - template: /build-tools/automation/yaml-templates/run-dotnet-preview.yaml@self + parameters: + command: test + project: src/Microsoft.Android.Sdk.Analysis/Tests/Microsoft.Android.Sdk.Analysis.Tests.csproj + arguments: -c $(XA.Build.Configuration) + displayName: Test Microsoft.Android.Sdk.Analysis $(XA.Build.Configuration) + continueOnError: false + + - template: /build-tools/automation/yaml-templates/start-stop-emulator.yaml@self + + - template: /build-tools/automation/yaml-templates/apk-instrumentation.yaml@self + parameters: + configuration: $(XA.Build.Configuration) + testName: Mono.Android.NET_Tests-NoAot + project: tests/Mono.Android-Tests/Runtime-Microsoft.Android.Sdk/Mono.Android.NET-Tests.csproj + testResultsFiles: TestResult-Mono.Android.NET_Tests-$(XA.Build.Configuration)NoAot.xml + extraBuildArgs: -p:TestsFlavor=NoAot -p:RunAOTCompilation=false + artifactSource: bin/Test$(XA.Build.Configuration)/$(DotNetTargetFramework)-android/Mono.Android.NET_Tests-Signed.aab + artifactFolder: $(DotNetTargetFramework)-NoAot + + - template: /build-tools/automation/yaml-templates/apk-instrumentation.yaml@self + parameters: + configuration: $(XA.Build.Configuration) + testName: Mono.Android.NET_Tests-TrimModePartial + project: tests/Mono.Android-Tests/Runtime-Microsoft.Android.Sdk/Mono.Android.NET-Tests.csproj + testResultsFiles: TestResult-Mono.Android.NET_Tests-$(XA.Build.Configuration)TrimModePartial.xml + extraBuildArgs: -p:TestsFlavor=TrimModePartial -p:TrimMode=partial + artifactSource: bin/Test$(XA.Build.Configuration)/$(DotNetTargetFramework)-android/Mono.Android.NET_Tests-Signed.aab + artifactFolder: $(DotNetTargetFramework)-TrimModePartial + + - template: /build-tools/automation/yaml-templates/apk-instrumentation.yaml@self + parameters: + configuration: $(XA.Build.Configuration) + testName: Mono.Android.NET_Tests-AotLlvm + project: tests/Mono.Android-Tests/Runtime-Microsoft.Android.Sdk/Mono.Android.NET-Tests.csproj + testResultsFiles: TestResult-Mono.Android.NET_Tests-$(XA.Build.Configuration)AotLlvm.xml + 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 + + - template: /build-tools/automation/yaml-templates/apk-instrumentation.yaml@self + parameters: + configuration: $(XA.Build.Configuration) + testName: Xamarin.Android.JcwGen_Tests + project: tests/CodeGen-Binding/Xamarin.Android.JcwGen-Tests/Xamarin.Android.JcwGen-Tests.csproj + testResultsFiles: TestResult-Xamarin.Android.JcwGen_Tests-$(XA.Build.Configuration).xml + artifactSource: bin/Test$(XA.Build.Configuration)/$(DotNetTargetFramework)-android/Xamarin.Android.JcwGen_Tests-Signed.apk + artifactFolder: $(DotNetTargetFramework)-Default + + - template: /build-tools/automation/yaml-templates/run-nunit-tests.yaml@self + parameters: + testRunTitle: Xamarin.Android.Tools.Aidl-Tests - macOS + testAssembly: $(System.DefaultWorkingDirectory)/bin/Test$(XA.Build.Configuration)/$(DotNetStableTargetFramework)/Xamarin.Android.Tools.Aidl-Tests.dll + + - task: ShellScript@2 + displayName: Test dotnet-local.sh + inputs: + scriptPath: dotnet-local.sh + args: build samples/HelloWorld/HelloWorld/HelloWorld.DotNet.csproj + + - ${{ if ne(parameters.macTestAgentsUseCleanImages, true) }}: + - template: /build-tools/automation/yaml-templates/start-stop-emulator.yaml@self + parameters: + command: stop + + - template: /build-tools/automation/yaml-templates/upload-results.yaml@self + parameters: + artifactName: Test Results - APKs .NET $(XA.Build.Configuration) - macOS 2 + + - template: /build-tools/automation/yaml-templates/upload-results.yaml@self + parameters: + artifactName: Test Results - APKs .NET Debug - macOS 2 + configuration: Debug + + - template: /build-tools/automation/yaml-templates/fail-on-issue.yaml@self