Skip to content

[release/v7.4.15] Fix a preview detection test for the packaging script#27226

Merged
daxian-dbw merged 1 commit into
PowerShell:release/v7.4.15from
daxian-dbw:backport/release/v7.4.15/26882-7ca2b72af
Apr 9, 2026
Merged

[release/v7.4.15] Fix a preview detection test for the packaging script#27226
daxian-dbw merged 1 commit into
PowerShell:release/v7.4.15from
daxian-dbw:backport/release/v7.4.15/26882-7ca2b72af

Conversation

@daxian-dbw
Copy link
Copy Markdown
Member

Backport of #26882 to release/v7.4.15

Triggered by @daxian-dbw on behalf of @daxian-dbw

Original CL Label: CL-BuildPackaging

/cc @PowerShell/powershell-maintainers

Impact

REQUIRED: Choose either Tooling Impact or Customer Impact (or both). At least one checkbox must be selected.

Tooling Impact

  • Required tooling change
  • Optional tooling change (include reasoning)

Adjusts the packaging test for preview detection so the release/v7.4.15 branch validates the intended packaging behavior without changing shipped product code.

Customer Impact

  • Customer reported
  • Found internally

Regression

REQUIRED: Check exactly one box.

  • Yes
  • No

This is not a regression.

Testing

This backport is test-only. The original change updated packaging test expectations for preview detection, the cherry-pick applied cleanly to release/v7.4.15, and CI on the backport PR will validate the packaging test suite on the release branch.

Risk

REQUIRED: Check exactly one box.

  • High
  • Medium
  • Low

Low risk because the change only updates a packaging test and does not affect runtime or shipped binaries.

@daxian-dbw daxian-dbw added the CL-BuildPackaging Indicates that a PR should be marked as a build or packaging change in the Change Log label Apr 9, 2026
Copilot AI review requested due to automatic review settings April 9, 2026 06:55
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates the packaging Pester tests on release/v7.4.15 to validate preview detection behavior (including preview/RC versions) without changing shipped product code.

Changes:

  • Refactors the “package name for preview detection” verification into a parameterized Pester test using -TestCases.
  • Expands coverage to include both *-preview.* and *-rc.* version strings.

$incorrectCheck = $Name -like '*-preview'
$incorrectCheck | Should -Be $false -Because "Package name is 'powershell' not 'powershell-preview'"

param($Version)
Copy link

Copilot AI Apr 9, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

-TestCases supplies both Version and Name, but the test block only declares param($Version). In Pester, test case hashtables are splatted into the test scriptblock, so the extra Name key can cause a parameter-binding error. Either add $Name to the param block (even if only for the test name) or remove Name from the test cases and use <Version> in the title instead.

Suggested change
param($Version)
param($Version, $Name)

Copilot uses AI. Check for mistakes.
@daxian-dbw daxian-dbw merged commit 558af94 into PowerShell:release/v7.4.15 Apr 9, 2026
40 checks passed
@daxian-dbw daxian-dbw deleted the backport/release/v7.4.15/26882-7ca2b72af branch April 9, 2026 17:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CL-BuildPackaging Indicates that a PR should be marked as a build or packaging change in the Change Log

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants