From 3a42af0ba2a7e5aea29b0b4f8bbd68bf88a5c45f Mon Sep 17 00:00:00 2001 From: Jonathan Pobst Date: Fri, 20 Dec 2024 11:52:03 -1000 Subject: [PATCH] [CI] Break "Linux Tests" into 2 parallel jobs. --- build-tools/automation/azure-pipelines.yaml | 61 +------------ .../yaml-templates/stage-linux-tests.yaml | 87 +++++++++++++++++++ 2 files changed, 88 insertions(+), 60 deletions(-) create mode 100644 build-tools/automation/yaml-templates/stage-linux-tests.yaml diff --git a/build-tools/automation/azure-pipelines.yaml b/build-tools/automation/azure-pipelines.yaml index a4a9311e0bd..4dbf996a2f1 100644 --- a/build-tools/automation/azure-pipelines.yaml +++ b/build-tools/automation/azure-pipelines.yaml @@ -108,66 +108,7 @@ extends: parameters: macTestAgentsUseCleanImages: ${{ parameters.macTestAgentsUseCleanImages }} - - stage: linux_tests - displayName: Linux Tests - dependsOn: - - mac_build - - linux_build - jobs: - # Check - "Xamarin.Android (Linux Tests Linux > Tests > MSBuild)" - - job: linux_tests_smoke - displayName: Linux > Tests > MSBuild - pool: - name: MAUI-1ESPT - image: $(LinuxPoolImage1ESPT) - os: linux - timeoutInMinutes: 180 - workspace: - clean: all - steps: - - template: /build-tools/automation/yaml-templates/setup-test-environment.yaml@self - - - task: DownloadPipelineArtifact@2 - inputs: - artifactName: $(TestAssembliesArtifactName) - downloadPath: $(System.DefaultWorkingDirectory)/bin/Test$(XA.Build.Configuration) - - - template: /build-tools/automation/yaml-templates/run-nunit-tests.yaml@self - parameters: - testRunTitle: Xamarin.Android.Build.Tests - Linux BuildTest - testAssembly: $(System.DefaultWorkingDirectory)/bin/Test$(XA.Build.Configuration)/$(DotNetStableTargetFramework)/Xamarin.Android.Build.Tests.dll - dotNetTestExtraArgs: --filter "Name = BuildTest" - - - template: /build-tools/automation/yaml-templates/run-nunit-tests.yaml@self - parameters: - testRunTitle: Xamarin.Android.Build.Tests - Linux PackagingTest - 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@self - parameters: - testRunTitle: Xamarin.Android.Build.Tests - Linux XASdkTests - 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@self - parameters: - testRunTitle: Xamarin.Android.Build.Tests - Linux AndroidDependenciesTests - testAssembly: $(System.DefaultWorkingDirectory)/bin/Test$(XA.Build.Configuration)/$(DotNetStableTargetFramework)/Xamarin.Android.Build.Tests.dll - dotNetTestExtraArgs: --filter "Name = AndroidDependenciesTests" - - - task: ShellScript@2 - displayName: Test dotnet-local.sh - inputs: - scriptPath: dotnet-local.sh - args: build samples/HelloWorld/HelloWorld/HelloWorld.DotNet.csproj - - - template: /build-tools/automation/yaml-templates/upload-results.yaml@self - parameters: - configuration: $(XA.Build.Configuration) - artifactName: Test Results - MSBuild - Linux - - - template: /build-tools/automation/yaml-templates/fail-on-issue.yaml@self + - template: /build-tools/automation/yaml-templates/stage-linux-tests.yaml@self - template: /build-tools/automation/yaml-templates/stage-msbuild-tests.yaml@self diff --git a/build-tools/automation/yaml-templates/stage-linux-tests.yaml b/build-tools/automation/yaml-templates/stage-linux-tests.yaml new file mode 100644 index 00000000000..acef28df385 --- /dev/null +++ b/build-tools/automation/yaml-templates/stage-linux-tests.yaml @@ -0,0 +1,87 @@ +# Runs smoke tests on Linux packages. + +stages: +- stage: linux_tests + displayName: Linux Tests + dependsOn: + - mac_build + - linux_build + jobs: + # Check - "Xamarin.Android (Linux Tests Linux > Tests > MSBuild)" + - job: linux_tests_smoke_1 + displayName: Linux > Tests > MSBuild 1 + pool: + name: MAUI-1ESPT + image: $(LinuxPoolImage1ESPT) + os: linux + timeoutInMinutes: 180 + workspace: + clean: all + steps: + - template: /build-tools/automation/yaml-templates/setup-test-environment.yaml@self + + - task: DownloadPipelineArtifact@2 + inputs: + artifactName: $(TestAssembliesArtifactName) + downloadPath: $(System.DefaultWorkingDirectory)/bin/Test$(XA.Build.Configuration) + + - template: /build-tools/automation/yaml-templates/run-nunit-tests.yaml@self + parameters: + testRunTitle: Xamarin.Android.Build.Tests - Linux BuildTest + 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@self + parameters: + configuration: $(XA.Build.Configuration) + artifactName: Test Results - MSBuild - Linux 1 + + - template: /build-tools/automation/yaml-templates/fail-on-issue.yaml@self + + - job: linux_tests_smoke_2 + displayName: Linux > Tests > MSBuild 2 + pool: + name: MAUI-1ESPT + image: $(LinuxPoolImage1ESPT) + os: linux + timeoutInMinutes: 180 + workspace: + clean: all + steps: + - template: /build-tools/automation/yaml-templates/setup-test-environment.yaml@self + + - task: DownloadPipelineArtifact@2 + inputs: + artifactName: $(TestAssembliesArtifactName) + downloadPath: $(System.DefaultWorkingDirectory)/bin/Test$(XA.Build.Configuration) + + - template: /build-tools/automation/yaml-templates/run-nunit-tests.yaml@self + parameters: + testRunTitle: Xamarin.Android.Build.Tests - Linux PackagingTest + 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@self + parameters: + testRunTitle: Xamarin.Android.Build.Tests - Linux XASdkTests + 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@self + parameters: + testRunTitle: Xamarin.Android.Build.Tests - Linux AndroidDependenciesTests + testAssembly: $(System.DefaultWorkingDirectory)/bin/Test$(XA.Build.Configuration)/$(DotNetStableTargetFramework)/Xamarin.Android.Build.Tests.dll + dotNetTestExtraArgs: --filter "Name = AndroidDependenciesTests" + + - task: ShellScript@2 + displayName: Test dotnet-local.sh + inputs: + scriptPath: dotnet-local.sh + args: build samples/HelloWorld/HelloWorld/HelloWorld.DotNet.csproj + + - template: /build-tools/automation/yaml-templates/upload-results.yaml@self + parameters: + configuration: $(XA.Build.Configuration) + artifactName: Test Results - MSBuild - Linux 2 + + - template: /build-tools/automation/yaml-templates/fail-on-issue.yaml@self