From a2c945574f0253bcbd27f82716ad3b56576b7332 Mon Sep 17 00:00:00 2001 From: Reece Dunham Date: Fri, 22 Feb 2019 13:59:58 -0500 Subject: [PATCH 01/13] Update comments in PowerShellGet tests for Travis CI --- test/powershell/Modules/PowerShellGet/PowerShellGet.Tests.ps1 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/powershell/Modules/PowerShellGet/PowerShellGet.Tests.ps1 b/test/powershell/Modules/PowerShellGet/PowerShellGet.Tests.ps1 index 48e5bbea370..f956438a0bd 100644 --- a/test/powershell/Modules/PowerShellGet/PowerShellGet.Tests.ps1 +++ b/test/powershell/Modules/PowerShellGet/PowerShellGet.Tests.ps1 @@ -158,7 +158,7 @@ Describe "PowerShellGet - Module tests (Admin)" -tags @('Feature', 'RequireAdmin Remove-InstalledModules } - ## Marked as 'Pending' on Linux for now because the test requires root privilege but we cannot do it now in our Travis CI Linux build + ## Marked as 'Pending' on Linux for now because the test requires root privilege but we cannot do it now in our Azure DevOps Linux build It "Should install a module correctly to the required location with AllUsers scope" -Pending:$IsLinux { Install-Module -Name $ContosoServer -Repository $RepositoryName -Scope AllUsers $installedModuleInfo = Get-InstalledModule -Name $ContosoServer @@ -228,7 +228,7 @@ Describe "PowerShellGet - Script tests (Admin)" -tags @('Feature', 'RequireAdmin Remove-InstalledScripts } - ## Marked as 'Pending' on Linux for now because the test requires root privilege but we cannot do it now in our Travis CI Linux build + ## Marked as 'Pending' on Linux for now because the test requires root privilege but we cannot do it now in our Azure DevOps Linux build It "Should install a script correctly to the required location with AllUsers scope" -Pending:$IsLinux { Install-Script -Name $FabrikamServerScript -Repository $RepositoryName -NoPathUpdate -Scope AllUsers $installedScriptInfo = Get-InstalledScript -Name $FabrikamServerScript From cb9fc8c66fe8cc0df6cb80270f12e9b184ec7a0a Mon Sep 17 00:00:00 2001 From: Reece Dunham Date: Mon, 25 Feb 2019 13:05:35 -0500 Subject: [PATCH 02/13] Update PowerShellGet.Tests.ps1 --- test/powershell/Modules/PowerShellGet/PowerShellGet.Tests.ps1 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/powershell/Modules/PowerShellGet/PowerShellGet.Tests.ps1 b/test/powershell/Modules/PowerShellGet/PowerShellGet.Tests.ps1 index f956438a0bd..363d2cee722 100644 --- a/test/powershell/Modules/PowerShellGet/PowerShellGet.Tests.ps1 +++ b/test/powershell/Modules/PowerShellGet/PowerShellGet.Tests.ps1 @@ -159,7 +159,7 @@ Describe "PowerShellGet - Module tests (Admin)" -tags @('Feature', 'RequireAdmin } ## Marked as 'Pending' on Linux for now because the test requires root privilege but we cannot do it now in our Azure DevOps Linux build - It "Should install a module correctly to the required location with AllUsers scope" -Pending:$IsLinux { + It "Should install a module correctly to the required location with AllUsers scope" -Pending:$false { Install-Module -Name $ContosoServer -Repository $RepositoryName -Scope AllUsers $installedModuleInfo = Get-InstalledModule -Name $ContosoServer @@ -229,7 +229,7 @@ Describe "PowerShellGet - Script tests (Admin)" -tags @('Feature', 'RequireAdmin } ## Marked as 'Pending' on Linux for now because the test requires root privilege but we cannot do it now in our Azure DevOps Linux build - It "Should install a script correctly to the required location with AllUsers scope" -Pending:$IsLinux { + It "Should install a script correctly to the required location with AllUsers scope" -Pending:$false { Install-Script -Name $FabrikamServerScript -Repository $RepositoryName -NoPathUpdate -Scope AllUsers $installedScriptInfo = Get-InstalledScript -Name $FabrikamServerScript From 3cadc2503fc773cedf45261483fd063c4ad6795b Mon Sep 17 00:00:00 2001 From: Reece Dunham Date: Mon, 25 Feb 2019 13:25:54 -0500 Subject: [PATCH 03/13] [feature] --- .../Modules/PowerShellGet/PowerShellGet.Tests.ps1 | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/test/powershell/Modules/PowerShellGet/PowerShellGet.Tests.ps1 b/test/powershell/Modules/PowerShellGet/PowerShellGet.Tests.ps1 index 363d2cee722..7803132edd5 100644 --- a/test/powershell/Modules/PowerShellGet/PowerShellGet.Tests.ps1 +++ b/test/powershell/Modules/PowerShellGet/PowerShellGet.Tests.ps1 @@ -158,8 +158,7 @@ Describe "PowerShellGet - Module tests (Admin)" -tags @('Feature', 'RequireAdmin Remove-InstalledModules } - ## Marked as 'Pending' on Linux for now because the test requires root privilege but we cannot do it now in our Azure DevOps Linux build - It "Should install a module correctly to the required location with AllUsers scope" -Pending:$false { + It "Should install a module correctly to the required location with AllUsers scope" { Install-Module -Name $ContosoServer -Repository $RepositoryName -Scope AllUsers $installedModuleInfo = Get-InstalledModule -Name $ContosoServer @@ -228,8 +227,7 @@ Describe "PowerShellGet - Script tests (Admin)" -tags @('Feature', 'RequireAdmin Remove-InstalledScripts } - ## Marked as 'Pending' on Linux for now because the test requires root privilege but we cannot do it now in our Azure DevOps Linux build - It "Should install a script correctly to the required location with AllUsers scope" -Pending:$false { + It "Should install a script correctly to the required location with AllUsers scope" { Install-Script -Name $FabrikamServerScript -Repository $RepositoryName -NoPathUpdate -Scope AllUsers $installedScriptInfo = Get-InstalledScript -Name $FabrikamServerScript From 190f9cc5bb9d6fbe93c3f9c549b3d91a4bfa453c Mon Sep 17 00:00:00 2001 From: Reece Dunham Date: Mon, 25 Feb 2019 14:43:31 -0500 Subject: [PATCH 04/13] Revert --- .../Modules/PowerShellGet/PowerShellGet.Tests.ps1 | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/test/powershell/Modules/PowerShellGet/PowerShellGet.Tests.ps1 b/test/powershell/Modules/PowerShellGet/PowerShellGet.Tests.ps1 index 7803132edd5..f956438a0bd 100644 --- a/test/powershell/Modules/PowerShellGet/PowerShellGet.Tests.ps1 +++ b/test/powershell/Modules/PowerShellGet/PowerShellGet.Tests.ps1 @@ -158,7 +158,8 @@ Describe "PowerShellGet - Module tests (Admin)" -tags @('Feature', 'RequireAdmin Remove-InstalledModules } - It "Should install a module correctly to the required location with AllUsers scope" { + ## Marked as 'Pending' on Linux for now because the test requires root privilege but we cannot do it now in our Azure DevOps Linux build + It "Should install a module correctly to the required location with AllUsers scope" -Pending:$IsLinux { Install-Module -Name $ContosoServer -Repository $RepositoryName -Scope AllUsers $installedModuleInfo = Get-InstalledModule -Name $ContosoServer @@ -227,7 +228,8 @@ Describe "PowerShellGet - Script tests (Admin)" -tags @('Feature', 'RequireAdmin Remove-InstalledScripts } - It "Should install a script correctly to the required location with AllUsers scope" { + ## Marked as 'Pending' on Linux for now because the test requires root privilege but we cannot do it now in our Azure DevOps Linux build + It "Should install a script correctly to the required location with AllUsers scope" -Pending:$IsLinux { Install-Script -Name $FabrikamServerScript -Repository $RepositoryName -NoPathUpdate -Scope AllUsers $installedScriptInfo = Get-InstalledScript -Name $FabrikamServerScript From 9b4aa57ea970f28548f2348f361b63b390a4bd0b Mon Sep 17 00:00:00 2001 From: Reece Dunham Date: Mon, 25 Feb 2019 14:50:49 -0500 Subject: [PATCH 05/13] [feature] RequireSudoOnUnix --- test/powershell/Modules/PowerShellGet/PowerShellGet.Tests.ps1 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/powershell/Modules/PowerShellGet/PowerShellGet.Tests.ps1 b/test/powershell/Modules/PowerShellGet/PowerShellGet.Tests.ps1 index f956438a0bd..94234edd924 100644 --- a/test/powershell/Modules/PowerShellGet/PowerShellGet.Tests.ps1 +++ b/test/powershell/Modules/PowerShellGet/PowerShellGet.Tests.ps1 @@ -159,7 +159,7 @@ Describe "PowerShellGet - Module tests (Admin)" -tags @('Feature', 'RequireAdmin } ## Marked as 'Pending' on Linux for now because the test requires root privilege but we cannot do it now in our Azure DevOps Linux build - It "Should install a module correctly to the required location with AllUsers scope" -Pending:$IsLinux { + It "Should install a module correctly to the required location with AllUsers scope" -Tags @('RequireSudoOnUnix') { Install-Module -Name $ContosoServer -Repository $RepositoryName -Scope AllUsers $installedModuleInfo = Get-InstalledModule -Name $ContosoServer @@ -229,7 +229,7 @@ Describe "PowerShellGet - Script tests (Admin)" -tags @('Feature', 'RequireAdmin } ## Marked as 'Pending' on Linux for now because the test requires root privilege but we cannot do it now in our Azure DevOps Linux build - It "Should install a script correctly to the required location with AllUsers scope" -Pending:$IsLinux { + It "Should install a script correctly to the required location with AllUsers scope" -Tags @('RequireSudoOnUnix') { Install-Script -Name $FabrikamServerScript -Repository $RepositoryName -NoPathUpdate -Scope AllUsers $installedScriptInfo = Get-InstalledScript -Name $FabrikamServerScript From 71cd7e1c3f62b0db8a43f874fd77a12302e16bca Mon Sep 17 00:00:00 2001 From: Reece Dunham Date: Thu, 28 Feb 2019 10:37:11 -0500 Subject: [PATCH 06/13] Update PowerShellGet.Tests.ps1 --- .../Modules/PowerShellGet/PowerShellGet.Tests.ps1 | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/test/powershell/Modules/PowerShellGet/PowerShellGet.Tests.ps1 b/test/powershell/Modules/PowerShellGet/PowerShellGet.Tests.ps1 index 94234edd924..7f5c5e1a1bc 100644 --- a/test/powershell/Modules/PowerShellGet/PowerShellGet.Tests.ps1 +++ b/test/powershell/Modules/PowerShellGet/PowerShellGet.Tests.ps1 @@ -145,7 +145,7 @@ Describe "PowerShellGet - Module tests" -tags "Feature" { } } -Describe "PowerShellGet - Module tests (Admin)" -tags @('Feature', 'RequireAdminOnWindows') { +Describe "PowerShellGet - Module tests (Admin)" -Tags @('Feature','RequireAdminOnWindows', 'RequireSudoOnUnix' { BeforeAll { if ($script:Initialized -eq $false) { @@ -159,7 +159,7 @@ Describe "PowerShellGet - Module tests (Admin)" -tags @('Feature', 'RequireAdmin } ## Marked as 'Pending' on Linux for now because the test requires root privilege but we cannot do it now in our Azure DevOps Linux build - It "Should install a module correctly to the required location with AllUsers scope" -Tags @('RequireSudoOnUnix') { + It "Should install a module correctly to the required location with AllUsers scope" -Pending:$IsLinux { Install-Module -Name $ContosoServer -Repository $RepositoryName -Scope AllUsers $installedModuleInfo = Get-InstalledModule -Name $ContosoServer @@ -229,7 +229,7 @@ Describe "PowerShellGet - Script tests (Admin)" -tags @('Feature', 'RequireAdmin } ## Marked as 'Pending' on Linux for now because the test requires root privilege but we cannot do it now in our Azure DevOps Linux build - It "Should install a script correctly to the required location with AllUsers scope" -Tags @('RequireSudoOnUnix') { + It "Should install a script correctly to the required location with AllUsers scope" -Pending:$IsLinux { Install-Script -Name $FabrikamServerScript -Repository $RepositoryName -NoPathUpdate -Scope AllUsers $installedScriptInfo = Get-InstalledScript -Name $FabrikamServerScript From 15c60423d8267c083532ddd52b5fbe1df16090e1 Mon Sep 17 00:00:00 2001 From: Reece Dunham Date: Thu, 28 Feb 2019 10:56:09 -0500 Subject: [PATCH 07/13] Fix --- test/powershell/Modules/PowerShellGet/PowerShellGet.Tests.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/powershell/Modules/PowerShellGet/PowerShellGet.Tests.ps1 b/test/powershell/Modules/PowerShellGet/PowerShellGet.Tests.ps1 index 7f5c5e1a1bc..97580d055bf 100644 --- a/test/powershell/Modules/PowerShellGet/PowerShellGet.Tests.ps1 +++ b/test/powershell/Modules/PowerShellGet/PowerShellGet.Tests.ps1 @@ -145,7 +145,7 @@ Describe "PowerShellGet - Module tests" -tags "Feature" { } } -Describe "PowerShellGet - Module tests (Admin)" -Tags @('Feature','RequireAdminOnWindows', 'RequireSudoOnUnix' { +Describe "PowerShellGet - Module tests (Admin)" -Tags @('Feature','RequireAdminOnWindows', 'RequireSudoOnUnix') { BeforeAll { if ($script:Initialized -eq $false) { From 389f53b602c124e357055bef33a12f2f83edc482 Mon Sep 17 00:00:00 2001 From: Reece Dunham Date: Thu, 28 Feb 2019 10:57:50 -0500 Subject: [PATCH 08/13] Fixed tests! --- .../PowerShellGet/PowerShellGet.Tests.ps1 | 22 ++++++++++++------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/test/powershell/Modules/PowerShellGet/PowerShellGet.Tests.ps1 b/test/powershell/Modules/PowerShellGet/PowerShellGet.Tests.ps1 index 97580d055bf..9c2672f8d22 100644 --- a/test/powershell/Modules/PowerShellGet/PowerShellGet.Tests.ps1 +++ b/test/powershell/Modules/PowerShellGet/PowerShellGet.Tests.ps1 @@ -25,11 +25,14 @@ if(IsInbox) { $script:ProgramFilesPSPath = Microsoft.PowerShell.Management\Join-Path -Path $env:ProgramFiles -ChildPath "WindowsPowerShell" } -elseif(IsCoreCLR){ - if(IsWindows) { +elseif(IsCoreCLR) +{ + if(IsWindows) + { $script:ProgramFilesPSPath = Microsoft.PowerShell.Management\Join-Path -Path $env:ProgramFiles -ChildPath 'PowerShell' } - else { + else + { $script:ProgramFilesPSPath = Split-Path -Path ([System.Management.Automation.Platform]::SelectProductNameForDirectory('SHARED_MODULES')) -Parent } } @@ -54,7 +57,8 @@ if(IsInbox) Microsoft.PowerShell.Management\Join-Path -Path $env:USERPROFILE -ChildPath "Documents\WindowsPowerShell" } } -elseif(IsCoreCLR) { +elseif(IsCoreCLR) +{ if(IsWindows) { $script:MyDocumentsPSPath = if($script:MyDocumentsFolderPath) @@ -145,7 +149,8 @@ Describe "PowerShellGet - Module tests" -tags "Feature" { } } -Describe "PowerShellGet - Module tests (Admin)" -Tags @('Feature','RequireAdminOnWindows', 'RequireSudoOnUnix') { +Describe "PowerShellGet - Module tests (Admin)" -Tags @('Feature','RequireAdminOnWindows', 'RequireSudoOnUnix') +{ BeforeAll { if ($script:Initialized -eq $false) { @@ -159,7 +164,7 @@ Describe "PowerShellGet - Module tests (Admin)" -Tags @('Feature','RequireAdminO } ## Marked as 'Pending' on Linux for now because the test requires root privilege but we cannot do it now in our Azure DevOps Linux build - It "Should install a module correctly to the required location with AllUsers scope" -Pending:$IsLinux { + It "Should install a module correctly to the required location with AllUsers scope" { Install-Module -Name $ContosoServer -Repository $RepositoryName -Scope AllUsers $installedModuleInfo = Get-InstalledModule -Name $ContosoServer @@ -215,7 +220,8 @@ Describe "PowerShellGet - Script tests" -tags "Feature" { } } -Describe "PowerShellGet - Script tests (Admin)" -tags @('Feature', 'RequireAdminOnWindows') { +Describe "PowerShellGet - Script tests (Admin)" -Tags @('Feature', 'RequireAdminOnWindows', 'RequireSudoOnUnix') +{ BeforeAll { if ($script:Initialized -eq $false) { @@ -229,7 +235,7 @@ Describe "PowerShellGet - Script tests (Admin)" -tags @('Feature', 'RequireAdmin } ## Marked as 'Pending' on Linux for now because the test requires root privilege but we cannot do it now in our Azure DevOps Linux build - It "Should install a script correctly to the required location with AllUsers scope" -Pending:$IsLinux { + It "Should install a script correctly to the required location with AllUsers scope" { Install-Script -Name $FabrikamServerScript -Repository $RepositoryName -NoPathUpdate -Scope AllUsers $installedScriptInfo = Get-InstalledScript -Name $FabrikamServerScript From 78a96938f4d974d37e0eee0f721fb4d0215c8048 Mon Sep 17 00:00:00 2001 From: Reece Dunham Date: Thu, 28 Feb 2019 11:42:09 -0500 Subject: [PATCH 09/13] Revert --- .../PowerShellGet/PowerShellGet.Tests.ps1 | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) diff --git a/test/powershell/Modules/PowerShellGet/PowerShellGet.Tests.ps1 b/test/powershell/Modules/PowerShellGet/PowerShellGet.Tests.ps1 index 9c2672f8d22..8081e938336 100644 --- a/test/powershell/Modules/PowerShellGet/PowerShellGet.Tests.ps1 +++ b/test/powershell/Modules/PowerShellGet/PowerShellGet.Tests.ps1 @@ -25,14 +25,11 @@ if(IsInbox) { $script:ProgramFilesPSPath = Microsoft.PowerShell.Management\Join-Path -Path $env:ProgramFiles -ChildPath "WindowsPowerShell" } -elseif(IsCoreCLR) -{ - if(IsWindows) - { +elseif(IsCoreCLR) { + if(IsWindows) { $script:ProgramFilesPSPath = Microsoft.PowerShell.Management\Join-Path -Path $env:ProgramFiles -ChildPath 'PowerShell' } - else - { + else { $script:ProgramFilesPSPath = Split-Path -Path ([System.Management.Automation.Platform]::SelectProductNameForDirectory('SHARED_MODULES')) -Parent } } @@ -57,8 +54,7 @@ if(IsInbox) Microsoft.PowerShell.Management\Join-Path -Path $env:USERPROFILE -ChildPath "Documents\WindowsPowerShell" } } -elseif(IsCoreCLR) -{ +elseif(IsCoreCLR) { if(IsWindows) { $script:MyDocumentsPSPath = if($script:MyDocumentsFolderPath) @@ -149,8 +145,7 @@ Describe "PowerShellGet - Module tests" -tags "Feature" { } } -Describe "PowerShellGet - Module tests (Admin)" -Tags @('Feature','RequireAdminOnWindows', 'RequireSudoOnUnix') -{ +Describe "PowerShellGet - Module tests (Admin)" -Tags @('Feature','RequireAdminOnWindows', 'RequireSudoOnUnix') { BeforeAll { if ($script:Initialized -eq $false) { @@ -163,7 +158,6 @@ Describe "PowerShellGet - Module tests (Admin)" -Tags @('Feature','RequireAdminO Remove-InstalledModules } - ## Marked as 'Pending' on Linux for now because the test requires root privilege but we cannot do it now in our Azure DevOps Linux build It "Should install a module correctly to the required location with AllUsers scope" { Install-Module -Name $ContosoServer -Repository $RepositoryName -Scope AllUsers $installedModuleInfo = Get-InstalledModule -Name $ContosoServer @@ -234,7 +228,6 @@ Describe "PowerShellGet - Script tests (Admin)" -Tags @('Feature', 'RequireAdmin Remove-InstalledScripts } - ## Marked as 'Pending' on Linux for now because the test requires root privilege but we cannot do it now in our Azure DevOps Linux build It "Should install a script correctly to the required location with AllUsers scope" { Install-Script -Name $FabrikamServerScript -Repository $RepositoryName -NoPathUpdate -Scope AllUsers $installedScriptInfo = Get-InstalledScript -Name $FabrikamServerScript From 482d68582a90d2d43230771ae7a0b2d91ef575dc Mon Sep 17 00:00:00 2001 From: Reece Dunham Date: Thu, 28 Feb 2019 11:42:41 -0500 Subject: [PATCH 10/13] Missed one --- test/powershell/Modules/PowerShellGet/PowerShellGet.Tests.ps1 | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/test/powershell/Modules/PowerShellGet/PowerShellGet.Tests.ps1 b/test/powershell/Modules/PowerShellGet/PowerShellGet.Tests.ps1 index 8081e938336..687ce7ca4e0 100644 --- a/test/powershell/Modules/PowerShellGet/PowerShellGet.Tests.ps1 +++ b/test/powershell/Modules/PowerShellGet/PowerShellGet.Tests.ps1 @@ -214,8 +214,7 @@ Describe "PowerShellGet - Script tests" -tags "Feature" { } } -Describe "PowerShellGet - Script tests (Admin)" -Tags @('Feature', 'RequireAdminOnWindows', 'RequireSudoOnUnix') -{ +Describe "PowerShellGet - Script tests (Admin)" -Tags @('Feature', 'RequireAdminOnWindows', 'RequireSudoOnUnix') { BeforeAll { if ($script:Initialized -eq $false) { From fe8929195a77aff6ae20194ecaf998a46cf0c6ff Mon Sep 17 00:00:00 2001 From: Reece Dunham Date: Thu, 28 Feb 2019 11:44:53 -0500 Subject: [PATCH 11/13] [feature] empty commit to trigger feature tests From f3d1889264428a6e049133b02bff2358e761add8 Mon Sep 17 00:00:00 2001 From: Reece Dunham Date: Mon, 4 Mar 2019 16:32:49 -0500 Subject: [PATCH 12/13] Add space where it should be --- test/powershell/Modules/PowerShellGet/PowerShellGet.Tests.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/powershell/Modules/PowerShellGet/PowerShellGet.Tests.ps1 b/test/powershell/Modules/PowerShellGet/PowerShellGet.Tests.ps1 index 687ce7ca4e0..db8bb59edb4 100644 --- a/test/powershell/Modules/PowerShellGet/PowerShellGet.Tests.ps1 +++ b/test/powershell/Modules/PowerShellGet/PowerShellGet.Tests.ps1 @@ -145,7 +145,7 @@ Describe "PowerShellGet - Module tests" -tags "Feature" { } } -Describe "PowerShellGet - Module tests (Admin)" -Tags @('Feature','RequireAdminOnWindows', 'RequireSudoOnUnix') { +Describe "PowerShellGet - Module tests (Admin)" -Tags @('Feature', 'RequireAdminOnWindows', 'RequireSudoOnUnix') { BeforeAll { if ($script:Initialized -eq $false) { From 254fa963a43935558d2926dddb314628de511a9b Mon Sep 17 00:00:00 2001 From: Reece Dunham Date: Tue, 5 Mar 2019 08:47:08 -0500 Subject: [PATCH 13/13] [feature] get cla bot to work (empty commit)