mirror of
https://github.com/actions/runner-images-sangeeth.git
synced 2025-12-20 06:29:50 +00:00
[Windows] Refactor test helpers (#8889)
This commit is contained in:
committed by
GitHub
parent
79c347765a
commit
9492109c62
@@ -28,13 +28,13 @@ Describe "Java" {
|
||||
$javaVariableValue | Should -Not -BeNullOrEmpty
|
||||
$javaPath = Join-Path $javaVariableValue "bin\java"
|
||||
|
||||
$result = Get-CommandResult "`"$javaPath`" -version"
|
||||
$result.ExitCode | Should -Be 0
|
||||
|
||||
if ($Version -eq 8) {
|
||||
$Version = "1.${Version}"
|
||||
}
|
||||
$outputPattern = "openjdk version `"${Version}"
|
||||
$result.Output[0] | Should -Match $outputPattern
|
||||
|
||||
$outputLines = (& $env:comspec /c "`"$javaPath`" -version 2>&1") -as [string[]]
|
||||
$LASTEXITCODE | Should -Be 0
|
||||
$outputLines[0] | Should -Match $outputPattern
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user