mirror of
https://github.com/actions/runner-images-sangeeth.git
synced 2025-12-24 02:18:40 +08:00
Migrate validation to Pester (#1249)
* remove Validate-* scripts * Remove references to validation scripts from .json files * Separate "It"s by new lines * Remove new line before the first "It" * Separate "It"s by new lines * remove 32-bit WinAppDriver check * remove explicit variable definition Co-authored-by: Sergey Dolin <v-sedoli@micorosoft.com>
This commit is contained in:
21
images/win/scripts/Tests/SSDTExtensions.Tests.ps1
Normal file
21
images/win/scripts/Tests/SSDTExtensions.Tests.ps1
Normal file
@@ -0,0 +1,21 @@
|
||||
Describe "SSDTExtensions" {
|
||||
#These extensions don't have any proper name in the state.packages.json file, only id is available, which can be found on extension marketplace download page
|
||||
|
||||
if (Test-isWin19) {
|
||||
$testExtenions = @(
|
||||
@{id = "04a86fc2-dbd5-4222-848e-911638e487fe"}
|
||||
@{id = "851E7A09-7B2B-4F06-A15D-BABFCB26B970"}
|
||||
@{id = "717ad572-c4b7-435c-c166-c2969777f718"}
|
||||
)
|
||||
|
||||
It "Extensions id=<id>" -TestCases $testExtenions {
|
||||
$version = Get-VSExtensionVersion -packageName "${id}"
|
||||
$version | Should -Not -BeNullOrEmpty
|
||||
}
|
||||
} else {
|
||||
It "Extension SSDT" {
|
||||
$version = Get-VSExtensionVersion -packageName "SSDT"
|
||||
$version | Should -Not -BeNullOrEmpty
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -245,4 +245,48 @@ Describe "ServiceFabricSDK" {
|
||||
It "PowerShell Module" {
|
||||
Get-Module -Name ServiceFabric -ListAvailable | Should -Not -BeNullOrEmpty
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Describe "Svn" {
|
||||
It "svn" {
|
||||
"svn --version --quiet" | Should -ReturnZeroExitCode
|
||||
}
|
||||
}
|
||||
|
||||
Describe "Stack" {
|
||||
It "Stack" {
|
||||
"stack --version" | Should -ReturnZeroExitCode
|
||||
}
|
||||
}
|
||||
|
||||
Describe "Typescript" {
|
||||
It "tsc" {
|
||||
"tsc --version" | Should -ReturnZeroExitCode
|
||||
}
|
||||
}
|
||||
|
||||
Describe "Vcpkg" {
|
||||
It "vcpkg" {
|
||||
"vcpkg version" | Should -ReturnZeroExitCode
|
||||
}
|
||||
|
||||
It "env variable VCPKG_INSTALLATION_ROOT is set" {
|
||||
$env:VCPKG_INSTALLATION_ROOT | Should -Not -BeNullOrEmpty
|
||||
}
|
||||
|
||||
It "VCPKG_INSTALLATION_ROOT directory" {
|
||||
$env:VCPKG_INSTALLATION_ROOT | Should -Exist
|
||||
}
|
||||
}
|
||||
|
||||
Describe "VSWhere" {
|
||||
It "vswhere" {
|
||||
"vswhere" | Should -ReturnZeroExitCode
|
||||
}
|
||||
}
|
||||
|
||||
Describe "Zstd" {
|
||||
It "zstd" {
|
||||
"zstd -V" | Should -ReturnZeroExitCode
|
||||
}
|
||||
}
|
||||
|
||||
11
images/win/scripts/Tests/WDK.Tests.ps1
Normal file
11
images/win/scripts/Tests/WDK.Tests.ps1
Normal file
@@ -0,0 +1,11 @@
|
||||
Describe "WDK" {
|
||||
It "WDK exists" {
|
||||
$WDKVersion = (Get-CimInstance -ClassName Win32_Product -Filter "Name = 'Windows Driver Kit'").Version
|
||||
$WDKVersion| Should -Not -BeNullOrEmpty
|
||||
}
|
||||
|
||||
It "WDK version from system" {
|
||||
$version = Get-VSExtensionVersion -packageName "Microsoft.Windows.DriverKit"
|
||||
$version | Should -Not -BeNullOrEmpty
|
||||
}
|
||||
}
|
||||
10
images/win/scripts/Tests/WinAppDriver.Tests.ps1
Normal file
10
images/win/scripts/Tests/WinAppDriver.Tests.ps1
Normal file
@@ -0,0 +1,10 @@
|
||||
Describe "WinAppDriver" {
|
||||
It "WinAppDriver directory exists" {
|
||||
Test-Path -Path "${env:ProgramFiles(x86)}\Windows Application Driver" | Should -BeTrue
|
||||
}
|
||||
|
||||
It "Developer Mode is enabled" {
|
||||
$path = "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\AppModelUnlock";
|
||||
Get-ItemProperty -Path $path | Select-Object -ExpandProperty "AllowDevelopmentWithoutDevLicense" | Should -Be 1
|
||||
}
|
||||
}
|
||||
23
images/win/scripts/Tests/Wix.Tests.ps1
Normal file
23
images/win/scripts/Tests/Wix.Tests.ps1
Normal file
@@ -0,0 +1,23 @@
|
||||
Describe "Wix" {
|
||||
BeforeAll {
|
||||
$regKey = "HKLM:\Software\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\*"
|
||||
$installedApplications = Get-ItemProperty -Path $regKey
|
||||
$version = ($installedApplications | Where-Object { $_.DisplayName -and $_.DisplayName.toLower().Contains("wix") } | Select-Object -First 1).DisplayVersion
|
||||
}
|
||||
|
||||
It "Wix Toolset version from registry" {
|
||||
$version | Should -Not -BeNullOrEmpty
|
||||
}
|
||||
|
||||
It "Wix Toolset version from system" {
|
||||
if (Test-IsWin19)
|
||||
{
|
||||
$exVersion = Get-VSExtensionVersion -packageName "WixToolset.VisualStudioExtension.Dev16"
|
||||
}
|
||||
else
|
||||
{
|
||||
$exVersion = Get-VSExtensionVersion -packageName "WixToolset.VisualStudioExtension.Dev15"
|
||||
}
|
||||
$exVersion | Should -Not -BeNullOrEmpty
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user