Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pin major version of Pester to 4 and upgrade Pester version for WMF4 build #1433

Merged
merged 1 commit into from
Apr 15, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ Note: the PSScriptAnalyzer Chocolatey package is provided and supported by the c
#### Requirements

* [.NET Core 3.1.102 SDK](https://www.microsoft.com/net/download/dotnet-core/3.1#sdk-3.1.102) or newer patch release
* [Pester v4 PowerShell module, available on PowerShell Gallery](https://github.com/pester/Pester)
* [PlatyPS PowerShell module, available on PowerShell Gallery](https://github.com/PowerShell/platyPS/releases)
* Optionally but recommended for development: [Visual Studio 2017/2019](https://www.visualstudio.com/downloads/)

Expand Down
5 changes: 3 additions & 2 deletions build.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -331,13 +331,14 @@ function Test-ScriptAnalyzer
}
$savedModulePath = $env:PSModulePath
$env:PSModulePath = "${testModulePath}{0}${env:PSModulePath}" -f [System.IO.Path]::PathSeparator
$importPesterV4 = 'Import-Module -Name Pester -MaximumVersion 4.99'
if ($ShowAll)
{
$scriptBlock = [scriptblock]::Create("Invoke-Pester -Path $testScripts -OutputFormat NUnitXml -OutputFile $testResultsFile")
$scriptBlock = [scriptblock]::Create("$importPesterV4; Invoke-Pester -Path $testScripts -OutputFormat NUnitXml -OutputFile $testResultsFile")
}
else
{
$scriptBlock = [scriptblock]::Create("Invoke-Pester -Path $testScripts -OutputFormat NUnitXml -OutputFile $testResultsFile -Show Describe,Summary,Failed")
$scriptBlock = [scriptblock]::Create("$importPesterV4; Invoke-Pester -Path $testScripts -OutputFormat NUnitXml -OutputFile $testResultsFile -Show Describe,Summary,Failed")
}
if ( $InProcess ) {
& $scriptBlock
Expand Down
4 changes: 2 additions & 2 deletions tools/appveyor.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
$ErrorActionPreference = 'Stop'

function Install-Pester {
$requiredPesterVersion = '4.10.0'
$requiredPesterVersion = '4.10.1'
$pester = Get-Module Pester -ListAvailable | Where-Object { $_.Version -eq $requiredPesterVersion }
if ($null -eq $pester) {
if ($null -eq (Get-Module -ListAvailable PowershellGet)) {
Expand All @@ -15,7 +15,7 @@ function Install-Pester {
else {
# Visual Studio 2017 build (has already Pester v3, therefore a different installation mechanism is needed to make it also use the new version 4)
Write-Verbose -Verbose "Installing Pester via Install-Module"
Install-Module -Name Pester -Force -SkipPublisherCheck -Scope CurrentUser -Repository PSGallery
Install-Module -Name Pester -MaximumVersion 4.99 -Force -SkipPublisherCheck -Scope CurrentUser -Repository PSGallery
}
}
}
Expand Down