Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Update-Help test updates#6093

Closed
anmenaga wants to merge 11 commits into
PowerShell:masterPowerShell/PowerShell:masterfrom
anmenaga:UpdateHelpTestUpdatesanmenaga/PowerShell:UpdateHelpTestUpdatesCopy head branch name to clipboard
Closed

Update-Help test updates#6093
anmenaga wants to merge 11 commits into
PowerShell:masterPowerShell/PowerShell:masterfrom
anmenaga:UpdateHelpTestUpdatesanmenaga/PowerShell:UpdateHelpTestUpdatesCopy head branch name to clipboard

Conversation

@anmenaga

@anmenaga anmenaga commented Feb 2, 2018

Copy link
Copy Markdown

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:
beforefix

Test results (test\powershell\engine\Help) after fix:
afterfix

PR Checklist

Note: Please mark anything not applicable to this PR NA.

@anmenaga anmenaga added the WG-Quality-Test issues in a test or in test infrastructure label Feb 2, 2018
{
param ([string]$ModuleName, [string]$Tag = 'CI')

# Update-Help fails if module path is Not writable, so skip tests in this situation

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, we do not run the tests under sudo on Linux.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps we should not complicate these tests if we want to implement #5645?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add -Force.

{
param ([string]$ModuleName, [string]$Tag = 'CI')

# Update-Help fails if module path is Not writable, so skip tests in this situation

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, we do not run the tests under sudo on Linux.

$modulesInBox = @("Microsoft.PowerShell.Core"
Get-Module -ListAvailable | ForEach-Object{$_.Name}
)
function PathIsReadOnly

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Skip and Pending have specific meanings. you can use splatting to choose one of them for the It block.

@adityapatwardhan

adityapatwardhan commented Feb 20, 2018

Copy link
Copy Markdown
Member

@anmenaga Now that RequiresSudoOnUnix is available. We can simplify the logic over here. Please have a look at: #6145

@adityapatwardhan

Copy link
Copy Markdown
Member

I believe #6223 should fix the issue this PR is trying to fix.
@anmenaga if you agree, please close the PR.

@anmenaga

Copy link
Copy Markdown
Author

this is covered by #6223 .

@anmenaga anmenaga closed this Mar 14, 2018
@anmenaga anmenaga deleted the UpdateHelpTestUpdates branch October 31, 2018 21:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

WG-Quality-Test issues in a test or in test infrastructure

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

Morty Proxy This is a proxified and sanitized view of the page, visit original site.