-
Notifications
You must be signed in to change notification settings - Fork 8.1k
Pass -UserScope as required by RunUpdateHelpTests #13400
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
I am lost why passing a **Scope** to a function that accepts **UserScope** would have any good results. I think the current behaviour is that the tests are skipped because `-not $userscope`, as evidenced by the following test log entry: > Validate Update-Help -SourcePath for all PowerShell modules for user scope..Validate Update-Help for module 'Microsoft.PowerShell.Core' with scope as 'False'
iSazonov
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We lost this tracking in #6352 (comment)
| { | ||
|
|
||
| It "Validate Update-Help for module '$moduleName' with scope as '$userscope'" -Skip:(!(Test-CanWriteToPsHome) -and $userscope -eq $false) { | ||
| It "Validate Update-Help for module '$moduleName' with user scope as '$userscope'" -Skip:(!(Test-CanWriteToPsHome) -and $userscope -eq $false) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is not correct. Please try something like:
| It "Validate Update-Help for module '$moduleName' with user scope as '$userscope'" -Skip:(!(Test-CanWriteToPsHome) -and $userscope -eq $false) { | |
| It "Validate Update-Help for module '$moduleName' with $(if ($userscope) 'User' else 'AllScope') scope" -Skip:(!(Test-CanWriteToPsHome) -and $userscope -eq $false) { |
| $params = @{Path = $testCases[$moduleName].HelpInstallationPath} | ||
| $updateScope = @{Scope = 'AllUsers'} | ||
| } | ||
| It "Validate Update-Help for module '$moduleName' in '$updateScope'" -Skip:(!(Test-CanWriteToPsHome) -and $userscope -eq $false) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
'$updateScope' returns "System.Collections.Hashtable". Yes?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am deeply ashamed of myself. I assumed it would be nicely expanded in a string. I am working on it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We could simply add new variable for the test name.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would rather be as deep to the metal as possible in a test log.
|
@yecril71pl Thank you for your PR. Please have a look at the failures. |
iSazonov
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@yecril71pl 99% of the PR is unrelated changes. Please fix only UserScope issue and move rest of changes in follow PR.
|
This pull request has been automatically marked as Review Needed because it has been there has not been any activity for 7 days. |
andyleejordan
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I resolved the other requested changes as I don't think they're necessary and looked helpful for getting the tests to run again. However, spotted one real bug at the end that needs fixing (the test is no longer validating the correct function).
|
This PR has Quantification details
Why proper sizing of changes matters
Optimal pull request sizes drive a better predictable PR flow as they strike a
What can I do to optimize my changes
How to interpret the change counts in git diff output
Was this comment helpful? 👍 :ok_hand: :thumbsdown: (Email) |
|
Wow, long time no see 😄 Is there anything you want me to do about this? I sincerely hope it will move forward without me 😉 |
andyleejordan
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's all good @yecril71pl! CI passed with my bug-fix, approving. Thanks for your contribution!
|
🎉 Handy links: |
PR Summary
The function
RunUpdateHelpTestsdoes not expect to getScopebut UserScope. I modified the calls accordingly.PR Context
I am lost why passing a Scope to a function that accepts UserScope would have any good results. I think the current behaviour is that the tests are skipped because
$userscope -eq $false, as evidenced by the following test log entry:… and erroneously marked as passed.
PR Checklist
.h,.cpp,.cs,.ps1and.psm1files have the correct copyright headerWIP:or[ WIP ]to the beginning of the title (theWIPbot will keep its status check atPendingwhile the prefix is present) and remove the prefix when the PR is ready.