Mark flaky Update-Help web tests as pending to unblock CI (#26796)

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: TravisEz13 <10873629+TravisEz13@users.noreply.github.com>
This commit is contained in:
Copilot
2026-02-13 03:57:33 +00:00
committed by GitHub
co-authored by TravisEz13
parent 4db414ca33
commit 6b8d724b03
2 changed files with 226 additions and 7 deletions
@@ -191,7 +191,8 @@ function RunUpdateHelpTests
param (
[string]$tag = "CI",
[switch]$useSourcePath,
[switch]$userscope
[switch]$userscope,
[switch]$markAsPending
)
foreach ($moduleName in $modulesInBox)
@@ -214,8 +215,15 @@ function RunUpdateHelpTests
It ('Validate Update-Help for module ''{0}'' in {1}' -F $moduleName, [PSCustomObject] $updateScope) -Skip:(!(Test-CanWriteToPsHome) -and $userscope -eq $false) {
if ($markAsPending) {
Set-ItResult -Pending -Because "Update-Help from the web has intermittent connectivity issues. See issues #2807 and #6541."
return
}
# Delete the whole help directory
Remove-Item ($moduleHelpPath) -Recurse -Force -ErrorAction SilentlyContinue
if ($moduleHelpPath) {
Remove-Item ($moduleHelpPath) -Recurse -Force -ErrorAction SilentlyContinue
}
[hashtable] $UICultureParam = $(if ((Get-UICulture).Name -ne $myUICulture) { @{ UICulture = $myUICulture } } else { @{} })
[hashtable] $sourcePathParam = $(if ($useSourcePath) { @{ SourcePath = Join-Path $PSScriptRoot assets } } else { @{} })
@@ -246,8 +254,15 @@ function RunSaveHelpTests
{
try
{
$saveHelpFolder = Join-Path $TestDrive (Get-Random).ToString()
New-Item $saveHelpFolder -Force -ItemType Directory > $null
$saveHelpFolder = if ($TestDrive) {
Join-Path $TestDrive (Get-Random).ToString()
} else {
$null
}
if ($saveHelpFolder) {
New-Item $saveHelpFolder -Force -ItemType Directory > $null
}
## Save help has intermittent connectivity issues for downloading PackageManagement help content.
## Hence the test has been marked as Pending.
@@ -283,7 +298,9 @@ function RunSaveHelpTests
}
finally
{
Remove-Item $saveHelpFolder -Force -ErrorAction SilentlyContinue -Recurse
if ($saveHelpFolder) {
Remove-Item $saveHelpFolder -Force -ErrorAction SilentlyContinue -Recurse
}
}
}
}
@@ -316,7 +333,9 @@ Describe "Validate Update-Help from the Web for one PowerShell module." -Tags @(
$ProgressPreference = $SavedProgressPreference
}
RunUpdateHelpTests -Tag "CI"
## Update-Help from the web has intermittent connectivity issues that cause CI failures.
## Tests are marked as Pending to unblock work. See issues #2807 and #6541.
RunUpdateHelpTests -Tag "CI" -MarkAsPending
}
Describe "Validate Update-Help from the Web for one PowerShell module for user scope." -Tags @('CI', 'RequireAdminOnWindows', 'RequireSudoOnUnix') {
@@ -328,7 +347,9 @@ Describe "Validate Update-Help from the Web for one PowerShell module for user s
$ProgressPreference = $SavedProgressPreference
}
RunUpdateHelpTests -Tag "CI" -UserScope
## Update-Help from the web has intermittent connectivity issues that cause CI failures.
## Tests are marked as Pending to unblock work. See issues #2807 and #6541.
RunUpdateHelpTests -Tag "CI" -UserScope -MarkAsPending
}
Describe "Validate Update-Help from the Web for all PowerShell modules." -Tags @('Feature', 'RequireAdminOnWindows', 'RequireSudoOnUnix') {