mirror of
https://github.com/actions/runner-images-sangeeth.git
synced 2025-12-20 06:29:50 +00:00
Implement new Pester Tests for Visual Studio (#1251)
* implement pester tests for visual studio * fix components list
This commit is contained in:
committed by
GitHub
parent
99bd7bf035
commit
532b49be6f
27
images/win/scripts/Tests/VisualStudio.Tests.ps1
Normal file
27
images/win/scripts/Tests/VisualStudio.Tests.ps1
Normal file
@@ -0,0 +1,27 @@
|
||||
Describe "Visual Studio" {
|
||||
Context "Basic" {
|
||||
It "Catalog.json" {
|
||||
Get-VsCatalogJsonPath | Should -Exist
|
||||
}
|
||||
|
||||
It "Devenv.exe" {
|
||||
$visualStudioEdition = Get-ToolsetContent | Select-Object -ExpandProperty visualStudio | Select-Object -ExpandProperty edition
|
||||
$visualStudioVersion = Get-ToolsetContent | Select-Object -ExpandProperty visualStudio | Select-Object -ExpandProperty version
|
||||
$vsInstallRoot = Get-VisualStudioPath -Version $visualStudioVersion -Edition $visualStudioEdition
|
||||
$devenvexePath = "${vsInstallRoot}\Common7\IDE\devenv.exe"
|
||||
$devenvexePath | Should -Exist
|
||||
}
|
||||
}
|
||||
|
||||
Context "Visual Studio components" {
|
||||
$expectedComponents = Get-ToolsetContent | Select-Object -ExpandProperty visualStudio | Select-Object -ExpandProperty workloads
|
||||
$testCases = $expectedComponents | ForEach-Object { @{ComponentName = $_} }
|
||||
BeforeAll {
|
||||
$installedComponents = Get-VisualStudioComponents | Select-Object -ExpandProperty Package
|
||||
}
|
||||
|
||||
It "<ComponentName>" -TestCases $testCases {
|
||||
$installedComponents | Should -Contain $ComponentName
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user