PHANTOM
🇮🇳 IN
Skip to content

Relocate platform-agnostic packaging tests to Windows unit folder#26776

Draft
Copilot wants to merge 3 commits intomasterfrom
copilot/move-non-platform-tests-folder
Draft

Relocate platform-agnostic packaging tests to Windows unit folder#26776
Copilot wants to merge 3 commits intomasterfrom
copilot/move-non-platform-tests-folder

Conversation

Copy link
Contributor

Copilot AI commented Feb 10, 2026

Plan: Move non-platform-dependent packaging tests

  • Create a new folder test/packaging/windows/unit/ for non-platform-dependent unit tests
  • Move test/packaging/packaging.tests.ps1 to test/packaging/windows/unit/packaging.tests.ps1
  • Update paths in the moved test file to use Join-Path for cross-platform compatibility
  • Run the tests locally to ensure they work (all 7 tests pass)
  • Verify the tests will be picked up by Windows packaging CI (confirmed Invoke-Pester runs recursively on test/packaging/windows/)
  • Fix Windows path separator issue using Join-Path

Summary

Successfully moved the non-platform-dependent packaging tests from test/packaging/packaging.tests.ps1 to test/packaging/windows/unit/packaging.tests.ps1. This organizes the tests logically:

  • Platform-specific installation tests remain at the top level: test/packaging/windows/msi.tests.ps1 and test/packaging/windows/exe.tests.ps1
  • Non-platform-dependent unit tests for packaging module functions are now in: test/packaging/windows/unit/packaging.tests.ps1

The tests will automatically run with the Windows packaging tests in CI via the Invoke-CIFinish function, which uses Invoke-Pester -Script (Join-Path $repoRoot '.\test\packaging\windows\') to recursively find all test files.

Recent Fix

Fixed module import paths to use Join-Path instead of forward slashes (/) for proper cross-platform path construction. This resolves the Windows CI failure where mixed path separators caused module loading issues.

Original prompt

move these under a folder for non-platform dependent unit tests and run them with the windows packaging tests


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Co-authored-by: TravisEz13 <10873629+TravisEz13@users.noreply.github.com>
Copilot AI changed the title [WIP] Move unit tests to non-platform dependent folder Relocate platform-agnostic packaging tests to Windows unit folder Feb 10, 2026
Copilot AI requested a review from TravisEz13 February 10, 2026 17:47
@TravisEz13 TravisEz13 added CL-BuildPackaging Indicates that a PR should be marked as a build or packaging change in the Change Log BackPort-7.4.x-Consider BackPort-7.5.x-Consider BackPort-7.6.x-Consider labels Feb 10, 2026
@TravisEz13
Copy link
Member

@copilot tests failed with

program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
Import-Module: D:\a\PowerShell\PowerShell\test\packaging\windows\unit\packaging.tests.ps1:7
Line |
   7 |          Import-Module $PSScriptRoot/../../../../tools/packaging/packa …
     |          ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     | The specified module
     | 'D:\a\PowerShell\PowerShell\test\packaging\windows\unit/../../../../tools/packaging/packaging.psm1' was not
     | loaded because no valid module file was found in any module directory.

    Context Test-IsPreview function
      [+] Should return True for preview versions 41ms
      [+] Should return False for stable versions 2ms
      [+] Should return False for LTS builds regardless of version string 1ms

    Context Get-MacOSPackageIdentifierInfo function (New-MacOSPackage logic)
      [-] Should detect preview builds and return preview identifier 46ms
        CommandNotFoundException: The term 'Get-MacOSPackageIdentifierInfo' is not recognized as a name of a cmdlet, function, script file, or executable program.
        Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
        at <ScriptBlock>, D:\a\PowerShell\PowerShell\test\packaging\windows\unit\packaging.tests.ps1: line 29
      [-] Should detect stable builds and return stable identifier 48ms
        CommandNotFoundException: The term 'Get-MacOSPackageIdentifierInfo' is not recognized as a name of a cmdlet, function, script file, or executable program.
        Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
        at <ScriptBlock>, D:\a\PowerShell\PowerShell\test\packaging\windows\unit\packaging.tests.ps1: line 36
      [-] Should treat LTS builds as stable even with preview version string 47ms
        CommandNotFoundException: The term 'Get-MacOSPackageIdentifierInfo' is not recognized as a name of a cmdlet, function, script file, or executable program.
        Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
        at <ScriptBlock>, D:\a\PowerShell\PowerShell\test\packaging\windows\unit\packaging.tests.ps1: line 43
      [-] Should NOT use package name for preview detection (bug fix verification) 48ms
        CommandNotFoundException: The term 'Get-MacOSPackageIdentifierInfo' is not recognized as a name of a cmdlet, function, script file, or executable program.
        Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
        at <ScriptBlock>, D:\a\PowerShell\PowerShell\test\packaging\windows\unit\packaging.tests.ps1: line 62

Co-authored-by: TravisEz13 <10873629+TravisEz13@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Feb 12, 2026

@copilot tests failed with

...

Fixed in commit 2bc648e. The issue was using forward slashes (/) in path construction which caused mixed path separators on Windows. Changed to use Join-Path for proper cross-platform path handling.

Copilot AI requested a review from TravisEz13 February 12, 2026 17:20
@microsoft-github-policy-service microsoft-github-policy-service bot added the Waiting on Author The PR was reviewed and requires changes or comments from the author before being accept label Feb 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

BackPort-7.4.x-Consider BackPort-7.5.x-Consider BackPort-7.6.x-Consider CL-BuildPackaging Indicates that a PR should be marked as a build or packaging change in the Change Log Waiting on Author The PR was reviewed and requires changes or comments from the author before being accept

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants