diff --git a/images/macos/software-report/SoftwareReport.Generator.ps1 b/images/macos/software-report/SoftwareReport.Generator.ps1 index 4eab767c..7d0ef369 100644 --- a/images/macos/software-report/SoftwareReport.Generator.ps1 +++ b/images/macos/software-report/SoftwareReport.Generator.ps1 @@ -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, diff --git a/images/macos/tests/Java.Tests.ps1 b/images/macos/tests/Java.Tests.ps1 index 9171eb5b..3ece545f 100644 --- a/images/macos/tests/Java.Tests.ps1 +++ b/images/macos/tests/Java.Tests.ps1 @@ -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 "" -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") { diff --git a/images/macos/tests/Python.Tests.ps1 b/images/macos/tests/Python.Tests.ps1 index 7a50a7ab..c75a7019 100644 --- a/images/macos/tests/Python.Tests.ps1 +++ b/images/macos/tests/Python.Tests.ps1 @@ -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 }