{{ message }}
Repository navigation
Tag WinPE- and min-size-incompatible Pester tests - #28177
Open
Justin Chung (jshigetomi) wants to merge 2 commits into
Open
Justin Chung (jshigetomi) wants to merge 2 commits into
Justin Chung (jshigetomi) wants to merge 2 commits into
Conversation
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
Two Windows PowerShell-dependent tests can falsely pass in WinPE, and one pending path continues executing assertions.
4 open findings
What changed in this PR
Adds outermost NotWinPE tags to exclude tests requiring unavailable WinPE capabilities while retaining compatible coverage.
Changes:
- Splits mixed Pester suites for Pester 4 tag filtering.
- Tags remoting, MI, WinCompat, desktop, and native-tool tests.
- Corrects remote
Copy-Itemdestination assertions.
| File | Description |
|---|---|
Host/HostUtilities.Tests.ps1 |
Tags remote-runspace tests. |
Host/TabCompletion/TabCompletion.Tests.ps1 |
Separates WinPE-incompatible completion suites. |
Language/Scripting/Indexer.Tests.ps1 |
Isolates CIM indexer tests. |
Language/Scripting/NativeExecution/NativeCommandArguments.Tests.ps1 |
Tags script-host tests. |
Language/Scripting/NativeExecution/NativeCommandProcessor.Tests.ps1 |
Tags native utility and VHD tests. |
Language/Scripting/OrderedAttributeForHashTables.Tests.ps1 |
Isolates CIM ordered-property tests. |
Modules/Microsoft.PowerShell.Core/CompatiblePSEditions.Module.Tests.ps1 |
Partitions local and WinCompat coverage. |
Modules/Microsoft.PowerShell.Core/Enter-PSHostProcess.Tests.ps1 |
Isolates Windows PowerShell host tests. |
Modules/Microsoft.PowerShell.Core/Get-PSHostProcessInfo.Tests.ps1 |
Isolates Windows PowerShell discovery. |
Modules/Microsoft.PowerShell.Core/Import-Module.Tests.ps1 |
Tags GAC-dependent module tests. |
Modules/Microsoft.PowerShell.Core/Job.Tests.ps1 |
Isolates PowerShell 5.1 jobs. |
Modules/Microsoft.PowerShell.Management/Copy-Item.Tests.ps1 |
Separates remote tests and fixes assertions. |
Modules/Microsoft.PowerShell.Management/FileSystem.Tests.ps1 |
Tags desktop and Storage-dependent tests. |
Modules/Microsoft.PowerShell.Management/Get-ChildItem.Tests.ps1 |
Isolates volume-path coverage. |
Modules/Microsoft.PowerShell.Management/Get-Service.Tests.ps1 |
Isolates security-descriptor tests. |
Modules/Microsoft.PowerShell.Management/Set-Service.Tests.ps1 |
Separates unsupported service operations. |
Modules/Microsoft.PowerShell.Management/Start-Process.Tests.ps1 |
Isolates native sort coverage. |
Modules/Microsoft.PowerShell.Security/CertificateProvider.Tests.ps1 |
Tags installed-certificate tests. |
Modules/Microsoft.PowerShell.Security/CmsMessage.Tests.ps1 |
Separates embedded and installed certificates. |
Modules/Microsoft.PowerShell.Security/ConstrainedLanguageRestriction.Tests.ps1 |
Isolates desktop COM activation. |
Modules/Microsoft.PowerShell.Utility/Get-FileHash.Tests.ps1 |
Isolates page-file hashing. |
Modules/Microsoft.PowerShell.Utility/Invoke-Item.Tests.ps1 |
Isolates desktop folder invocation. |
Modules/Microsoft.PowerShell.Utility/New-Object.Tests.ps1 |
Separates Windows Update COM tests. |
engine/Module/ModulePath.Tests.ps1 |
Separates Windows PowerShell path tests. |
engine/Security/FileSignature.Tests.ps1 |
Tags generated-certificate signature tests. |
🧠 Review effort: Balanced
💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.
| param($inputStr, $expected) | ||
|
|
||
| if (Test-IsWindowsArm64) { | ||
| Set-ItResult -Pending -Because "TBD" |
Comment on lines
+1812
to
+1813
| Describe "WinCompat command error handling" -Tag "CI" { | ||
| It 'ErrorAction should be used for cmdlet' -Skip:(-not $IsWindows) { |
Comment on lines
+108
to
+112
| It 'Windows PowerShell does not inherit path defined in powershell.config.json' -Skip:(!$IsWindows) { | ||
| try { | ||
| $userConfig = '{ "PSModulePath": "myUserPath" }' | ||
| Set-Content -Path $userConfigPath -Value $userConfig -Force | ||
| $out = & $powershell -noprofile -command 'powershell.exe -noprofile -command `$env:PSModulePath' |
| $PSDefaultParameterValues["it:skip"] = ![System.Management.Automation.Platform]::IsWindowsDesktop | ||
|
|
||
| Describe "New-Object COM functionality" -Tags "CI" { | ||
| It "Should fail with correct error when creating a COM object that dose not exist" { |
Contributor
Add filterable top-level NotWinPE and NotMinSize suites for capabilities unavailable in base WinPE or the min-size build. Preserve compatible validation and offline-event coverage, and keep ambiguous failures enabled for reruns. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: eaee217d-4a12-4dea-bf6d-229736936172
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



PR Summary
Adds filterable
NotWinPEandNotMinSizemetadata to PowerShell Pester tests based on the exhaustive PowerShell 7.6.8 WinPE x64 min-size run.NotWinPEtag lines for tests that require capabilities absent from base WinPE, including native MI/CIM/CDXML, remoting and WSMan, Event Log infrastructure, desktop services and COM registrations, machine lifecycle operations, Windows PowerShell integration, and online help acquisition.NotMinSizetag lines for WPF, Windows Forms, and localized satellite assemblies intentionally omitted by the min-size build.PR Context
The WinPE lane runs the signed x64 min-size runtime as
SYSTEMin a base WinPE guest with Pester 4.10.1. The diagnostic run discovered all 418 test files and recorded 13,913 cases, including 589 guest-side failures.Pester 4.10.1 accepts tag syntax on nested
Contextblocks but does not honor those tags during-ExcludeTagfiltering. All compatibility tags in this PR are therefore on outermostDescribegroups. Mixed suites were partitioned while preserving their normal test matrices and inherited setup.The intended WinPE invocation is:
The Release-Automation lane will enable that filter only after its coordinated test package contains these tags.
Validation
NotWinPEandNotMinSizetags are on filterable outermost test groups; none are onItblocks or nested Pester groups.Get-WinEvent,New-WinEvent,Get-ComputerInfo, COM, and localized resources.Get-Counterexclusions were deliberately removed pending a WinPE rerun with the helper correction.PR Checklist
.h,.cpp,.cs,.ps1and.psm1files have the correct copyright header