8000 Jameswtruher/travisdaily2 (#2842) · PowerShell/PowerShell@9aa693d · GitHub
[go: up one dir, main page]

Skip to content

Commit 9aa693d

Browse files
JamesWTruherTravisEz13
authored andcommitted
Jameswtruher/travisdaily2 (#2842)
* 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
1 parent 2fe1055 commit 9aa693d

File tree

4 files changed

+82
-14
lines changed

4 files changed

+82
-14
lines changed

test/powershell/Modules/PackageManagement/PackageManagement.Tests.ps1

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -18,40 +18,44 @@ $InternalSource = 'OneGetTestSource'
1818

1919

2020
Describe "PackageManagement Acceptance Test" -Tags "Feature" {
21-
21+
2222
BeforeAll{
2323
Register-PackageSource -Name Nugettest -provider NuGet -Location https://www.nuget.org/api/v2 -force
2424
Register-PackageSource -Name $InternalSource -Location $InternalGallery -ProviderName 'PowerShellGet' -Trusted -ErrorAction SilentlyContinue
25-
25+
$SavedProgressPreference = $ProgressPreference
26+
$ProgressPreference = "SilentlyContinue"
27+
}
28+
AfterAll {
29+
$ProgressPreference = $SavedProgressPreference
2630
}
2731
It "get-packageprovider" {
28-
32+
2933
$gpp = Get-PackageProvider
30-
34+
3135
$gpp | ?{ $_.name -eq "NuGet" } | should not BeNullOrEmpty
32-
33-
$gpp | ?{ $_.name -eq "PowerShellGet" } | should not BeNullOrEmpty
36+
37+
$gpp | ?{ $_.name -eq "PowerShellGet" } | should not BeNullOrEmpty
3438
}
3539

3640

3741
It "find-packageprovider PowerShellGet" {
38-
$fpp = (Find-PackageProvider -Name "PowerShellGet" -force).name
42+
$fpp = (Find-PackageProvider -Name "PowerShellGet" -force).name
3943
$fpp -contains "PowerShellGet" | should be $true
4044
}
4145

4246
It "install-packageprovider, Expect succeed" {
43-
$ipp = (install-PackageProvider -name gistprovider -force -source $InternalSource -Scope CurrentUser).name
44-
$ipp -contains "gistprovider" | should be $true
47+
$ipp = (install-PackageProvider -name gistprovider -force -source $InternalSource -Scope CurrentUser).name
48+
$ipp -contains "gistprovider" | should be $true
4549
}
46-
50+
4751

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

5357
it "Install-package" {
54-
$i = install-Package -ProviderName NuGet -Name jquery -force -source Nugettest -Scope CurrentUser
58+
$i = install-Package -ProviderName NuGet -Name jquery -force -source Nugettest -Scope CurrentUser
5559
$i.Name -contains "jquery" | should be $true
5660
}
5761

test/powershell/engine/Help/HelpSystem.OnlineHelp.Tests.ps1

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88
# (when calling get-help -online) might not matched the one in the csv file.
99

1010
BeforeAll {
11+
$SavedProgressPreference = $ProgressPreference
12+
$ProgressPreference = "SilentlyContinue"
1113

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

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

2932
foreach ($filePath in @("$PSScriptRoot\assets\HelpURI\V2Cmdlets.csv", "$PSScriptRoot\assets\HelpURI\V3Cmdlets.csv"))

test/powershell/engine/Help/HelpSystem.Tests.ps1

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,17 +63,33 @@ function RunTestCase
6363
}
6464

6565
Describe "Validate that get-help <cmdletName> works" -Tags @('CI', 'RequireAdminOnWindows') {
66-
66+
BeforeAll {
67+
$SavedProgressPreference = $ProgressPreference
68+
$ProgressPreference = "SilentlyContinue"
69+
}
70+
AfterAll {
71+
$ProgressPreference = $SavedProgressPreference
72+
}
6773
RunTestCase -tag "CI"
6874
}
6975

7076
Describe "Validate Get-Help for all cmdlets in 'Microsoft.PowerShell.Core'" -Tags @('Feature', 'RequireAdminOnWindows') {
77+
BeforeAll {
78+
$SavedProgressPreference = $ProgressPreference
79+
$ProgressPreference = "SilentlyContinue"
80+
}
81+
AfterAll {
82+
$ProgressPreference = $SavedProgressPreference
83+
}
7184

7285
RunTestCase -tag "Feature"
7386
}
7487

7588
Describe "Validate that Get-Help returns provider-specific help" -Tags @('CI', 'RequireAdminOnWindows') {
7689
BeforeAll {
90+
$SavedProgressPreference = $ProgressPreference
91+
$ProgressPreference = "SilentlyContinue"
92+
7793
$namespaces = @{
7894
command = 'http://schemas.microsoft.com/maml/dev/command/2004/10'
7995
dev = 'http://schemas.microsoft.com/maml/dev/2004/10'
@@ -119,6 +135,9 @@ Describe "Validate that Get-Help returns provider-specific help" -Tags @('CI', '
119135
UpdateHelpFromLocalContentPath -ModuleName 'Microsoft.PowerShell.Core' -Tag 'CI'
120136
}
121137

138+
AfterAll {
139+
$ProgressPreference = $SavedProgressPreference
140+
}
122141
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 {
123142
param($helpFile, $path, $helpContext, $verb, $noun)
124143

test/powershell/engine/Help/UpdatableHelpSystem.Tests.ps1

Lines changed: 44 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ $testCases = @{
4141
}
4242

4343
<#
44-
This scenario is broken due to issue # https://github.com/PowerShell/platyPS/issues/241
44+
This scenario is broken due to issue # https://github.com/PowerShell/platyPS/issues/241
4545
Re-enable when issue is fixed.
4646
"Microsoft.PowerShell.Archive" = @{
4747
HelpFiles = "Microsoft.PowerShell.Archive.psm1-help.xml"
@@ -141,7 +141,7 @@ function GetFiles
141141
[ValidateNotNullOrEmpty()]
142142
[string]$path
143143
)
144-
144+
145145
Get-ChildItem $path -Include $fileType -Recurse -ea SilentlyContinue | Select-Object -ExpandProperty FullName
146146
}
147147

@@ -275,29 +275,71 @@ function ValidateSaveHelp
275275
}
276276

277277
Describe "Validate Update-Help from the Web for one PowerShell Core module." -Tags @('CI', 'RequireAdminOnWindows') {
278+
BeforeAll {
279+
$SavedProgressPreference = $ProgressPreference
280+
$ProgressPreference = "SilentlyContinue"
281+
}
282+
AfterAll {
283+
$ProgressPreference = $SavedProgressPreference
284+
}
278285

279286
RunUpdateHelpTests -tag "CI" -Pending
280287
}
281288

282289
Describe "Validate Update-Help from the Web for all PowerShell Core modules." -Tags @('Feature', 'RequireAdminOnWindows') {
290+
BeforeAll {
291+
$SavedProgressPreference = $ProgressPreference
292+
$ProgressPreference = "SilentlyContinue"
293+
}
294+
AfterAll {
295+
$ProgressPreference = $SavedProgressPreference
296+
}
283297

284298
RunUpdateHelpTests -tag "Feature"
285299
}
286300

287301
Describe "Validate Update-Help -SourcePath for one PowerShell Core module." -Tags @('CI', 'RequireAdminOnWindows') {
302+
BeforeAll {
303+
$SavedProgressPreference = $ProgressPreference
304+
$ProgressPreference = "SilentlyContinue"
305+
}
306+
AfterAll {
307+
$ProgressPreference = $SavedProgressPreference
308+
}
288309

289310
RunUpdateHelpTests -tag "CI" -useSourcePath
290311
}
291312

292313
Describe "Validate Update-Help -SourcePath for all PowerShell Core modules." -Tags @('Feature', 'RequireAdminOnWindows') {
314+
BeforeAll {
315+
$SavedProgressPreference = $ProgressPreference
316+
$ProgressPreference = "SilentlyContinue"
317+
}
318+
AfterAll {
319+
$ProgressPreference = $SavedProgressPreference
320+
}
293321

294322
RunUpdateHelpTests -tag "Feature" -useSourcePath
295323
}
296324

297325
Describe "Validate 'Save-Help -DestinationPath for one PowerShell Core modules." -Tags @('CI', 'RequireAdminOnWindows') {
326+
BeforeAll {
327+
$SavedProgressPreference = $ProgressPreference
328+
$ProgressPreference = "SilentlyContinue"
329+
}
330+
AfterAll {
331+
$ProgressPreference = $SavedProgressPreference
332+
}
298333
RunSaveHelpTests -tag "CI" -Pending
299334
}
300335

301336
Describe "Validate 'Save-Help -DestinationPath for all PowerShell Core modules." -Tags @('Feature', 'RequireAdminOnWindows') {
337+
BeforeAll {
338+
$SavedProgressPreference = $ProgressPreference
339+
$ProgressPreference = "SilentlyContinue"
340+
}
341+
AfterAll {
342+
$ProgressPreference = $SavedProgressPreference
343+
}
302344
RunSaveHelpTests -tag "Feature"
303345
}

0 commit comments

Comments
 (0)
0