From 98241a0253e872146df6452b2abfd9f77a70e5d6 Mon Sep 17 00:00:00 2001 From: Jonathan Pobst Date: Wed, 8 Jan 2025 11:56:44 -1000 Subject: [PATCH 1/5] [ci] Run tests on `macos-14-arm64` --- build-tools/automation/yaml-templates/variables.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build-tools/automation/yaml-templates/variables.yaml b/build-tools/automation/yaml-templates/variables.yaml index 48b60fe65f3..2ea28443aa9 100644 --- a/build-tools/automation/yaml-templates/variables.yaml +++ b/build-tools/automation/yaml-templates/variables.yaml @@ -30,7 +30,7 @@ variables: - name: GitHub.Token value: $(github--pat--vs-mobiletools-engineering-service2) - name: HostedMacImage - value: macOS-14 + value: macOS-14-arm64 - name: SharedMacPool value: VSEng-VSMac-Xamarin-Shared - name: SharedMacName From 0699d1f848378295f632e3fe007334a389059085 Mon Sep 17 00:00:00 2001 From: Jonathan Pobst Date: Thu, 9 Jan 2025 09:31:17 -1000 Subject: [PATCH 2/5] Emulator tests have to stay on Intel because arm64 images don't support nested virtualization. --- .../yaml-templates/stage-msbuild-emulator-tests.yaml | 4 ++-- .../automation/yaml-templates/stage-package-tests.yaml | 4 ++-- build-tools/automation/yaml-templates/variables.yaml | 2 ++ 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/build-tools/automation/yaml-templates/stage-msbuild-emulator-tests.yaml b/build-tools/automation/yaml-templates/stage-msbuild-emulator-tests.yaml index 43875cc2fca..aa27d4dc9a4 100644 --- a/build-tools/automation/yaml-templates/stage-msbuild-emulator-tests.yaml +++ b/build-tools/automation/yaml-templates/stage-msbuild-emulator-tests.yaml @@ -27,7 +27,7 @@ stages: displayName: "macOS > Tests > MSBuild+Emulator" pool: name: Azure Pipelines - vmImage: $(HostedMacImage) + vmImage: $(HostedMacImageWithEmulator) os: macOS timeoutInMinutes: 180 cancelTimeoutInMinutes: 5 @@ -89,7 +89,7 @@ stages: deviceName: wear_square pool: name: Azure Pipelines - vmImage: $(HostedMacImage) + vmImage: $(HostedMacImageWithEmulator) os: macOS workspace: clean: all diff --git a/build-tools/automation/yaml-templates/stage-package-tests.yaml b/build-tools/automation/yaml-templates/stage-package-tests.yaml index 60a495df5de..20511486a33 100644 --- a/build-tools/automation/yaml-templates/stage-package-tests.yaml +++ b/build-tools/automation/yaml-templates/stage-package-tests.yaml @@ -13,7 +13,7 @@ stages: displayName: macOS > Tests > APKs 1 pool: name: Azure Pipelines - vmImage: $(HostedMacImage) + vmImage: $(HostedMacImageWithEmulator) os: macOS timeoutInMinutes: 180 workspace: @@ -120,7 +120,7 @@ stages: displayName: macOS > Tests > APKs 2 pool: name: Azure Pipelines - vmImage: $(HostedMacImage) + vmImage: $(HostedMacImageWithEmulator) os: macOS timeoutInMinutes: 180 workspace: diff --git a/build-tools/automation/yaml-templates/variables.yaml b/build-tools/automation/yaml-templates/variables.yaml index 2ea28443aa9..fad6a4abe6c 100644 --- a/build-tools/automation/yaml-templates/variables.yaml +++ b/build-tools/automation/yaml-templates/variables.yaml @@ -31,6 +31,8 @@ variables: value: $(github--pat--vs-mobiletools-engineering-service2) - name: HostedMacImage value: macOS-14-arm64 +- name: HostedMacImageWithEmulator + value: macOS-14 - name: SharedMacPool value: VSEng-VSMac-Xamarin-Shared - name: SharedMacName From f792b4e6702fd59753a780e7ee1a03833538c1ec Mon Sep 17 00:00:00 2001 From: Jonathan Pobst Date: Thu, 9 Jan 2025 10:14:22 -1000 Subject: [PATCH 3/5] =?UTF-8?q?=EF=BB=BFUse=20`$(JAVA=5FHOME=5F17=5Farm64)?= =?UTF-8?q?`=20environment=20variable.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../yaml-templates/setup-test-environment.yaml | 15 +++++++++++++++ .../automation/yaml-templates/variables.yaml | 2 +- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/build-tools/automation/yaml-templates/setup-test-environment.yaml b/build-tools/automation/yaml-templates/setup-test-environment.yaml index e95a9782ece..b2c92c884d7 100644 --- a/build-tools/automation/yaml-templates/setup-test-environment.yaml +++ b/build-tools/automation/yaml-templates/setup-test-environment.yaml @@ -27,6 +27,21 @@ steps: jdkMajorVersion: ${{ parameters.jdkMajorVersion }} useAgentJdkPath: ${{ parameters.useAgentJdkPath }} +# If an explicit Java SDK path wasn't provided, choose JDK-17 for the appropriate architecture +- pwsh: | + Write-Host "##vso[task.setvariable variable=JI_JAVA_HOME]$env:JAVA_HOME_17_X64" + displayName: set JI_JAVA_HOME to JAVA_HOME_17_X64 + condition: and(succeeded(), eq('${{ parameters.jdkTestFolder }}', ''), eq(variables['agent.osarchitecture'], 'X64')) + +- pwsh: | + Write-Host "##vso[task.setvariable variable=JI_JAVA_HOME]$env:JAVA_HOME_17_arm64" + displayName: set JI_JAVA_HOME to JAVA_HOME_17_arm64 + condition: and(succeeded(), eq('${{ parameters.jdkTestFolder }}', ''), eq(variables['agent.osarchitecture'], 'ARM64')) + +- script: | + echo $(JI_JAVA_HOME) + displayName: print JI_JAVA_HOME + # Install latest .NET - template: /build-tools/automation/yaml-templates/use-dot-net.yaml parameters: diff --git a/build-tools/automation/yaml-templates/variables.yaml b/build-tools/automation/yaml-templates/variables.yaml index fad6a4abe6c..d1abe276018 100644 --- a/build-tools/automation/yaml-templates/variables.yaml +++ b/build-tools/automation/yaml-templates/variables.yaml @@ -14,7 +14,7 @@ variables: - name: WindowsToolchainPdbArtifactName value: windows-toolchain-pdb - name: ApkDiffToolVersion - value: 0.0.15 + value: 0.0.17 - name: TestSlicerToolVersion value: 0.1.0-alpha7 - name: BootsToolVersion From a29e99dddfb2ff88358ecd05f11359936450ecb5 Mon Sep 17 00:00:00 2001 From: Jonathan Pobst Date: Fri, 10 Jan 2025 08:45:26 -1000 Subject: [PATCH 4/5] =?UTF-8?q?=EF=BB=BFsetup-jdk-variables=20ARM64=20fix?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../yaml-templates/setup-jdk-variables.yaml | 6 +++--- .../yaml-templates/setup-test-environment.yaml | 15 --------------- 2 files changed, 3 insertions(+), 18 deletions(-) diff --git a/build-tools/automation/yaml-templates/setup-jdk-variables.yaml b/build-tools/automation/yaml-templates/setup-jdk-variables.yaml index 780952babd4..8282fcaf6a9 100644 --- a/build-tools/automation/yaml-templates/setup-jdk-variables.yaml +++ b/build-tools/automation/yaml-templates/setup-jdk-variables.yaml @@ -1,11 +1,11 @@ parameters: - jdkMajorVersion: $(DefaultJavaSdkMajorVersion) - useAgentJdkPath: true + jdkMajorVersion: $(DefaultJavaSdkMajorVersion) # Generally 11|17|21 + useAgentJdkPath: true # true to use preinstalled agent JDK, false to use 'android-toolchain/jdk-NN' steps: - pwsh: | $agentOS="$(Agent.OS)" - $agentArch="$(Agent.OSArchitecture)" + $agentArch="$(Agent.OSArchitecture)" -eq "ARM64" ? "arm64" : "$(Agent.OSArchitecture)" $jdkMajorVersion="${{ parameters.jdkMajorVersion }}" $xaPrepareJdkPath="$env:HOME/android-toolchain/jdk-$jdkMajorVersion" if ("$agentOS" -eq "Windows_NT") { diff --git a/build-tools/automation/yaml-templates/setup-test-environment.yaml b/build-tools/automation/yaml-templates/setup-test-environment.yaml index b2c92c884d7..e95a9782ece 100644 --- a/build-tools/automation/yaml-templates/setup-test-environment.yaml +++ b/build-tools/automation/yaml-templates/setup-test-environment.yaml @@ -27,21 +27,6 @@ steps: jdkMajorVersion: ${{ parameters.jdkMajorVersion }} useAgentJdkPath: ${{ parameters.useAgentJdkPath }} -# If an explicit Java SDK path wasn't provided, choose JDK-17 for the appropriate architecture -- pwsh: | - Write-Host "##vso[task.setvariable variable=JI_JAVA_HOME]$env:JAVA_HOME_17_X64" - displayName: set JI_JAVA_HOME to JAVA_HOME_17_X64 - condition: and(succeeded(), eq('${{ parameters.jdkTestFolder }}', ''), eq(variables['agent.osarchitecture'], 'X64')) - -- pwsh: | - Write-Host "##vso[task.setvariable variable=JI_JAVA_HOME]$env:JAVA_HOME_17_arm64" - displayName: set JI_JAVA_HOME to JAVA_HOME_17_arm64 - condition: and(succeeded(), eq('${{ parameters.jdkTestFolder }}', ''), eq(variables['agent.osarchitecture'], 'ARM64')) - -- script: | - echo $(JI_JAVA_HOME) - displayName: print JI_JAVA_HOME - # Install latest .NET - template: /build-tools/automation/yaml-templates/use-dot-net.yaml parameters: From 7ca1e8ac99fa008780ea80d901f77c166e9295fb Mon Sep 17 00:00:00 2001 From: Jonathan Pobst Date: Tue, 14 Jan 2025 10:27:13 -1000 Subject: [PATCH 5/5] Tweak parallelization. --- .../automation/yaml-templates/stage-msbuild-tests.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/build-tools/automation/yaml-templates/stage-msbuild-tests.yaml b/build-tools/automation/yaml-templates/stage-msbuild-tests.yaml index 434de192f42..54fb9005e16 100644 --- a/build-tools/automation/yaml-templates/stage-msbuild-tests.yaml +++ b/build-tools/automation/yaml-templates/stage-msbuild-tests.yaml @@ -22,7 +22,7 @@ stages: testOS: macOS jobName: mac_msbuild_tests jobDisplayName: macOS > Tests > MSBuild - agentCount: 14 + agentCount: 10 xaSourcePath: ${{ parameters.xaSourcePath }} repositoryAlias: ${{ parameters.repositoryAlias }} commit: ${{ parameters.commit }} @@ -34,7 +34,7 @@ stages: testOS: Windows jobName: win_msbuild_tests jobDisplayName: Windows > Tests > MSBuild - agentCount: 6 + agentCount: 8 xaSourcePath: ${{ parameters.xaSourcePath }} repositoryAlias: ${{ parameters.repositoryAlias }} commit: ${{ parameters.commit }}