Updated latest smoke-test to use dotnet 10 sdk and added a smoke-test…#29355
Updated latest smoke-test to use dotnet 10 sdk and added a smoke-test…#29355
Conversation
| Thanks for your contribution! The pull request validation has started. Please revisit this comment for updated status. |
There was a problem hiding this comment.
Pull request overview
This PR updates the Azure PowerShell release smoke-test pipeline to exercise newer runtime combinations by adding PowerShell 7.6 smoke tests and switching the “latest PowerShell” smoke tests to run with a .NET 10 SDK.
Changes:
- Added PowerShell 7.6 smoke-test jobs (Windows + Linux) in the release-test pipeline.
- Updated “latest PowerShell” smoke-test jobs to use .NET SDK 10.
- Added extra verification/error handling around PowerShell installation via
dotnet tool installin the smoke-test preparation script.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
tools/Test/SmokeTest/PrepareRequiredPowershell.ps1 |
Enhances installation logging and adds a verification step for dotnet tool install PowerShell (for newer .NET SDKs). |
.azure-pipelines/release-test.yml |
Introduces PS 7.6 smoke-test jobs and adds a .NET SDK 10 parameter; updates “latest” smoke tests to use it. |
| if ([Version](dotnet --version) -gt [Version]"9.0.0") { | ||
| if((dotnet tool list --local --format json | ConvertFrom-Json).data.where({ $_.packageId -eq 'powershell' }).Count -gt 0) { | ||
| Write-Host "PowerShell $requiredPsVersion has been installed successfully." | ||
| } else { | ||
| throw "Failed to install PowerShell $requiredPsVersion. Please ensure the PS version is correct and target framework of the package is compatible with the OS platform. Please refer to https://www.nuget.org/packages/PowerShell for more details." | ||
| } | ||
| } else { | ||
| Write-Host "Dotnet version is less than 9.0.0, skipping the verification of PowerShell installation" |
There was a problem hiding this comment.
[Version](dotnet --version) can throw when the SDK version contains prerelease/build metadata (e.g., 10.0.100-preview...). That would break smoke tests right when targeting 10.x. Consider parsing only the numeric portion (split on -) and using System.Version::TryParse (or similar) before comparing.
| if ([Version](dotnet --version) -gt [Version]"9.0.0") { | |
| if((dotnet tool list --local --format json | ConvertFrom-Json).data.where({ $_.packageId -eq 'powershell' }).Count -gt 0) { | |
| Write-Host "PowerShell $requiredPsVersion has been installed successfully." | |
| } else { | |
| throw "Failed to install PowerShell $requiredPsVersion. Please ensure the PS version is correct and target framework of the package is compatible with the OS platform. Please refer to https://www.nuget.org/packages/PowerShell for more details." | |
| } | |
| } else { | |
| Write-Host "Dotnet version is less than 9.0.0, skipping the verification of PowerShell installation" | |
| $dotnetVersionOutput = (dotnet --version).Trim() | |
| $dotnetVersionString = $dotnetVersionOutput.Split('-')[0] | |
| $dotnetVersion = $null | |
| if (-not [Version]::TryParse($dotnetVersionString, [ref]$dotnetVersion)) { | |
| Write-Host "Unable to parse .NET SDK version '$dotnetVersionOutput', skipping the verification of PowerShell installation" | |
| } | |
| elseif ($dotnetVersion -gt [Version]"9.0.0") { | |
| if((dotnet tool list --local --format json | ConvertFrom-Json).data.where({ $_.packageId -eq 'powershell' }).Count -gt 0) { | |
| Write-Host "PowerShell $requiredPsVersion has been installed successfully." | |
| } else { | |
| throw "Failed to install PowerShell $requiredPsVersion. Please ensure the PS version is correct and target framework of the package is compatible with the OS platform. Please refer to https://www.nuget.org/packages/PowerShell for more details." | |
| } | |
| } else { | |
| Write-Host "Dotnet version is less than or equal to 9.0.0, skipping the verification of PowerShell installation" |
| if((dotnet tool list --local --format json | ConvertFrom-Json).data.where({ $_.packageId -eq 'powershell' }).Count -gt 0) { | ||
| Write-Host "PowerShell $requiredPsVersion has been installed successfully." | ||
| } else { | ||
| throw "Failed to install PowerShell $requiredPsVersion. Please ensure the PS version is correct and target framework of the package is compatible with the OS platform. Please refer to https://www.nuget.org/packages/PowerShell for more details." | ||
| } |
There was a problem hiding this comment.
The verification logic assumes (dotnet tool list --local --format json | ConvertFrom-Json).data exists and is non-null. If the JSON schema differs (or the command emits non-JSON output), this will throw a null/method-invocation error rather than the intended failure message. Consider guarding for missing properties / ConvertFrom-Json failures and using Where-Object with null checks before deciding success/failure.
| dotnet tool install PowerShell | ||
| } | ||
| else { | ||
| dotnet tool install PowerShell --version $requiredPsVersion | ||
| } | ||
| if ([Version](dotnet --version) -gt [Version]"9.0.0") { |
There was a problem hiding this comment.
It is not necessary to check the dotnet version. The exception is on purpose to notify us when new version of dotnet and/or powershell are rolled out.
There was a problem hiding this comment.
The dotnet version check was to ensure "dotnet tool list" had the Json output option (was failing when testing PS 5.4). I added the check so the error clearly states the failure to install PowerShell compared to the previously thrown error "Cannot find a tool in the manifest file that has a command named 'pwsh'."
Happy to remove the updated error if you'd prefer
There was a problem hiding this comment.
@thomas-temby do you mean even after line 33 and line 36, powershell is still not installed?
There was a problem hiding this comment.
Yes, the error message when trying to install with a invalid sdk is "Unhandled exception: Settings file 'DotnetToolSettings.xml' was not found in the package." but does not cause the job to fail and is non-descript to someone that doesn't have prior knowledge
There was a problem hiding this comment.
The version check here would cause additional maintenance work because every time when new .NET SDK is released, you need to update the version number. Additionally, in most of the situations, the issue won't happen except for new PS version rollout. The latest job OS_Latest_PS_SmokeTest is also a duplicate of OS_PS7_6_X_SmokeTest since latest now equals to 7.6. So it is not worth any efforts here. In live test, I have removed the latest jobs and add a new PS version detection job instead. #29360
|
Hi @thomas-temby, please resolve comments from @vidai-msft |
| - job: CheckLatestPowerShellVersion | ||
| displayName: Check for latest PowerShell version | ||
| pool: | ||
| vmImage: ${{ variables.linuxAgentPoolName }} |
There was a problem hiding this comment.
CheckLatestPowerShellVersion uses pool: vmImage: ${{ variables.os_linux }}, but os_linux is not defined anywhere in this pipeline (and the rest of this file uses self-hosted pool names like pool-ubuntu-2404). This job will fail to start due to an unresolved variable / incorrect pool schema. Use the same pool pattern as the smoke-test jobs (e.g., pool: name: ${{ variables.linuxAgentPoolName }}) or define os_linux appropriately if you intended a Microsoft-hosted image.
| vmImage: ${{ variables.linuxAgentPoolName }} | |
| name: ${{ variables.linuxAgentPoolName }} |
| targetType: filePath | ||
| filePath: ./tools/TestFx/Live/CheckLatestPowerShellVersion.ps1 | ||
| env: | ||
| POWERSHELLLATEST: ${{ parameters.ps7_6 }} |
There was a problem hiding this comment.
CheckLatestPowerShellVersion.ps1 treats POWERSHELLLATEST as a major.minor string (casts it to System.Version after appending .0). Passing ${{ parameters.ps7_6 }} (default 7.6.*) will cause a FormatException and fail the job. Consider either sanitizing the value in YAML (pass 7.6) or updating the script to strip a trailing .* before version comparison.
| POWERSHELLLATEST: ${{ parameters.ps7_6 }} | |
| POWERSHELLLATEST: ${{ replace(parameters.ps7_6, '.*', '') }} |
| targetType: filePath | ||
| filePath: ./tools/TestFx/Live/CheckLatestPowerShellVersion.ps1 | ||
| env: | ||
| POWERSHELLLATEST: ${{ parameters.psLatest }} |
There was a problem hiding this comment.
This should be pipeline variable and no need to define here.
| displayName: PowerShell 7.6.x Version | ||
| type: string | ||
| default: 7.6.* | ||
| - name: psLatest |
There was a problem hiding this comment.
psLatest can be removed.
34e7d31 to
b1a0e11
Compare
…ved re-validation for ps installation Using a seperate parameter for PS latest to allow version parsing
| ## Version 1.1.1 | ||
| * Added breaking change announcements for upcoming SecureString parameter type changes in `New-AzStackHCIVMImage` and `New-AzStackHCIVMVirtualMachine` | ||
|
|
There was a problem hiding this comment.
This change log now has two identical '## Version 1.1.1' sections, which will duplicate release notes. Remove the duplicated entry (and ensure new notes go under '## Upcoming Release' per the header guidance).
| ## Version 1.1.1 | |
| * Added breaking change announcements for upcoming SecureString parameter type changes in `New-AzStackHCIVMImage` and `New-AzStackHCIVMVirtualMachine` |
| ## Upcoming Release | ||
|
|
||
| ## Version 1.1.1 | ||
| * Added breaking change announcements for upcoming SecureString parameter type changes in `New-AzStackHCIVMImage` and `New-AzStackHCIVMVirtualMachine` |
There was a problem hiding this comment.
PR description indicates this is a smoke-test pipeline-only change and selects 'No need for a release', but this PR modifies module ChangeLog.md content. These changelog edits look unrelated and should be reverted (or the PR description/checkbox updated if a user-facing release note is intended).
| ## Version 1.2.3 | ||
| * Added announcement for upcoming breaking changes as part of the 2025-10-01-preview API migration: | ||
| - Removed parameter `ActionBlockResponseCode` from `New-AzDnsResolverPolicyDnsSecurityRule` and `Update-AzDnsResolverPolicyDnsSecurityRule`. The block response code is no longer configurable. | ||
| - Parameter `DnsResolverDomainList` is no longer mandatory on `New-AzDnsResolverPolicyDnsSecurityRule`. DNS security rules will support managed domain lists as an alternative to user-defined domain lists. | ||
| - Parameter `Domain` is no longer mandatory on `New-AzDnsResolverDomainList`. Domain lists will support bulk upload via the new cmdlet `Invoke-AzDnsResolverBulkDnsResolverDomainList`, which will be introduced in the upcoming release. |
There was a problem hiding this comment.
This file repeats the entire '## Version 1.2.3' section twice. Remove the duplicate to avoid publishing the same breaking-change announcement twice (and keep new notes under '## Upcoming Release' rather than introducing a second identical version header).
| ## Version 1.20.0 | ||
| * Added `-DisableLocalAuth` parameter to `New-AzCosmosDBAccount` and `Update-AzCosmosDBAccount` to opt out of local authentication. | ||
| * Added `-Capabilities` parameter to `Update-AzCosmosDBAccount` to allow adding or removing account capabilities. | ||
|
|
There was a problem hiding this comment.
This change log now contains duplicate '## Version 1.20.0' entries with the same bullet points. Remove the duplicated version section to prevent duplicate release notes.
| ## Version 1.20.0 | |
| * Added `-DisableLocalAuth` parameter to `New-AzCosmosDBAccount` and `Update-AzCosmosDBAccount` to opt out of local authentication. | |
| * Added `-Capabilities` parameter to `Update-AzCosmosDBAccount` to allow adding or removing account capabilities. |
b1a0e11 to
f736dfd
Compare
| default: 10.x | ||
|
|
||
| variables: | ||
| POWERSHELLLATEST: 7.6 |
There was a problem hiding this comment.
POWERSHELLLATEST is a hard-coded duplicate of the highest tested PS minor version (currently ps7_6). This creates a maintenance hazard if the test matrix is updated (e.g., ps7_7) but POWERSHELLLATEST isn’t changed, leading to false warnings/incorrect version checks. Consider deriving it from parameters.ps7_6 (e.g., stripping .*) or making it a parameter so it’s updated in one place.
| POWERSHELLLATEST: 7.6 | |
| POWERSHELLLATEST: ${{ replace(parameters.ps7_6, '.*', '') }} |
d7b70e5 to
19b968d
Compare
19b968d to
c3dd648
Compare
Description
Mandatory Checklist
Please choose the target release of Azure PowerShell. (⚠️ Target release is a different concept from API readiness. Please click below links for details.)
Check this box to confirm: I have read the Submitting Changes section of
CONTRIBUTING.mdand reviewed the following information:ChangeLog.mdfile(s) appropriatelysrc/{{SERVICE}}/{{SERVICE}}/ChangeLog.md.## Upcoming Releaseheader in the past tense.ChangeLog.mdif no new release is required, such as fixing test case only.