mirror of
https://github.com/actions/runner-images-sangeeth.git
synced 2025-12-20 06:29:50 +00:00
Update Java.Tests.ps1
This commit is contained in:
@@ -1,8 +1,6 @@
|
|||||||
Import-Module "$PSScriptRoot/../helpers/Common.Helpers.psm1"
|
Import-Module "$PSScriptRoot/../helpers/Common.Helpers.psm1"
|
||||||
Import-Module "$PSScriptRoot/../helpers/Tests.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 {
|
function Get-NativeVersionFormat {
|
||||||
param($Version)
|
param($Version)
|
||||||
if ($Version -in "7", "8") {
|
if ($Version -in "7", "8") {
|
||||||
@@ -37,10 +35,13 @@ Describe "Java" {
|
|||||||
"/usr/libexec/java_home -v${Version}" | Should -ReturnZeroExitCode
|
"/usr/libexec/java_home -v${Version}" | Should -ReturnZeroExitCode
|
||||||
}
|
}
|
||||||
|
|
||||||
It "Version is valid" -TestCases $_ {
|
if ($_.Title -ne "Default") {
|
||||||
$javaRootPath = "/Library/Java/JavaVirtualMachines/adoptopenjdk-${Title}.jdk//Contents/Home"
|
It "Version is valid" -TestCases $_ {
|
||||||
$javaBinPath = Join-Path $javaRootPath "/bin/java"
|
$javaRootPath = "/Library/Java/JavaVirtualMachines/adoptopenjdk-${Title}.jdk/Contents/Home"
|
||||||
Validate-JavaVersion -JavaCommand "$javaBinPath -version" -ExpectedVersion $Version
|
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 $_ {
|
It "<EnvVariable>" -TestCases $_ {
|
||||||
|
|||||||
Reference in New Issue
Block a user