Added script to get test regions list

This commit is contained in:
Shital Savekar 2018-05-22 17:12:08 -07:00
Родитель d3ce7b54c6
Коммит c40909780f
1 изменённых файлов: 40 добавлений и 0 удалений

Просмотреть файл

@ -0,0 +1,40 @@
param
(
$TestByTestName="",
$TestByCategorizedTestName="",
$TestByCategory="",
$TestByTag=""
)
Get-ChildItem .\Libraries -Recurse | Where-Object { $_.FullName.EndsWith(".psm1") } | ForEach-Object { Import-Module $_.FullName -Force -Global }
$TestRegions = @()
if ( $TestByTestName )
{
foreach( $Test in $TestByTestName.Split(","))
{
$TestRegions += $Test.Split(">>")[$Test.Split(">>").Count - 1]
}
}
if ( $TestByCategorizedTestName )
{
foreach( $Test in $TestByCategorizedTestName.Split(","))
{
$TestRegions += $Test.Split(">>")[$Test.Split(">>").Count - 1]
}
}
if ( $TestByTag )
{
foreach( $Test in $TestByTag.Split(","))
{
$TestRegions += $Test.Split(">>")[$Test.Split(">>").Count - 1]
}
}
$UniqueTestRegions = $TestRegions | Get-Unique
LogMsg "Selected test regions:"
$i = 1
$CurrentTestRegions = ""
Set-Content -Value "" -Path .\CurrentTestRegions.azure.env -Force -NoNewline
$UniqueTestRegions | ForEach-Object { LogMsg "$i. $_"; $i += 1; $CurrentTestRegions += "$_," }
Set-Content -Value $CurrentTestRegions.TrimEnd(",") -Path .\CurrentTestRegions.azure.env -Force -NoNewline -Verbose