[Ubuntu] Migrate PowerShell and Docker tests to Pester (#2317)

* PowerShell and Docker Pester tests

* no pester module

* import pester

* invoke docker with sudo

* remove native test

* add fix for az 1.0.0 module

* revert powershellget installation

* revert flag Force

* add $ProgressPreference = "SilentlyContinue"
This commit is contained in:
Aleksandr Chebotov
2020-12-23 15:18:48 +03:00
committed by GitHub
parent ec4b0fa89c
commit ac87b63b13
12 changed files with 162 additions and 72 deletions

View File

@@ -1,14 +1,15 @@
$ErrorActionPreference = "Stop"
$ProgressPreference = "SilentlyContinue"
function Get-ToolsetContent
{
$toolset = Join-Path $env:INSTALLER_SCRIPT_FOLDER "toolset.json"
Get-Content $toolset -Raw | ConvertFrom-Json
}
Import-Module "$env:HELPER_SCRIPTS/Tests.Helpers.psm1" -DisableNameChecking
# Specifies the installation policy
Set-PSRepository -InstallationPolicy Trusted -Name PSGallery
# Try to update PowerShellGet before the actual installation
Install-Module -Name PowerShellGet -Force
Update-Module -Name PowerShellGet -Force
# Install PowerShell modules
$modules = (Get-ToolsetContent).powershellModules
@@ -29,3 +30,5 @@ foreach($module in $modules)
Install-Module -Name $moduleName -Scope AllUsers -SkipPublisherCheck -Force
}
Invoke-PesterTests -TestFile "PowerShellModules" -TestName "PowerShellModules"