mirror of
https://github.com/actions/runner-images.git
synced 2025-12-14 05:07:02 +00:00
[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:
committed by
GitHub
parent
ec4b0fa89c
commit
ac87b63b13
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user