mirror of
https://github.com/actions/runner-images.git
synced 2026-01-06 18:19:54 +08:00
Merge branch 'master' into v-vlsafo/add-dotnettls-pester
This commit is contained in:
136
images/win/scripts/Tests/Browsers.Tests.ps1
Normal file
136
images/win/scripts/Tests/Browsers.Tests.ps1
Normal file
@@ -0,0 +1,136 @@
|
||||
Describe "Chrome" {
|
||||
Context "WebDriver" {
|
||||
It "ChromeWebDriver environment variable and path exists" {
|
||||
$env:ChromeWebDriver | Should -Not -BeNullOrEmpty
|
||||
$env:ChromeWebDriver | Should -BeExactly "C:\SeleniumWebDrivers\ChromeDriver"
|
||||
$env:ChromeWebDriver | Should -Exist
|
||||
}
|
||||
|
||||
It "chromedriver.exe is installed" {
|
||||
"$env:ChromeWebDriver\chromedriver.exe --version" | Should -ReturnZeroExitCode
|
||||
}
|
||||
|
||||
It "versioninfo.txt exists" {
|
||||
"$env:ChromeWebDriver\versioninfo.txt" | Should -Exist
|
||||
}
|
||||
}
|
||||
|
||||
Context "Browser" {
|
||||
$chromeRegPath = "HKLM:SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\chrome.exe"
|
||||
|
||||
It "Chrome '<chromeRegPath>' registry path exists" -TestCases @{chromeRegPath = $chromeRegPath} {
|
||||
$chromeRegPath | Should -Exist
|
||||
}
|
||||
|
||||
It "Chrome VersionInfo registry value exists" -TestCases @{chromeRegPath = $chromeRegPath} {
|
||||
$versionInfo = (Get-Item (Get-ItemProperty $chromeRegPath).'(Default)').VersionInfo
|
||||
$versionInfo | Should -Not -BeNullOrEmpty
|
||||
}
|
||||
|
||||
It "gupdate service is stopped" {
|
||||
$svc = Get-Service -Name gupdate
|
||||
$svc.Status | Should -BeExactly Stopped
|
||||
}
|
||||
|
||||
It "gupdatem service is stopped" {
|
||||
$svc = Get-Service -Name gupdatem
|
||||
$svc.Status | Should -BeExactly Stopped
|
||||
}
|
||||
|
||||
It "BlockGoogleUpdate firewall rule exists" {
|
||||
Get-NetFirewallRule -DisplayName BlockGoogleUpdate | Should -Not -BeNullOrEmpty
|
||||
}
|
||||
|
||||
It "chrome.exe is installed" {
|
||||
"${env:ProgramFiles(x86)}\Google\Chrome\Application\chrome.exe" | Should -Exist
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Describe "Edge" {
|
||||
Context "WebDriver" {
|
||||
It "EdgeWebDriver environment variable and path exists" {
|
||||
$env:EdgeWebDriver | Should -Not -BeNullOrEmpty
|
||||
$env:EdgeWebDriver | Should -BeExactly "C:\SeleniumWebDrivers\EdgeDriver"
|
||||
$env:EdgeWebDriver | Should -Exist
|
||||
}
|
||||
|
||||
It "msedgedriver.exe is installed" {
|
||||
"$env:EdgeWebDriver\msedgedriver.exe --version" | Should -ReturnZeroExitCode
|
||||
}
|
||||
|
||||
It "versioninfo.txt exists" {
|
||||
"$env:EdgeWebDriver\versioninfo.txt" | Should -Exist
|
||||
}
|
||||
}
|
||||
|
||||
Context "Browser" {
|
||||
$edgeRegPath = "HKLM:SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\msedge.exe"
|
||||
|
||||
It "Edge '<edgeRegPath>' registry path exists" -TestCases @{edgeRegPath = $edgeRegPath} {
|
||||
$edgeRegPath | Should -Exist
|
||||
}
|
||||
|
||||
It "Edge VersionInfo registry value exists" -TestCases @{edgeRegPath = $edgeRegPath} {
|
||||
$versionInfo = (Get-Item (Get-ItemProperty $edgeRegPath).'(Default)').VersionInfo
|
||||
$versionInfo | Should -Not -BeNullOrEmpty
|
||||
}
|
||||
|
||||
It "msedge.exe is installed" {
|
||||
"${env:ProgramFiles(x86)}\Microsoft\Edge\Application\msedge.exe" | Should -Exist
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Describe "Firefox" {
|
||||
Context "WebDriver" {
|
||||
It "GeckoWebDriver environment variable and path exists" {
|
||||
$env:GeckoWebDriver | Should -Not -BeNullOrEmpty
|
||||
$env:GeckoWebDriver | Should -BeExactly "C:\SeleniumWebDrivers\GeckoDriver"
|
||||
$env:GeckoWebDriver | Should -Exist
|
||||
}
|
||||
|
||||
It "geckodriver.exe is installed" {
|
||||
"$env:GeckoWebDriver\geckodriver.exe --version" | Should -ReturnZeroExitCode
|
||||
}
|
||||
|
||||
It "versioninfo.txt exists" {
|
||||
"$env:GeckoWebDriver\versioninfo.txt" | Should -Exist
|
||||
}
|
||||
}
|
||||
|
||||
Context "Browser" {
|
||||
$firefoxRegPath = "HKLM:SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\firefox.exe"
|
||||
|
||||
It "Firefox '<firefoxRegPath>' registry path exists" -TestCases @{firefoxRegPath = $firefoxRegPath} {
|
||||
$firefoxRegPath | Should -Exist
|
||||
}
|
||||
|
||||
It "Firefox VersionInfo registry value exists" -TestCases @{firefoxRegPath = $firefoxRegPath} {
|
||||
$versionInfo = (Get-Item (Get-ItemProperty $firefoxRegPath).'(Default)').VersionInfo
|
||||
$versionInfo | Should -Not -BeNullOrEmpty
|
||||
}
|
||||
|
||||
It "firefox.exe is installed" {
|
||||
"$env:ProgramFiles\Mozilla Firefox\firefox.exe" | Should -Exist
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Describe "Internet Explorer" {
|
||||
Context "WebDriver" {
|
||||
It "IEWebDriver environment variable and path exists" {
|
||||
$env:IEWebDriver | Should -Not -BeNullOrEmpty
|
||||
$env:IEWebDriver | Should -BeExactly "C:\SeleniumWebDrivers\IEDriver"
|
||||
$env:IEWebDriver | Should -Exist
|
||||
}
|
||||
|
||||
It "iedriverserver.exe is installed" {
|
||||
"$env:IEWebDriver\IEDriverServer.exe --version" | Should -ReturnZeroExitCode
|
||||
}
|
||||
|
||||
It "versioninfo.txt exists" {
|
||||
"$env:IEWebDriver\versioninfo.txt" | Should -Exist
|
||||
}
|
||||
}
|
||||
}
|
||||
37
images/win/scripts/Tests/Git.Tests.ps1
Normal file
37
images/win/scripts/Tests/Git.Tests.ps1
Normal file
@@ -0,0 +1,37 @@
|
||||
Describe "Git" {
|
||||
$gitTools = 'bash', 'awk', 'git', 'git-lfs'
|
||||
$gitTestCases = $gitTools | ForEach-Object {
|
||||
@{
|
||||
toolName = $_
|
||||
source = [regex]::Escape("$env:ProgramFiles\Git")
|
||||
}
|
||||
}
|
||||
|
||||
It "<toolName> is installed" -TestCases $gitTestCases {
|
||||
"$toolName --version" | Should -ReturnZeroExitCode
|
||||
}
|
||||
|
||||
It "<toolName> is located in '<source>'" -TestCases $gitTestCases {
|
||||
(Get-Command -Name $toolName).Source | Should -Match $source
|
||||
}
|
||||
|
||||
It "Git core.symlinks=true option is enabled" {
|
||||
git config core.symlinks | Should -BeExactly true
|
||||
}
|
||||
|
||||
It "GCM_INTERACTIVE environment variable should be equal Never" {
|
||||
$env:GCM_INTERACTIVE | Should -BeExactly Never
|
||||
}
|
||||
}
|
||||
|
||||
Describe "Hub" {
|
||||
It "hub is installed" {
|
||||
"hub --version" | Should -ReturnZeroExitCode
|
||||
}
|
||||
}
|
||||
|
||||
Describe "GitVersion" {
|
||||
It "gitversion is installed" {
|
||||
"gitversion /version" | Should -ReturnZeroExitCode
|
||||
}
|
||||
}
|
||||
30
images/win/scripts/Tests/Haskell.Tests.ps1
Normal file
30
images/win/scripts/Tests/Haskell.Tests.ps1
Normal file
@@ -0,0 +1,30 @@
|
||||
Describe "Haskell" {
|
||||
$chocoPackagesPath = Join-Path $env:ChocolateyInstall "lib"
|
||||
[array]$ghcVersionList = Get-ChildItem -Path $chocoPackagesPath -Filter "ghc.*" | ForEach-Object { $_.Name.TrimStart("ghc.") }
|
||||
$ghcCount = $ghcVersionList.Count
|
||||
$defaultGhcVersion = $ghcVersionList | Sort-Object {[Version]$_} | Select-Object -Last 1
|
||||
|
||||
$ghcTestCases = $ghcVersionList | ForEach-Object {
|
||||
$ghcVersion = $_
|
||||
@{
|
||||
ghcVersion = $ghcVersion
|
||||
binGhcPath = Join-Path $chocoPackagesPath "ghc.$ghcVersion\tools\ghc-$ghcVersion\bin\ghc.exe"
|
||||
}
|
||||
}
|
||||
|
||||
It "Accurate 3 versions of GHC are installed" -TestCases @{ghcCount = $ghcCount} {
|
||||
$ghcCount | Should -BeExactly 3
|
||||
}
|
||||
|
||||
It "GHC <ghcVersion> is installed" -TestCases $ghcTestCases {
|
||||
"$binGhcPath --version" | Should -MatchCommandOutput $ghcVersion
|
||||
}
|
||||
|
||||
It "GHC <defaultGhcVersion> is the default version and should be the latest installed" -TestCases @{defaultGhcVersion = $defaultGhcVersion} {
|
||||
"ghc --version" | Should -MatchCommandOutput $defaultGhcVersion
|
||||
}
|
||||
|
||||
It "Cabal is installed" {
|
||||
"cabal --version" | Should -ReturnZeroExitCode
|
||||
}
|
||||
}
|
||||
@@ -20,4 +20,86 @@ Describe "DotnetTLS" {
|
||||
It "Tls 1.2 is enabled" {
|
||||
[Net.ServicePointManager]::SecurityProtocol -band "Tls12" | Should -Be Tls12
|
||||
}
|
||||
}
|
||||
|
||||
Describe "Jq" {
|
||||
It "Jq" {
|
||||
"jq -n ." | Should -ReturnZeroExitCode
|
||||
}
|
||||
}
|
||||
|
||||
Describe "Julia" {
|
||||
It "Julia path exists" {
|
||||
"C:\Julia" | Should -Exist
|
||||
}
|
||||
|
||||
It "Julia" {
|
||||
"julia --version" | Should -ReturnZeroExitCode
|
||||
}
|
||||
}
|
||||
|
||||
Describe "Mercurial" {
|
||||
It "Mercurial" {
|
||||
"hg --version" | Should -ReturnZeroExitCode
|
||||
}
|
||||
}
|
||||
|
||||
Describe "KubernetesCli" {
|
||||
It "kubectl" {
|
||||
"kubectl version --client=true --short=true" | Should -ReturnZeroExitCode
|
||||
}
|
||||
|
||||
It "minikube" {
|
||||
"minikube version --short" | Should -ReturnZeroExitCode
|
||||
}
|
||||
}
|
||||
|
||||
Describe "Mingw64" {
|
||||
It "gcc" {
|
||||
"gcc --version" | Should -ReturnZeroExitCode
|
||||
}
|
||||
|
||||
It "g++" {
|
||||
"g++ --version" | Should -ReturnZeroExitCode
|
||||
}
|
||||
|
||||
It "make" {
|
||||
"make --version" | Should -ReturnZeroExitCode
|
||||
}
|
||||
}
|
||||
|
||||
Describe "InnoSetup" {
|
||||
It "InnoSetup" {
|
||||
(Get-Command -Name iscc).CommandType | Should -BeExactly "Application"
|
||||
}
|
||||
}
|
||||
|
||||
Describe "GitHub-CLI" {
|
||||
It "gh" {
|
||||
"gh --version" | Should -ReturnZeroExitCode
|
||||
}
|
||||
}
|
||||
|
||||
Describe "CloudFoundryCli" {
|
||||
It "cf is located in C:\cf-cli" {
|
||||
"C:\cf-cli\cf.exe" | Should -Exist
|
||||
}
|
||||
|
||||
It "cf" {
|
||||
"cf --version" | Should -ReturnZeroExitCode
|
||||
}
|
||||
}
|
||||
|
||||
Describe "GoogleCouldSDK" {
|
||||
It "bq" {
|
||||
"bq version" | Should -ReturnZeroExitCode
|
||||
}
|
||||
|
||||
It "gcloud" {
|
||||
"gcloud version" | Should -ReturnZeroExitCode
|
||||
}
|
||||
|
||||
It "gsutil" {
|
||||
"gsutil version" | Should -ReturnZeroExitCode
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user