-
Notifications
You must be signed in to change notification settings - Fork 8.3k
[release/v7.5] Fix a preview detection test for the packaging script #26966
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -46,18 +46,15 @@ Describe "Packaging Module Functions" { | |||||
| $result.PackageIdentifier | Should -Be "com.microsoft.powershell" | ||||||
| } | ||||||
|
|
||||||
| It "Should NOT use package name for preview detection (bug fix verification)" { | ||||||
| It "Should NOT use package name for preview detection (bug fix verification) - <Name>" -TestCases @( | ||||||
| @{ Version = "7.6.0-preview.6"; Name = "Preview" } | ||||||
| @{ Version = "7.6.0-rc.1"; Name = "RC" } | ||||||
| ) { | ||||||
| # This test verifies the fix for issue #26673 | ||||||
| # The bug was using ($Name -like '*-preview') which always returned false | ||||||
| # because preview builds use Name="powershell" not "powershell-preview" | ||||||
|
|
||||||
| $Version = "7.6.0-preview.6" | ||||||
| $Name = "powershell" # Preview builds use "powershell" not "powershell-preview" | ||||||
|
|
||||||
| # The INCORRECT logic (the bug): $Name -like '*-preview' | ||||||
| $incorrectCheck = $Name -like '*-preview' | ||||||
| $incorrectCheck | Should -Be $false -Because "Package name is 'powershell' not 'powershell-preview'" | ||||||
|
|
||||||
| param($Version) | ||||||
|
||||||
| param($Version) | |
| param($Version, $Name) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The test name/comment says it verifies that preview detection does not use the package name, but the updated test cases use
Name = "Preview"/"RC"only as a label and no longer demonstrate the failing package-name-based logic described in the comments. Either update the test description/comments to match what is actually being asserted (preview detection from version string), or reintroduce an assertion that shows the package-name check would fail (using a realistic package name like"powershell").