Skip to content

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

Open
TravisEz13 wants to merge 1 commit intoPowerShell:release/v7.4from
TravisEz13:backport/release/v7.4/26882-7ca2b72af
Open

[release/v7.4] Fix a preview detection test for the packaging script#26894
TravisEz13 wants to merge 1 commit intoPowerShell:release/v7.4from
TravisEz13:backport/release/v7.4/26882-7ca2b72af

Conversation

@TravisEz13
Copy link
Member

@TravisEz13 TravisEz13 commented Feb 25, 2026

Backport of #26882 to release/v7.4

Triggered by @TravisEz13 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)

Fixes a preview detection test in the packaging script that is needed for correct package release validation.

Customer Impact

  • Customer reported
  • Found internally

Regression

REQUIRED: Check exactly one box.

  • Yes
  • No

This is not a regression.

Testing

Test verified by running packaging script on release/v7.4 branch. Confirming preview detection works correctly in test suite.

Risk

REQUIRED: Check exactly one box.

  • High
  • Medium
  • Low

This is a test fix for the packaging script. Tests do not execute in production, and the change is localized to test validation. Risk is minimal.

Copilot AI review requested due to automatic review settings February 25, 2026 20:56
@TravisEz13 TravisEz13 added the CL-BuildPackaging Indicates that a PR should be marked as a build or packaging change in the Change Log label Feb 25, 2026
Copy link
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

This PR backports a test fix from #26882 to the release/v7.4 branch. The change refactors a preview detection test in the packaging script to use parameterized test cases, improving test coverage for both preview and RC version strings.

Changes:

  • Converted a single test case into a parameterized test with two test cases covering both "preview" and "rc" version strings
  • Simplified test code by removing redundant verification of the incorrect logic
  • Enhanced test description to include the variant being tested via <Name> placeholder
Comments suppressed due to low confidence (1)

test/packaging/packaging.tests.ps1:56

  • The test cases define a Name property (@{ Version = "7.6.0-preview.6"; Name = "Preview" }), but the param block only declares $Version. According to Pester conventions (as seen throughout the codebase), all properties in test case hashtables must be declared in the param block, even if they're only used in the test description via <Name>.

The param block should declare both parameters:
param($Version, $Name)

            param($Version)

@microsoft-github-policy-service microsoft-github-policy-service bot added the Review - Needed The PR is being reviewed label Mar 4, 2026
@microsoft-github-policy-service
Copy link
Contributor

This pull request has been automatically marked as Review Needed because it has been there has not been any activity for 7 days.
Maintainer, please provide feedback and/or mark it as Waiting on Author

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 Review - Needed The PR is being reviewed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants