58 lines
1.5 KiB
PowerShell
58 lines
1.5 KiB
PowerShell
<#
|
|
.SYNOPSIS
|
|
Tests all project in the Alkami.PowerShell module system
|
|
|
|
.EXAMPLE
|
|
.\test-solution.ps1
|
|
|
|
.PARAMETER FilenameMatch
|
|
A wildcard pattern to match for the testing scope. This limits how many files are looked at.
|
|
Matching pattern is *$FilenameMatch*.test?.ps1
|
|
|
|
.PARAMETER Noisy
|
|
Show the output of the process instead of a synopsis
|
|
|
|
.PARAMETER NoAnalyzer
|
|
Don't run PSScriptAnalyzer on the project
|
|
#>
|
|
[CmdletBinding()]
|
|
Param(
|
|
$FilenameMatch,
|
|
[switch]$Noisy,
|
|
[switch]$NoAnalyzer,
|
|
[switch]$AsBuildServer
|
|
)
|
|
|
|
$global:SuppressReload = $true
|
|
|
|
. $PSScriptRoot\.build\Load-Includes.ps1
|
|
|
|
## Ensure that the modules are loaded properly
|
|
Get-Module Alkami* | Remove-Module -force
|
|
.$PSScriptRoot\Load-PesterModules.ps1
|
|
|
|
$folders = (Get-ChildItem $PSScriptRoot -Directory)
|
|
$failingResults = @()
|
|
|
|
foreach ($folder in $folders.Where({$_.Name -ne ".build"})) {
|
|
$folderPath = $folder.FullName
|
|
|
|
Write-Host "Testing $folderPath"
|
|
$failingResult = & $PSScriptRoot\test-project.ps1 $folderPath $FilenameMatch -Noisy:$Noisy -NoAnalyzer:$NoAnalyzer -AsBuildServer:$AsBuildServer -DontReloadPester
|
|
|
|
if ($null -ne $failingResult) {
|
|
$failingResults += $failingResult
|
|
}
|
|
}
|
|
|
|
$global:SuppressReload = $false
|
|
|
|
## finally, return the results array if any
|
|
$resultsToShow = @($failingResults.Where({$_.TestResult -or $_.Analyzer}))
|
|
|
|
if ($resultsToShow.Count -gt 0) {
|
|
return $resultsToShow
|
|
} else {
|
|
Write-Host "All tests finished, no failing results"
|
|
}
|