-
Notifications
You must be signed in to change notification settings - Fork 538
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[ci] Parallelize and reduce overhead of MSBuild test stage. (#7850)
Bring the AzDO parallelization from #7804 and environment setup improvements from #7832 to `Xamarin.Android.Build.Tests.csproj` based test suites. This includes both the main `MSBuild` stage and the `Smoke Tests` jobs. Increases parallelization of all jobs as many were approaching ~90 minutes. As there is no longer a place in the `MSBuild` stage to run `Xamarin.Android.Tools.Aidl-Tests` tests, it was moved to the `macOS > Tests > APKs .NET` stage. This suite should be fine to only run on Mac and not Windows. (Note this test assembly was also updated to .NET 7. This required moving it from `Xamarin.Android-Tests.sln` which is currently built with Mono which cannot build .NET 7+ projects. It now is built via `Xamarin.Android.sln`.)
- Loading branch information
Showing
60 changed files
with
160 additions
and
342 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
build-tools/automation/yaml-templates/install-dotnet-test-slicer.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
parameters: | ||
version: '0.1.0-alpha1' | ||
version: '0.1.0-alpha2' | ||
condition: succeeded() | ||
continueOnError: true | ||
|
||
|
66 changes: 0 additions & 66 deletions
66
build-tools/automation/yaml-templates/run-msbuild-mac-tests.yaml
This file was deleted.
Oops, something went wrong.
54 changes: 54 additions & 0 deletions
54
build-tools/automation/yaml-templates/run-msbuild-tests.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
parameters: | ||
testOS: # 'macOS' or 'Windows' | ||
jobName: # Name of the job | ||
jobDisplayName: # Display name of the job | ||
agentCount: # Number of build agents to run in parallel | ||
testFilter: # Filter used to select tests (NUnit test selection language, not dotnet test filter language) | ||
installApkDiff: false # Smoke tests use apkdiff, others do not | ||
|
||
jobs: | ||
- job: ${{ parameters.jobName }} | ||
strategy: | ||
parallel: ${{ parameters.agentCount }} | ||
displayName: ${{ parameters.jobDisplayName }} | ||
${{ if eq(parameters.testOS, 'Windows') }}: | ||
pool: $(1ESWindowsPool) | ||
${{ if eq(parameters.testOS, 'macOS') }}: | ||
pool: | ||
vmImage: $(HostedMacImage) | ||
timeoutInMinutes: 180 | ||
cancelTimeoutInMinutes: 5 | ||
steps: | ||
- ${{ if eq(parameters.testOS, 'Windows') }}: | ||
- script: netsh int ipv4 set global sourceroutingbehavior=drop | ||
|
||
- template: kill-processes.yaml | ||
|
||
- template: clean.yaml | ||
|
||
- template: setup-test-environment.yaml | ||
parameters: | ||
provisionClassic: false | ||
installTestSlicer: true | ||
installApkDiff: ${{ parameters.installApkDiff }} | ||
installLegacyDotNet: false | ||
restoreNUnitConsole: false | ||
updateMono: false | ||
|
||
- task: DownloadPipelineArtifact@2 | ||
inputs: | ||
artifactName: $(TestAssembliesArtifactName) | ||
downloadPath: $(System.DefaultWorkingDirectory)/bin/Test$(XA.Build.Configuration) | ||
|
||
- template: run-sliced-nunit-tests.yaml | ||
parameters: | ||
testAssembly: $(System.DefaultWorkingDirectory)/bin/Test$(XA.Build.Configuration)/$(DotNetStableTargetFramework)/Xamarin.Android.Build.Tests.dll | ||
testFilter: ${{ parameters.testFilter }} $(ExcludedNUnitCategories) | ||
testRunTitle: Xamarin.Android.Build.Tests - ${{ parameters.testOS }} | ||
testResultsTitle: TestResult-MSBuildTests-${{ parameters.jobName }} | ||
|
||
- template: upload-results.yaml | ||
parameters: | ||
artifactName: Test Results - MSBuild - ${{ parameters.testOS }}-$(System.JobPositionInPhase) | ||
|
||
- template: fail-on-issue.yaml |
Oops, something went wrong.