Skip to content

Commit

Permalink
Jameswtruher/travisdaily2 (PowerShell#2842)
Browse files Browse the repository at this point in the history
* Assign $ProgressPreference = "SilentlyContinue" to reduce output size

Travis is still complaining that the log file is too big, eliminating progress is
another step to reducing output. It's also not needed for our CI environment.

* Removed white space at end of lines

* fix misplacement of progress preference setting

also fix up trailing whitespace
  • Loading branch information
JamesWTruher authored and TravisEz13 committed Dec 6, 2016
1 parent 2fe1055 commit 9aa693d
Show file tree
Hide file tree
Showing 4 changed files with 82 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,40 +18,44 @@ $InternalSource = 'OneGetTestSource'


Describe "PackageManagement Acceptance Test" -Tags "Feature" {

BeforeAll{
Register-PackageSource -Name Nugettest -provider NuGet -Location https://www.nuget.org/api/v2 -force
Register-PackageSource -Name $InternalSource -Location $InternalGallery -ProviderName 'PowerShellGet' -Trusted -ErrorAction SilentlyContinue

$SavedProgressPreference = $ProgressPreference
$ProgressPreference = "SilentlyContinue"
}
AfterAll {
$ProgressPreference = $SavedProgressPreference
}
It "get-packageprovider" {

$gpp = Get-PackageProvider

$gpp | ?{ $_.name -eq "NuGet" } | should not BeNullOrEmpty
$gpp | ?{ $_.name -eq "PowerShellGet" } | should not BeNullOrEmpty

$gpp | ?{ $_.name -eq "PowerShellGet" } | should not BeNullOrEmpty
}


It "find-packageprovider PowerShellGet" {
$fpp = (Find-PackageProvider -Name "PowerShellGet" -force).name
$fpp = (Find-PackageProvider -Name "PowerShellGet" -force).name
$fpp -contains "PowerShellGet" | should be $true
}

It "install-packageprovider, Expect succeed" {
$ipp = (install-PackageProvider -name gistprovider -force -source $InternalSource -Scope CurrentUser).name
$ipp -contains "gistprovider" | should be $true
$ipp = (install-PackageProvider -name gistprovider -force -source $InternalSource -Scope CurrentUser).name
$ipp -contains "gistprovider" | should be $true
}


it "Find-package" {
$f = Find-Package -ProviderName NuGet -Name jquery -source Nugettest
$f.Name -contains "jquery" | should be $true
}

it "Install-package" {
$i = install-Package -ProviderName NuGet -Name jquery -force -source Nugettest -Scope CurrentUser
$i = install-Package -ProviderName NuGet -Name jquery -force -source Nugettest -Scope CurrentUser
$i.Name -contains "jquery" | should be $true
}

Expand Down
3 changes: 3 additions & 0 deletions test/powershell/engine/Help/HelpSystem.OnlineHelp.Tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
# (when calling get-help -online) might not matched the one in the csv file.

BeforeAll {
$SavedProgressPreference = $ProgressPreference
$ProgressPreference = "SilentlyContinue"

# Enable the test hook
[system.management.automation.internal.internaltesthooks]::SetTestHook('BypassOnlineHelpRetrieval', $true)
Expand All @@ -24,6 +26,7 @@

# Disable the test hook
[system.management.automation.internal.internaltesthooks]::SetTestHook('BypassOnlineHelpRetrieval', $false)
$ProgressPreference = $SavedProgressPreference
}

foreach ($filePath in @("$PSScriptRoot\assets\HelpURI\V2Cmdlets.csv", "$PSScriptRoot\assets\HelpURI\V3Cmdlets.csv"))
Expand Down
21 changes: 20 additions & 1 deletion test/powershell/engine/Help/HelpSystem.Tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -63,17 +63,33 @@ function RunTestCase
}

Describe "Validate that get-help <cmdletName> works" -Tags @('CI', 'RequireAdminOnWindows') {

BeforeAll {
$SavedProgressPreference = $ProgressPreference
$ProgressPreference = "SilentlyContinue"
}
AfterAll {
$ProgressPreference = $SavedProgressPreference
}
RunTestCase -tag "CI"
}

Describe "Validate Get-Help for all cmdlets in 'Microsoft.PowerShell.Core'" -Tags @('Feature', 'RequireAdminOnWindows') {
BeforeAll {
$SavedProgressPreference = $ProgressPreference
$ProgressPreference = "SilentlyContinue"
}
AfterAll {
$ProgressPreference = $SavedProgressPreference
}

RunTestCase -tag "Feature"
}

Describe "Validate that Get-Help returns provider-specific help" -Tags @('CI', 'RequireAdminOnWindows') {
BeforeAll {
$SavedProgressPreference = $ProgressPreference
$ProgressPreference = "SilentlyContinue"

$namespaces = @{
command = 'http://schemas.microsoft.com/maml/dev/command/2004/10'
dev = 'http://schemas.microsoft.com/maml/dev/2004/10'
Expand Down Expand Up @@ -119,6 +135,9 @@ Describe "Validate that Get-Help returns provider-specific help" -Tags @('CI', '
UpdateHelpFromLocalContentPath -ModuleName 'Microsoft.PowerShell.Core' -Tag 'CI'
}

AfterAll {
$ProgressPreference = $SavedProgressPreference
}
It -Skip:(-not $IsWindows) "shows contextual help when Get-Help is invoked for provider-specific path (Get-Help -Name <verb>-<noun> -Path <path>)" -TestCases $testCases {
param($helpFile, $path, $helpContext, $verb, $noun)

Expand Down
46 changes: 44 additions & 2 deletions test/powershell/engine/Help/UpdatableHelpSystem.Tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ $testCases = @{
}

<#
This scenario is broken due to issue # https://github.com/PowerShell/platyPS/issues/241
This scenario is broken due to issue # https://github.com/PowerShell/platyPS/issues/241
Re-enable when issue is fixed.
"Microsoft.PowerShell.Archive" = @{
HelpFiles = "Microsoft.PowerShell.Archive.psm1-help.xml"
Expand Down Expand Up @@ -141,7 +141,7 @@ function GetFiles
[ValidateNotNullOrEmpty()]
[string]$path
)

Get-ChildItem $path -Include $fileType -Recurse -ea SilentlyContinue | Select-Object -ExpandProperty FullName
}

Expand Down Expand Up @@ -275,29 +275,71 @@ function ValidateSaveHelp
}

Describe "Validate Update-Help from the Web for one PowerShell Core module." -Tags @('CI', 'RequireAdminOnWindows') {
BeforeAll {
$SavedProgressPreference = $ProgressPreference
$ProgressPreference = "SilentlyContinue"
}
AfterAll {
$ProgressPreference = $SavedProgressPreference
}

RunUpdateHelpTests -tag "CI" -Pending
}

Describe "Validate Update-Help from the Web for all PowerShell Core modules." -Tags @('Feature', 'RequireAdminOnWindows') {
BeforeAll {
$SavedProgressPreference = $ProgressPreference
$ProgressPreference = "SilentlyContinue"
}
AfterAll {
$ProgressPreference = $SavedProgressPreference
}

RunUpdateHelpTests -tag "Feature"
}

Describe "Validate Update-Help -SourcePath for one PowerShell Core module." -Tags @('CI', 'RequireAdminOnWindows') {
BeforeAll {
$SavedProgressPreference = $ProgressPreference
$ProgressPreference = "SilentlyContinue"
}
AfterAll {
$ProgressPreference = $SavedProgressPreference
}

RunUpdateHelpTests -tag "CI" -useSourcePath
}

Describe "Validate Update-Help -SourcePath for all PowerShell Core modules." -Tags @('Feature', 'RequireAdminOnWindows') {
BeforeAll {
$SavedProgressPreference = $ProgressPreference
$ProgressPreference = "SilentlyContinue"
}
AfterAll {
$ProgressPreference = $SavedProgressPreference
}

RunUpdateHelpTests -tag "Feature" -useSourcePath
}

Describe "Validate 'Save-Help -DestinationPath for one PowerShell Core modules." -Tags @('CI', 'RequireAdminOnWindows') {
BeforeAll {
$SavedProgressPreference = $ProgressPreference
$ProgressPreference = "SilentlyContinue"
}
AfterAll {
$ProgressPreference = $SavedProgressPreference
}
RunSaveHelpTests -tag "CI" -Pending
}

Describe "Validate 'Save-Help -DestinationPath for all PowerShell Core modules." -Tags @('Feature', 'RequireAdminOnWindows') {
BeforeAll {
$SavedProgressPreference = $ProgressPreference
$ProgressPreference = "SilentlyContinue"
}
AfterAll {
$ProgressPreference = $SavedProgressPreference
}
RunSaveHelpTests -tag "Feature"
}

0 comments on commit 9aa693d

Please sign in to comment.