Conversation
| { | ||
| param ([string]$ModuleName, [string]$Tag = 'CI') | ||
|
|
||
| # Update-Help fails if module path is Not writable, so skip tests in this situation |
There was a problem hiding this comment.
Why the path can be read only if we run the tests with 'RequireAdminOnWindows' tag? Do you means Unix where we haven't still such tag?
There was a problem hiding this comment.
Yes, we do not run the tests under sudo on Linux.
There was a problem hiding this comment.
Perhaps we should not complicate these tests if we want to implement #5645?
There was a problem hiding this comment.
I believe we need to go through a bunch to tests when #5645 is done. We can revert these changes then.
| { | ||
| $readonly = $_.Exception.GetType().Name -eq 'UnauthorizedAccessException' | ||
| } | ||
| Remove-Item -Path $filepath -ErrorAction SilentlyContinue |
| { | ||
| param ([string]$ModuleName, [string]$Tag = 'CI') | ||
|
|
||
| # Update-Help fails if module path is Not writable, so skip tests in this situation |
There was a problem hiding this comment.
Yes, we do not run the tests under sudo on Linux.
| $modulesInBox = @("Microsoft.PowerShell.Core" | ||
| Get-Module -ListAvailable | ForEach-Object{$_.Name} | ||
| ) | ||
| function PathIsReadOnly |
There was a problem hiding this comment.
Can we move this function to a common file and then dot source it in both the test files.
| $skip = PathIsReadOnly $modulePath | ||
| } | ||
|
|
||
| # -Skip and -$Pending are mutually exclusive on It block, so skip Pending tests |
There was a problem hiding this comment.
Skip and Pending have specific meanings. you can use splatting to choose one of them for the It block.
|
this is covered by #6223 . |
PR Summary
Currently building PS is required on a test machine for a test pass to succeed.
One of the test work items is to decouple test passes from build requirement; i.e. tests should be runnable on released PS packages.
This PR fixes test code (Update-Help tests) that currently fail on released PS packages.
Test results (

test\powershell\engine\Help) before fix:Test results (

test\powershell\engine\Help) after fix:PR Checklist
Note: Please mark anything not applicable to this PR
NA.[feature]if the change is significant or affects feature testsWIP:to the beginning of the title and remove the prefix when the PR is ready.