mirror of
https://github.com/actions/runner-images-sangeeth.git
synced 2026-01-01 06:37:32 +08:00
Merge pull request #1715 from maxim-lobanov/v-malob/big-sur
Enable Java tests since Java switching was fixed in MacOS 11.0
This commit is contained in:
@@ -82,6 +82,7 @@ $homebrewVersion = Run-Command "brew --version" | Select-Object -First 1
|
||||
$npmVersion = Run-Command "npm --version"
|
||||
$yarnVersion = Run-Command "yarn --version"
|
||||
$nugetVersion = Run-Command "nuget help" | Select-Object -First 1 | Take-Part -Part 2
|
||||
$pipVersion = Get-PipVersion -Version 2
|
||||
$pip3Version = Get-PipVersion -Version 3
|
||||
$pipxVersion = Get-PipxVersion
|
||||
$condaVersion = Invoke-Expression "conda --version"
|
||||
@@ -93,12 +94,9 @@ if ($os.IsHigherThanMojave) {
|
||||
$vcpkgVersion = Get-VcpkgVersion
|
||||
$markdown += New-MDList -Lines $vcpkgVersion -Style Unordered -NoNewLine
|
||||
}
|
||||
if ($os.IsLessThanBigSur) {
|
||||
$pipVersion = Get-PipVersion -Version 2
|
||||
$markdown += New-MDList -Style Unordered -Lines @("Pip ${pipVersion}") -NoNewLine
|
||||
}
|
||||
|
||||
$markdown += New-MDList -Style Unordered -Lines @(
|
||||
"Pip ${pipVersion}",
|
||||
"Pip ${pip3Version}",
|
||||
$pipxVersion,
|
||||
$bundlerVersion,
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
Import-Module "$PSScriptRoot/../helpers/Common.Helpers.psm1"
|
||||
Import-Module "$PSScriptRoot/../helpers/Tests.Helpers.psm1"
|
||||
|
||||
#Java tests are disabled because Java is not working properly on macOS 11.0 yet.
|
||||
$os = Get-OSVersion
|
||||
function Get-NativeVersionFormat {
|
||||
param($Version)
|
||||
if ($Version -in "7", "8") {
|
||||
@@ -11,7 +9,7 @@ function Get-NativeVersionFormat {
|
||||
return $Version
|
||||
}
|
||||
|
||||
Describe "Java" -Skip:($os.IsBigSur) {
|
||||
Describe "Java" {
|
||||
BeforeAll {
|
||||
function Validate-JavaVersion {
|
||||
param($JavaCommand, $ExpectedVersion)
|
||||
@@ -37,18 +35,19 @@ Describe "Java" -Skip:($os.IsBigSur) {
|
||||
"/usr/libexec/java_home -v${Version}" | Should -ReturnZeroExitCode
|
||||
}
|
||||
|
||||
It "Version is valid" -TestCases $_ {
|
||||
$javaRootPath = (Get-CommandResult "/usr/libexec/java_home -v${Version}").Output
|
||||
$javaBinPath = Join-Path $javaRootPath "/bin/java"
|
||||
Validate-JavaVersion -JavaCommand "$javaBinPath -version" -ExpectedVersion $Version
|
||||
if ($_.Title -ne "Default") {
|
||||
It "Version is valid" -TestCases $_ {
|
||||
$javaRootPath = "/Library/Java/JavaVirtualMachines/adoptopenjdk-${Title}.jdk/Contents/Home"
|
||||
if ($Title -eq "7") { $javaRootPath = "/Library/Java/JavaVirtualMachines/zulu-7.jdk/Contents/Home" }
|
||||
$javaBinPath = Join-Path $javaRootPath "/bin/java"
|
||||
Validate-JavaVersion -JavaCommand "$javaBinPath -version" -ExpectedVersion $Version
|
||||
}
|
||||
}
|
||||
|
||||
It "<EnvVariable>" -TestCases $_ {
|
||||
$envVariablePath = Get-EnvironmentVariable $EnvVariable
|
||||
$commandResult = Get-CommandResult "/usr/libexec/java_home -v${Version}"
|
||||
$commandResult.ExitCode | Should -Be 0
|
||||
$commandResult.Output | Should -Not -BeNullOrEmpty
|
||||
$commandResult.Output | Should -Be $envVariablePath
|
||||
$javaBinPath = Join-Path $envVariablePath "/bin/java"
|
||||
Validate-JavaVersion -JavaCommand "$javaBinPath -version" -ExpectedVersion $Version
|
||||
}
|
||||
|
||||
if ($_.Title -eq "Default") {
|
||||
|
||||
@@ -12,7 +12,7 @@ Describe "Python" {
|
||||
(Get-CommandResult "python --version").Output | Should -BeLike "Python 2.*"
|
||||
}
|
||||
|
||||
It "Python 2 is installed under /usr/local/bin" -Skip:($os.IsBigSur) {
|
||||
It "Python 2 is installed under /usr/local/bin" {
|
||||
Get-WhichTool "python" | Should -BeLike "/usr/local/bin*"
|
||||
}
|
||||
|
||||
@@ -24,7 +24,7 @@ Describe "Python" {
|
||||
Get-WhichTool "python3" | Should -BeLike "/usr/local/bin*"
|
||||
}
|
||||
|
||||
It "Pip 2 is available" -Skip:($os.IsBigSur) {
|
||||
It "Pip 2 is available" {
|
||||
"pip --version" | Should -ReturnZeroExitCode
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user