Files
runner-images/images/macos/scripts/tests/Common.Tests.ps1
T

165 lines
4.8 KiB
PowerShell
Raw Normal View History

2020-09-10 14:34:08 +03:00
Import-Module "$PSScriptRoot/../helpers/Common.Helpers.psm1"
2023-11-28 02:25:03 +01:00
Import-Module "$PSScriptRoot/Helpers.psm1" -DisableNameChecking
2020-09-10 14:34:08 +03:00
$os = Get-OSVersion
Describe ".NET" {
It ".NET" {
"dotnet --version" | Should -ReturnZeroExitCode
}
}
Describe "GCC" {
2023-12-04 12:13:08 +01:00
$testCases = (Get-ToolsetContent).gcc.versions | ForEach-Object { @{Version = $_ } }
2020-09-10 14:34:08 +03:00
It "GCC <Version>" -TestCases $testCases {
2020-09-10 14:34:08 +03:00
param (
[string] $Version
2020-09-10 14:34:08 +03:00
)
2020-09-21 10:53:56 +03:00
"gcc-$Version --version" | Should -ReturnZeroExitCode
2020-09-10 14:34:08 +03:00
}
It "Gfortran <Version>" -TestCases $testCases {
2020-09-10 14:34:08 +03:00
param (
[string] $Version
2020-09-10 14:34:08 +03:00
)
"gfortran-$Version --version" | Should -ReturnZeroExitCode
2020-09-10 14:34:08 +03:00
}
2020-12-03 18:40:19 +03:00
It "Gfortran is not found in the default path" {
"$(which gfortran)" | Should -BeNullOrEmpty
}
2020-09-10 14:34:08 +03:00
}
2024-09-03 18:45:06 +02:00
Describe "vcpkg" -Skip:($os.IsVenturaArm64 -or $os.IsSonoma -or $os.IsSequoia) {
2020-09-10 14:34:08 +03:00
It "vcpkg" {
"vcpkg version" | Should -ReturnZeroExitCode
}
}
Describe "AWS" {
2021-01-11 13:30:51 +07:00
It "AWS CLI" {
"aws --version" | Should -ReturnZeroExitCode
}
It "AWS SAM CLI" {
2021-01-11 13:30:51 +07:00
"sam --version" | Should -ReturnZeroExitCode
}
It "AWS Session Manager CLI" {
"session-manager-plugin --version" | Should -ReturnZeroExitCode
}
}
Describe "AzCopy" {
It "AzCopy" {
"azcopy --version" | Should -ReturnZeroExitCode
}
}
2024-09-03 18:45:06 +02:00
Describe "Miniconda" -Skip:($os.IsVentura -or $os.IsSonoma -or $os.IsSequoia) {
2021-01-11 13:30:51 +07:00
It "Conda" {
2023-12-04 12:13:08 +01:00
[System.Environment]::GetEnvironmentVariable("CONDA") | Should -Not -BeNullOrEmpty
2021-01-11 13:30:51 +07:00
$condaBinPath = Join-Path $env:CONDA "bin" "conda"
"$condaBinPath --version" | Should -ReturnZeroExitCode
}
}
2024-09-03 18:45:06 +02:00
Describe "Stack" -Skip:($os.IsVentura -or $os.IsSonoma -or $os.IsSequoia) {
2021-01-11 13:30:51 +07:00
It "Stack" {
"stack --version" | Should -ReturnZeroExitCode
}
}
Describe "CocoaPods" {
It "CocoaPods" {
"pod --version" | Should -ReturnZeroExitCode
2021-01-11 13:30:51 +07:00
}
}
2024-09-03 18:45:06 +02:00
Describe "VSMac" -Skip:($os.IsVentura -or $os.IsSonoma -or $os.IsSequoia) {
2023-12-04 12:13:08 +01:00
$vsMacVersions = (Get-ToolsetContent).xamarin.vsmac.versions
$defaultVSMacVersion = (Get-ToolsetContent).xamarin.vsmac.default
$testCases = $vsMacVersions | ForEach-Object {
$vsPath = "/Applications/Visual Studio $_.app"
if ($_ -eq $defaultVSMacVersion) {
$vsPath = "/Applications/Visual Studio.app"
}
@{ vsversion = $_ ; vspath = $vsPath }
}
It "Visual Studio <vsversion> for Mac is installed" -TestCases $testCases {
$vstoolPath = Join-Path $vsPath "Contents/MacOS/vstool"
$vsPath | Should -Exist
$vstoolPath | Should -Exist
}
2022-05-18 16:49:37 +02:00
It "Visual Studio $defaultVSMacVersion for Mac is default" {
$vsPath = "/Applications/Visual Studio.app"
2022-05-18 16:49:37 +02:00
$vstoolPath = Join-Path $vsPath "Contents/MacOS/vstool"
$vsPath | Should -Exist
$vstoolPath | Should -Exist
}
2021-06-07 16:00:50 +03:00
}
2024-09-03 18:45:06 +02:00
Describe "Swig" -Skip:($os.IsVentura -or $os.IsSonoma -or $os.IsSequoia) {
2021-06-07 16:00:50 +03:00
It "Swig" {
"swig -version" | Should -ReturnZeroExitCode
}
}
2021-07-07 09:10:31 -05:00
Describe "Bicep" {
It "Bicep" {
"bicep --version" | Should -ReturnZeroExitCode
}
}
2024-09-03 18:45:06 +02:00
Describe "Go" -Skip:($os.IsVentura -or $os.IsSonoma -or $os.IsSequoia) {
It "Go" {
"go version" | Should -ReturnZeroExitCode
}
}
2024-09-03 18:45:06 +02:00
Describe "VirtualBox" -Skip:($os.IsVentura -or $os.IsSonoma -or $os.IsSequoia) {
2023-11-06 11:53:10 +01:00
It "Check kext kernel modules" {
kextstat | Out-String | Should -Match "org.virtualbox.kext"
}
}
Describe "CodeQL Bundle" {
It "Is installed" {
$CodeQLVersionWildcard = Join-Path $Env:AGENT_TOOLSDIRECTORY -ChildPath "CodeQL" | Join-Path -ChildPath "*"
$CodeQLVersionPath = Get-ChildItem $CodeQLVersionWildcard | Select-Object -First 1 -Expand FullName
$CodeQLPath = Join-Path $CodeQLVersionPath -ChildPath "x64" | Join-Path -ChildPath "codeql" | Join-Path -ChildPath "codeql"
"$CodeQLPath version --quiet" | Should -ReturnZeroExitCode
$CodeQLPacksPath = Join-Path $CodeQLVersionPath -ChildPath "x64" | Join-Path -ChildPath "codeql" | Join-Path -ChildPath "qlpacks"
$CodeQLPacksPath | Should -Exist
}
2022-09-27 09:54:35 +02:00
}
2024-09-03 18:45:06 +02:00
Describe "Colima" -Skip:($os.IsVentura -or $os.IsSonoma -or $os.IsSequoia) {
2022-09-27 09:54:35 +02:00
It "Colima" {
"colima version" | Should -ReturnZeroExitCode
}
}
Describe "Compiled" -Skip:(-not $os.IsMonterey) {
It "Apache Ant" {
"ant -version" | Should -ReturnZeroExitCode
}
$kotlinPackages = @("kapt", "kotlin", "kotlinc", "kotlinc-jvm", "kotlin-dce-js")
It "<toolName> is available" -TestCases ($kotlinPackages | ForEach-Object { @{ toolName = $_ } }) {
"$toolName -version" | Should -ReturnZeroExitCode
}
It "sbt" {
"sbt -version" | Should -ReturnZeroExitCode
}
}