mirror of
https://github.com/PowerShell/PowerShell
synced 2026-06-08 12:12:50 +00:00
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:
@@ -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') {
|
||||
|
||||
Reference in New Issue
Block a user