-
Notifications
You must be signed in to change notification settings - Fork 111
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
74 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
# Copyright (c) Microsoft Corporation. | ||
# Licensed under the MIT License. | ||
|
||
& "$PSScriptRoot/Invoke-Task" Build.PsModule |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
# Copyright (c) Microsoft Corporation. | ||
# Licensed under the MIT License. | ||
|
||
<# | ||
.SYNOPSIS | ||
Runs Pester tests. | ||
.PARAMETER Cost | ||
Optional. Indicates whether to run Cost Management tests. | ||
.PARAMETER Data | ||
Optional. Indicates whether to run open data tests. | ||
.PARAMETER Exports | ||
Optional. Indicates whether to run Cost Management export tests. | ||
.PARAMETER FOCUS | ||
Optional. Indicates whether to run FOCUS tests. | ||
.PARAMETER Hubs | ||
Optional. Indicates whether to run FinOps hubs tests. | ||
.PARAMETER Toolkit | ||
Optional. Indicates whether to run FinOps toolkit tests. | ||
#> | ||
[CmdletBinding()] | ||
param ( | ||
[switch] | ||
$Cost, | ||
|
||
[switch] | ||
$Data, | ||
|
||
[switch] | ||
$Exports, | ||
|
||
[switch] | ||
$FOCUS, | ||
|
||
[switch] | ||
$Hubs, | ||
|
||
[switch] | ||
$Toolkit | ||
) | ||
|
||
$testsToRun = @() | ||
if ($Cost) { $testsToRun += '*-FinOpsCost*' } | ||
if ($Data) { $testsToRun += '*-OpenData*', '*-FinOpsPricingUnit*', '*-FinOpsRegion*', '*-FinOpsService*' } | ||
if ($Exports) { $testsToRun += '*-FinOpsCostExport*' } | ||
if ($FOCUS) { $testsToRun += '*-FinOpsSchema*' } | ||
if ($Hubs) { $testsToRun += '*-FinOpsHubs*' } | ||
if ($Toolkit) { $testsToRun += '*-FinOpsToolkit*' } | ||
|
||
Push-Location | ||
Set-Location "$PSScriptRoot/../powershell/Tests/Unit" | ||
|
||
if ($testsToRun) | ||
{ | ||
$testsToRun | Select-Object -Unique | ForEach-Object { | ||
Write-Host "Running $_" | ||
Invoke-Pester -Path $_ -Output Detailed | ||
} | ||
} | ||
else | ||
{ | ||
Invoke-Pester -Path * -Output Detailed | ||
} | ||
|
||
Pop-Location |