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

99 lines
2.5 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
}
Describe "vcpkg" -Skip:($os.IsVenturaArm64) {
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
}
}
Describe "CocoaPods" {
It "CocoaPods" {
"pod --version" | Should -ReturnZeroExitCode
2021-01-11 13:30:51 +07:00
}
}
2021-07-07 09:10:31 -05:00
Describe "Bicep" {
It "Bicep" {
"bicep --version" | Should -ReturnZeroExitCode
}
}
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-11-05 08:41:59 -06:00
Describe "Unxip" {
It "Unxip" {
"unxip --version" | Should -ReturnZeroExitCode
}
}
Describe "Sudoers" {
It "Sudo Cache" {
"sudo -v" | Should -ReturnZeroExitCode
}
It "Sudoers files" {
"sudo visudo -c" | Should -ReturnZeroExitCode
}
}