Add ARM64 runtime test coverage #5815
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
After 5.5 years, fixes #820.
Commits
New-AzGalleryImageDefinitiondoesn't need the original Publisher/Offer/Sku.Archparameter toprovision-image.ps1.create-1es-hosted-pool.ps1to tellprovision-image.ps1what to do.provision-image.ps1inspect thePROCESSOR_ARCHITECTUREdidn't work for a curious reason. When executed in New PowerShell, this accurately reportsARM64. However, in a Command Prompt or Old PowerShell, thePROCESSOR_ARCHITECTUREis reported asx86. (Andprovision-image.ps1is executed in Old PowerShell, because it's what installs New PowerShell). I still don't fully understand why this happens (I suspect it's a compatibility layer), but it's easy enough to avoid.$Archwith-ieq(case-insensitive equality) since that's how the parameterValidateSetworks.vsDevCmdBatby hardcoding"C:\Program Files".ProgramFilesenvironment variable was expanding to"C:\Program Files (x86)"in Command Prompts and Old PowerShell (see environment variable investigation below), but VS correctly installs itself to"C:\Program Files". There's nothing to be gained from this environment variable parameterization, since it's only used for the CI machines, whose environment we fully control.numeric.limits.members/traps.pass.cppfor Clang.:2 FAIL(i.e. expected failure for Clang). The MSVC-internal test harness will outright skip anything that's mentioned for any reason, so it was never running this test for ARM64 and therefore never discovered that it was unexpectedly passing.poolNameis the classic x64 pool (at this time I saw no value in renaming it tox64PoolName). The newarm64PoolNameis separately prepared, and takes care of the ARM64-hosted checks.azure-pipelines.ymlthen uses the ARM64 pool for 'Build and Test ARM64'. We set thehostArchtoarm64(yay for previously parameterizing this), and we droptestsBuildOnly: trueso we'll perform normal execution of the tests.How to create ARM64 pools
In
create-1es-hosted-pool.ps1, theArchis now a mandatory parameter instead of hardcoded. Again I compare it case-insensitively with-ieq. For x64, we do everything the same (redundantly adding one bit of info at the end). For ARM64, we select Standard_D32ps_v6 (32-core Azure Cobalt 100 without local storage). I'm using 32 VMs, half the size of our x64 pool. And I'm using 2025-datacenter-azure-edition-arm64 via a Direct Shared Gallery, given to me by the Azure team.When calling
New-AzVMConfig, I have to set theDiskControllerTypeto'SCSI'because'NVMe'is not supported for this SKU. (I expect this will change with some future SKU, avoiding the need for this variation, but I have no info and couldn't share if I did.) I pass-SecurityType 'TrustedLaunch'to silence a notification message about Trusted Launch being available, even though this SKU and image indeed support Trusted Launch. Finally, I pass-SharedGalleryImageId, which is the only way I found to use this Direct Shared Gallery along with our other options.This supersedes the need to call
Set-AzVMSourceImage, which I've commented.When setting up the
New-AzGalleryImageDefinition, I again need to handle the NVMe vs. SCSI variation. We were already setting Trusted Launch, so no variation there. (At some point, possibly in the past, Trusted Launch By Default might make that setting unnecessary.)Finally,
New-AzGalleryImageDefinitiondefaults to x64, and will fail if asked to store an ARM64 image without explicitly being told so. Our$Archvaries in the correct way ('x64'vs.'arm64') so I'm directly passing that as theArchitecture.Seems simple? Only because I burned an incredible amount of time over the weekend figuring out this exact sequence of incantations from instructions that only vaguely gestured at them!
Environment Variable Investigation
Command Prompt
Old PowerShell (5.1.26100.6899)
New PowerShell (7.5.3)