Skip to content

Commit

Permalink
Fixing Pester Tests
Browse files Browse the repository at this point in the history
  • Loading branch information
VertigoRay committed Nov 20, 2020
1 parent 4642623 commit 4327ea8
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 10 deletions.
3 changes: 2 additions & 1 deletion .appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ install:
# Bootstrap PSDepend and Install Dependencies
- ps: |
Install-PackageProvider -Name NuGet -MinimumVersion '2.8.5.201' -Force
Install-Module -Name PSDepend -Force; Import-Module -Name PSDepend
Install-Module -Name PSDepend -Scope CurrentUser -Force
Import-Module -Name PSDepend
Invoke-PSDepend '.\REQUIREMENTS.psd1' -Force
Expand Down
9 changes: 6 additions & 3 deletions .scripts/build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -189,15 +189,18 @@ Task TestModule -Description "Run Pester Tests and CoeCoverage" -Depends Install
if (Test-Path "$($invokePester.Path)\cultures.json") {
$invokePester.Add('EnableExit', $true)
$currentCulture = Get-Culture

$invokePester | Export-Clixml "${env:Temp}\invokePester.xml"

foreach ($culture in (Get-Content "$($invokePester.Path)\cultures.json" | ConvertFrom-Json)) {
Set-Culture -CultureInfo $culture
$res = powershell.exe Invoke-Pester @invokePester
# Write-Host "[BUILD TestModule] Pester Result: $($res | ConvertTo-Json)" -ForegroundColor Magenta
$res = & powershell.exe -c "`$invokePester = Import-Clixml `"`${env:Temp}\invokePester.xml`"; Invoke-Pester @invokePester"
Write-Host "[BUILD TestModule] Pester Result: $($res | Out-String)" -ForegroundColor Magenta
}
Set-Culture -CultureInfo $currentCulture
} else {
$res = Invoke-Pester @invokePester
# Write-Host "[BUILD TestModule] Pester Result: $($res | ConvertTo-Json)" -ForegroundColor Magenta
Write-Host "[BUILD TestModule] Pester Result: $($res | Out-String)" -ForegroundColor Magenta
}

$exportCodeCovIoJson = @{
Expand Down
12 changes: 6 additions & 6 deletions .scripts/deploy.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
- https://github.com/RamblingCookieMonster/PSDeploy
#>
$PSScriptRootParent = Split-Path $PSScriptRoot -Parent
Write-Host "[Deploy] APPVEYOR_PROJECT_NAME: ${env:APPVEYOR_PROJECT_NAME}" -Foregroundcolor 'Magenta' -BackgroundColor 'Blue'
Write-Host "[Deploy] PSScriptRootParent: ${PSScriptRootParent}" -Foregroundcolor 'Magenta' -BackgroundColor 'Blue'
Write-Host "[Deploy] Path Exists (${PSScriptRootParent}): $(Test-Path $PSScriptRootParent)" -Foregroundcolor 'Magenta' -BackgroundColor 'Blue'
Write-Host "[Deploy] Path Exists (${PSScriptRootParent}\dev): $(Test-Path "${PSScriptRootParent}\dev")" -Foregroundcolor 'Magenta' -BackgroundColor 'Blue'
Write-Host "[Deploy] Path Exists (${PSScriptRootParent}\dev\BuildOutput): $(Test-Path "${PSScriptRootParent}\dev\BuildOutput")" -Foregroundcolor 'Magenta' -BackgroundColor 'Blue'
Write-Host "[Deploy] Path Exists (${PSScriptRootParent}\dev\BuildOutput\QuserObject): $(Test-Path "${PSScriptRootParent}\dev\BuildOutput\QuserObject")" -Foregroundcolor 'Magenta' -BackgroundColor 'Blue'
Write-Host "[Deploy] APPVEYOR_PROJECT_NAME: ${env:APPVEYOR_PROJECT_NAME}" -Foregroundcolor 'Magenta'
Write-Host "[Deploy] PSScriptRootParent: ${PSScriptRootParent}" -Foregroundcolor 'Magenta'
Write-Host "[Deploy] Path Exists (${PSScriptRootParent}): $(Test-Path $PSScriptRootParent)" -Foregroundcolor 'Magenta'
Write-Host "[Deploy] Path Exists (${PSScriptRootParent}\dev): $(Test-Path "${PSScriptRootParent}\dev")" -Foregroundcolor 'Magenta'
Write-Host "[Deploy] Path Exists (${PSScriptRootParent}\dev\BuildOutput): $(Test-Path "${PSScriptRootParent}\dev\BuildOutput")" -Foregroundcolor 'Magenta'
Write-Host "[Deploy] Path Exists (${PSScriptRootParent}\dev\BuildOutput\QuserObject): $(Test-Path "${PSScriptRootParent}\dev\BuildOutput\QuserObject")" -Foregroundcolor 'Magenta'

Deploy Module {
By PSGalleryModule QuserObject {
Expand Down

0 comments on commit 4327ea8

Please sign in to comment.