From cb4f52d167059529f2758b7093bd175dec7e22f3 Mon Sep 17 00:00:00 2001 From: Ilya Date: Thu, 4 Jun 2020 12:29:15 +0500 Subject: [PATCH 1/4] Enable skipped tests --- .../Modules/Microsoft.PowerShell.Management/Clipboard.Tests.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/powershell/Modules/Microsoft.PowerShell.Management/Clipboard.Tests.ps1 b/test/powershell/Modules/Microsoft.PowerShell.Management/Clipboard.Tests.ps1 index 52f9e3317c6..d28394c9f26 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Management/Clipboard.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Management/Clipboard.Tests.ps1 @@ -13,7 +13,7 @@ Describe 'Clipboard cmdlet tests' -Tag CI { } AfterAll { - $PSDefaultParameterValues = $defaultParamValues + $global:PSDefaultParameterValues = $defaultParamValues } It 'Get-Clipboard returns what is in Set-Clipboard' { From 68851185b74535226a6e0969fb83080781754f60 Mon Sep 17 00:00:00 2001 From: Ilya Date: Thu, 4 Jun 2020 14:44:11 +0500 Subject: [PATCH 2/4] Skip FileSystem Provider Extended tests on Linux Pending two Linux tests --- .../FileSystemProviderExtended.Tests.ps1 | 9 ++++++++- .../Get-Process.Tests.ps1 | 2 ++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/test/powershell/Modules/Microsoft.PowerShell.Management/FileSystemProviderExtended.Tests.ps1 b/test/powershell/Modules/Microsoft.PowerShell.Management/FileSystemProviderExtended.Tests.ps1 index cdab0264fe7..e9c490d5392 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Management/FileSystemProviderExtended.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Management/FileSystemProviderExtended.Tests.ps1 @@ -1,8 +1,13 @@ # Copyright (c) Microsoft Corporation. # Licensed under the MIT License. -Describe "Extended FileSystem Provider Tests for Get-ChildItem cmdlet" -Tags "CI" { +Describe "FileSystem Provider Extended Tests for Get-ChildItem cmdlet" -Tags "CI" { BeforeAll { + $originalDefaultParameterValues = $PSDefaultParameterValues.Clone() + if ($IsLinux) { + $PSDefaultParameterValues["it:skip"] = $true + } + $restoreLocation = Get-Location $DirSep = [IO.Path]::DirectorySeparatorChar @@ -36,6 +41,8 @@ Describe "Extended FileSystem Provider Tests for Get-ChildItem cmdlet" -Tags "CI } AfterAll { + $global:PSDefaultParameterValues = $originalDefaultParameterValues + #restore the previous location Set-Location -Path $restoreLocation } diff --git a/test/powershell/Modules/Microsoft.PowerShell.Management/Get-Process.Tests.ps1 b/test/powershell/Modules/Microsoft.PowerShell.Management/Get-Process.Tests.ps1 index ef6fd1dbe5d..43e169c74ba 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Management/Get-Process.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Management/Get-Process.Tests.ps1 @@ -71,6 +71,8 @@ Describe "Get-Process" -Tags "CI" { } It "Test for process property = Name" { + $msg = Get-Process -Id $PID | fl * | Out-String + Write-Warning ">>> $PID; $msg" (Get-Process -Id $PID).Name | Should -BeExactly "pwsh" } From 1da45b3a21d96d3c6e4f626489bc96d1053df701 Mon Sep 17 00:00:00 2001 From: Ilya Date: Fri, 5 Jun 2020 15:23:28 +0500 Subject: [PATCH 3/4] Pending two Linux tests --- .../Microsoft.PowerShell.Management/Get-Process.Tests.ps1 | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/test/powershell/Modules/Microsoft.PowerShell.Management/Get-Process.Tests.ps1 b/test/powershell/Modules/Microsoft.PowerShell.Management/Get-Process.Tests.ps1 index 43e169c74ba..0cdee896b57 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Management/Get-Process.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Management/Get-Process.Tests.ps1 @@ -70,9 +70,8 @@ Describe "Get-Process" -Tags "CI" { { (Get-Process -Id $idleProcessPid).Name } | Should -Not -Throw } - It "Test for process property = Name" { - $msg = Get-Process -Id $PID | fl * | Out-String - Write-Warning ">>> $PID; $msg" + It "Test for process property = Name" -Pending { + # Bug in .Net 5.0 Preview4. See https://github.com/PowerShell/PowerShell/pull/12894 (Get-Process -Id $PID).Name | Should -BeExactly "pwsh" } @@ -125,7 +124,8 @@ Describe "Get-Process Formatting" -Tags "Feature" { } Describe "Process Parent property" -Tags "CI" { - It "Has Parent process property" { + It "Has Parent process property" -Pending { + # Bug in .Net 5.0 Preview4. See https://github.com/PowerShell/PowerShell/pull/12894 $powershellexe = (Get-Process -Id $PID).mainmodule.filename & $powershellexe -noprofile -command '(Get-Process -Id $PID).Parent' | Should -Not -BeNullOrEmpty } From 6bb956e9bc1247024e4a7f49b3d62d67d6e4902a Mon Sep 17 00:00:00 2001 From: Ilya Date: Fri, 5 Jun 2020 18:40:03 +0500 Subject: [PATCH 4/4] Pending Process.Parent test on Linux --- .../Microsoft.PowerShell.Management/Get-Process.Tests.ps1 | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/test/powershell/Modules/Microsoft.PowerShell.Management/Get-Process.Tests.ps1 b/test/powershell/Modules/Microsoft.PowerShell.Management/Get-Process.Tests.ps1 index 0cdee896b57..6143ddca0be 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Management/Get-Process.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Management/Get-Process.Tests.ps1 @@ -130,7 +130,8 @@ Describe "Process Parent property" -Tags "CI" { & $powershellexe -noprofile -command '(Get-Process -Id $PID).Parent' | Should -Not -BeNullOrEmpty } - It "Has valid parent process ID property" { + It "Has valid parent process ID property" -Pending { + # Bug. See https://github.com/PowerShell/PowerShell/issues/12908 $powershellexe = (Get-Process -Id $PID).mainmodule.filename & $powershellexe -noprofile -command '(Get-Process -Id $PID).Parent.Id' | Should -Be $PID }