From c6c271672676f9d02828e6262d4126d6860700b3 Mon Sep 17 00:00:00 2001 From: Alexey-Ayupov <116575425+Alexey-Ayupov@users.noreply.github.com> Date: Tue, 28 Feb 2023 22:24:25 +0300 Subject: [PATCH] [macOS] prepare repository for macOS 13 (#7156) --- .../provision/configuration/finalize-vm.sh | 5 +- images/macos/provision/core/commonutils.sh | 30 ++--- images/macos/provision/core/ruby.sh | 62 ++++----- .../SoftwareReport.Generator.ps1 | 124 +++++++++++------- images/macos/tests/Android.Tests.ps1 | 29 ++-- images/macos/tests/BasicTools.Tests.ps1 | 12 +- images/macos/tests/Git.Tests.ps1 | 5 +- images/macos/tests/Java.Tests.ps1 | 4 +- images/macos/tests/RubyGem.Tests.ps1 | 4 +- 9 files changed, 161 insertions(+), 114 deletions(-) diff --git a/images/macos/provision/configuration/finalize-vm.sh b/images/macos/provision/configuration/finalize-vm.sh index 548e8b3bc..1fa346d0a 100644 --- a/images/macos/provision/configuration/finalize-vm.sh +++ b/images/macos/provision/configuration/finalize-vm.sh @@ -28,8 +28,9 @@ rm -rf ~/.fastlane npm cache clean --force # Clean yarn cache -yarn cache clean - +if ! is_Ventura; then + yarn cache clean +fi # Clean up temporary directories sudo rm -rf ~/utils ~/image-generation /tmp/* diff --git a/images/macos/provision/core/commonutils.sh b/images/macos/provision/core/commonutils.sh index 97ea9b3d8..5ee348e41 100644 --- a/images/macos/provision/core/commonutils.sh +++ b/images/macos/provision/core/commonutils.sh @@ -14,12 +14,14 @@ cask_packages=$(get_toolset_value '.brew.cask_packages[]') for package in $cask_packages; do echo "Installing $package..." if [[ $package == "virtualbox" ]]; then - # VirtualBox 7 crashes - # macOS host: Dropped all kernel extensions. VirtualBox relies fully on the hypervisor and vmnet frameworks provided by Apple now. - vbcask_url="https://raw.githubusercontent.com/Homebrew/homebrew-cask/aa3c55951fc9d687acce43e5c0338f42c1ddff7b/Casks/virtualbox.rb" - download_with_retries $vbcask_url - brew install ./virtualbox.rb - rm ./virtualbox.rb + if ! is_Ventura; then + # VirtualBox 7 crashes + # macOS host: Dropped all kernel extensions. VirtualBox relies fully on the hypervisor and vmnet frameworks provided by Apple now. + vbcask_url="https://raw.githubusercontent.com/Homebrew/homebrew-cask/aa3c55951fc9d687acce43e5c0338f42c1ddff7b/Casks/virtualbox.rb" + download_with_retries $vbcask_url + brew install ./virtualbox.rb + rm ./virtualbox.rb + fi else brew install --cask $package fi @@ -34,22 +36,18 @@ fi # System Preferences -> Security & Privacy -> General -> Unlock -> Allow -> Not now if is_Monterey; then if is_Veertu; then - retry=10 + retry=5 while [ $retry -gt 0 ]; do { osascript -e 'tell application "System Events" to get application processes where visible is true' - } && break - - retry=$((retry-1)) - if [ $retry -eq 0 ]; then - echo "No retry attempts left" - exit 1 - fi + } + osascript $HOME/utils/confirm-identified-developers.scpt $USER_PASSWORD + echo "retries left "$retry sleep 10 done + else + osascript $HOME/utils/confirm-identified-developers.scpt $USER_PASSWORD fi - - osascript $HOME/utils/confirm-identified-developers.scpt $USER_PASSWORD fi # Validate "Parallels International GmbH" kext diff --git a/images/macos/provision/core/ruby.sh b/images/macos/provision/core/ruby.sh index 0b60142ff..9741eab32 100755 --- a/images/macos/provision/core/ruby.sh +++ b/images/macos/provision/core/ruby.sh @@ -9,37 +9,39 @@ GEM_PATH=`gem env|awk '/EXECUTABLE DIRECTORY/ {print $4}'` echo "GEM_PATH=$GEM_PATH" >> "$HOME/.bashrc" echo 'export PATH="$GEM_PATH:/usr/local/opt/ruby@'${DEFAULT_RUBY_VERSION}'/bin:$PATH"' >> "$HOME/.bashrc" -echo "Install Ruby from toolset..." -[ -n "$API_PAT" ] && authString=(-H "Authorization: token ${API_PAT}") -PACKAGE_TAR_NAMES=$(curl "${authString[@]}" -s "https://api.github.com/repos/ruby/ruby-builder/releases/latest" | jq -r '.assets[].name') -TOOLSET_VERSIONS=$(get_toolset_value '.toolcache[] | select(.name | contains("Ruby")) | .versions[]') -RUBY_PATH="$AGENT_TOOLSDIRECTORY/Ruby" +if ! is_Ventura; then + echo "Install Ruby from toolset..." + [ -n "$API_PAT" ] && authString=(-H "Authorization: token ${API_PAT}") + PACKAGE_TAR_NAMES=$(curl "${authString[@]}" -s "https://api.github.com/repos/ruby/ruby-builder/releases/latest" | jq -r '.assets[].name') + TOOLSET_VERSIONS=$(get_toolset_value '.toolcache[] | select(.name | contains("Ruby")) | .versions[]') + RUBY_PATH="$AGENT_TOOLSDIRECTORY/Ruby" -echo "Check if Ruby hostedtoolcache folder exists..." -if [ ! -d $RUBY_PATH ]; then - mkdir -p $RUBY_PATH + echo "Check if Ruby hostedtoolcache folder exists..." + if [ ! -d $RUBY_PATH ]; then + mkdir -p $RUBY_PATH + fi + + for TOOLSET_VERSION in ${TOOLSET_VERSIONS[@]}; do + PACKAGE_TAR_NAME=$(echo "$PACKAGE_TAR_NAMES" | grep "^ruby-${TOOLSET_VERSION}-macos-latest.tar.gz$" | egrep -v "rc|preview" | sort -V | tail -1) + RUBY_VERSION=$(echo "$PACKAGE_TAR_NAME" | cut -d'-' -f 2) + RUBY_VERSION_PATH="$RUBY_PATH/$RUBY_VERSION" + + echo "Create Ruby $RUBY_VERSION directory..." + mkdir -p $RUBY_VERSION_PATH + + echo "Downloading tar archive $PACKAGE_TAR_NAME" + DOWNLOAD_URL="https://github.com/ruby/ruby-builder/releases/download/toolcache/${PACKAGE_TAR_NAME}" + download_with_retries $DOWNLOAD_URL "/tmp" $PACKAGE_TAR_NAME + + echo "Expand '$PACKAGE_TAR_NAME' to the '$RUBY_VERSION_PATH' folder" + tar xf "/tmp/$PACKAGE_TAR_NAME" -C $RUBY_VERSION_PATH + + COMPLETE_FILE_PATH="$RUBY_VERSION_PATH/x64.complete" + if [ ! -f $COMPLETE_FILE_PATH ]; then + echo "Create complete file" + touch $COMPLETE_FILE_PATH + fi + done fi -for TOOLSET_VERSION in ${TOOLSET_VERSIONS[@]}; do - PACKAGE_TAR_NAME=$(echo "$PACKAGE_TAR_NAMES" | grep "^ruby-${TOOLSET_VERSION}-macos-latest.tar.gz$" | egrep -v "rc|preview" | sort -V | tail -1) - RUBY_VERSION=$(echo "$PACKAGE_TAR_NAME" | cut -d'-' -f 2) - RUBY_VERSION_PATH="$RUBY_PATH/$RUBY_VERSION" - - echo "Create Ruby $RUBY_VERSION directory..." - mkdir -p $RUBY_VERSION_PATH - - echo "Downloading tar archive $PACKAGE_TAR_NAME" - DOWNLOAD_URL="https://github.com/ruby/ruby-builder/releases/download/toolcache/${PACKAGE_TAR_NAME}" - download_with_retries $DOWNLOAD_URL "/tmp" $PACKAGE_TAR_NAME - - echo "Expand '$PACKAGE_TAR_NAME' to the '$RUBY_VERSION_PATH' folder" - tar xf "/tmp/$PACKAGE_TAR_NAME" -C $RUBY_VERSION_PATH - - COMPLETE_FILE_PATH="$RUBY_VERSION_PATH/x64.complete" - if [ ! -f $COMPLETE_FILE_PATH ]; then - echo "Create complete file" - touch $COMPLETE_FILE_PATH - fi -done - invoke_tests "Ruby" diff --git a/images/macos/software-report/SoftwareReport.Generator.ps1 b/images/macos/software-report/SoftwareReport.Generator.ps1 index f3ff4d50e..46bcff91b 100644 --- a/images/macos/software-report/SoftwareReport.Generator.ps1 +++ b/images/macos/software-report/SoftwareReport.Generator.ps1 @@ -41,15 +41,19 @@ $languageAndRuntime.AddNodes($(Get-FortranVersions)) $languageAndRuntime.AddToolVersion("Go", $(Get-GoVersion)) $languageAndRuntime.AddToolVersion("Julia", $(Get-JuliaVersion)) $languageAndRuntime.AddToolVersion("Kotlin", $(Get-KotlinVersion)) -$languageAndRuntime.AddToolVersion("Mono", $(Get-MonoVersion)) -$languageAndRuntime.AddToolVersion("MSBuild", $(Get-MSBuildVersion)) -$languageAndRuntime.AddToolVersion("Node.js", $(Get-NodeVersion)) -$languageAndRuntime.AddToolVersion("NVM", $(Get-NVMVersion)) -$languageAndRuntime.AddToolVersionsListInline("NVM - Cached node versions", $(Get-NVMNodeVersionList), '^\d+') +if (-not $os.IsVentura) { + $languageAndRuntime.AddToolVersion("Mono", $(Get-MonoVersion)) + $languageAndRuntime.AddToolVersion("MSBuild", $(Get-MSBuildVersion)) + $languageAndRuntime.AddToolVersion("Node.js", $(Get-NodeVersion)) + $languageAndRuntime.AddToolVersion("NVM", $(Get-NVMVersion)) + $languageAndRuntime.AddToolVersionsListInline("NVM - Cached node versions", $(Get-NVMNodeVersionList), '^\d+') +} $languageAndRuntime.AddToolVersion("Perl", $(Get-PerlVersion)) $languageAndRuntime.AddToolVersion("PHP", $(Get-PHPVersion)) -$languageAndRuntime.AddToolVersion("Python", $(Get-PythonVersion)) -$languageAndRuntime.AddToolVersion("Python3", $(Get-Python3Version)) +if (-not $os.IsVentura) { + $languageAndRuntime.AddToolVersion("Python", $(Get-PythonVersion)) + $languageAndRuntime.AddToolVersion("Python3", $(Get-Python3Version)) +} $languageAndRuntime.AddToolVersion("R", $(Get-RVersion)) $languageAndRuntime.AddToolVersion("Ruby", $(Get-RubyVersion)) @@ -60,12 +64,16 @@ $packageManagement.AddToolVersion("Carthage", $(Get-CarthageVersion)) $packageManagement.AddToolVersion("CocoaPods", $(Get-CocoaPodsVersion)) $packageManagement.AddToolVersion("Composer", $(Get-ComposerVersion)) $packageManagement.AddToolVersion("Homebrew", $(Get-HomebrewVersion)) -$packageManagement.AddToolVersion("Miniconda", $(Get-CondaVersion)) +if (-not $os.IsVentura) { + $packageManagement.AddToolVersion("Miniconda", $(Get-CondaVersion)) +} $packageManagement.AddToolVersion("NPM", $(Get-NPMVersion)) $packageManagement.AddToolVersion("NuGet", $(Get-NuGetVersion)) -$packageManagement.AddToolVersion("Pip", $(Get-PipVersion -Version 2)) -$packageManagement.AddToolVersion("Pip3", $(Get-PipVersion -Version 3)) -$packageManagement.AddToolVersion("Pipx", $(Get-PipxVersion)) +if (-not $os.IsVentura) { + $packageManagement.AddToolVersion("Pip", $(Get-PipVersion -Version 2)) + $packageManagement.AddToolVersion("Pip3", $(Get-PipVersion -Version 3)) + $packageManagement.AddToolVersion("Pipx", $(Get-PipxVersion)) +} $packageManagement.AddToolVersion("RubyGems", $(Get-RubyGemsVersion)) $packageManagement.AddToolVersion("Vcpkg", $(Get-VcpkgVersion)) $packageManagement.AddToolVersion("Yarn", $(Get-YarnVersion)) @@ -75,9 +83,11 @@ $packageManagement.AddNode($(Build-PackageManagementEnvironmentTable)) # Project Management $projectManagement = $installedSoftware.AddHeader("Project Management") $projectManagement.AddToolVersion("Apache Ant", $(Get-ApacheAntVersion)) -$projectManagement.AddToolVersion("Apache Maven", $(Get-MavenVersion)) -$projectManagement.AddToolVersion("Gradle", $(Get-GradleVersion)) -$projectManagement.AddToolVersion("Sbt", $(Get-SbtVersion)) +if (-not $os.IsVentura) { + $projectManagement.AddToolVersion("Apache Maven", $(Get-MavenVersion)) + $projectManagement.AddToolVersion("Gradle", $(Get-GradleVersion)) + $projectManagement.AddToolVersion("Sbt", $(Get-SbtVersion)) +} # Utilities $utilities = $installedSoftware.AddHeader("Utilities") @@ -97,25 +107,32 @@ $utilities.AddToolVersion("gpg (GnuPG)", $(Get-GPGVersion)) if ($os.IsBigSur) { $utilities.AddToolVersion("helm", $(Get-HelmVersion)) } -$utilities.AddToolVersion("Hub CLI", $(Get-HubVersion)) -$utilities.AddToolVersion("ImageMagick", $(Get-ImageMagickVersion)) +if (-not $os.IsVentura) { + $utilities.AddToolVersion("Hub CLI", $(Get-HubVersion)) + $utilities.AddToolVersion("ImageMagick", $(Get-ImageMagickVersion)) +} $utilities.AddToolVersion("jq", $(Get-JqVersion)) -$utilities.AddToolVersion("mongo", $(Get-MongoVersion)) -$utilities.AddToolVersion("mongod", $(Get-MongodVersion)) +if (-not $os.IsVentura) { + $utilities.AddToolVersion("mongo", $(Get-MongoVersion)) + $utilities.AddToolVersion("mongod", $(Get-MongodVersion)) +} if ($os.IsBigSur) { $utilities.AddToolVersion("Newman", $(Get-NewmanVersion)) } $utilities.AddToolVersion("OpenSSL", $(Get-OpenSSLVersion)) $utilities.AddToolVersion("Packer", $(Get-PackerVersion)) -$utilities.AddToolVersion("pkg-config", $(Get-PKGConfigVersion)) -$utilities.AddToolVersion("PostgreSQL", $(Get-PostgresServerVersion)) -$utilities.AddToolVersion("psql (PostgreSQL)", $(Get-PostgresClientVersion)) -$utilities.AddToolVersion("Sox", $(Get-SoxVersion)) -$utilities.AddToolVersion("Subversion (SVN)", $(Get-SVNVersion)) -$utilities.AddToolVersion("Switchaudio-osx", $(Get-SwitchAudioOsxVersion)) +if (-not $os.IsVentura) { + $utilities.AddToolVersion("PostgreSQL", $(Get-PostgresServerVersion)) + $utilities.AddToolVersion("psql (PostgreSQL)", $(Get-PostgresClientVersion)) + $utilities.AddToolVersion("Sox", $(Get-SoxVersion)) + $utilities.AddToolVersion("Subversion (SVN)", $(Get-SVNVersion)) + $utilities.AddToolVersion("Switchaudio-osx", $(Get-SwitchAudioOsxVersion)) +} if (-not $os.IsBigSur) { $utilities.AddToolVersion("Vagrant", $(Get-VagrantVersion)) - $utilities.AddToolVersion("VirtualBox", $(Get-VirtualBoxVersion)) + if (-not $os.IsVentura) { + $utilities.AddToolVersion("VirtualBox", $(Get-VirtualBoxVersion)) + } } $utilities.AddToolVersion("yq", $(Get-YqVersion)) $utilities.AddToolVersion("zstd", $(Get-ZstdVersion)) @@ -125,7 +142,9 @@ $tools = $installedSoftware.AddHeader("Tools") if ($os.IsBigSur) { $tools.AddToolVersion("Aliyun CLI", $(Get-AliyunCLIVersion)) } -$tools.AddToolVersion("App Center CLI", $(Get-AppCenterCLIVersion)) +if (-not $os.IsVentura) { + $tools.AddToolVersion("App Center CLI", $(Get-AppCenterCLIVersion)) +} $tools.AddToolVersion("AWS CLI", $(Get-AWSCLIVersion)) $tools.AddToolVersion("AWS SAM CLI", $(Get-AWSSAMCLIVersion)) $tools.AddToolVersion("AWS Session Manager CLI", $(Get-AWSSessionManagerCLIVersion)) @@ -135,20 +154,28 @@ $tools.AddToolVersion("Bicep CLI", $(Get-BicepVersion)) $tools.AddToolVersion("Cabal", $(Get-CabalVersion)) $tools.AddToolVersion("Cmake", $(Get-CmakeVersion)) $tools.AddToolVersion("CodeQL Action Bundles", $(Get-CodeQLBundleVersions)) -$tools.AddToolVersion("Colima", $(Get-ColimaVersion)) +if ($os.IsMonterey) { + $tools.AddToolVersion("Colima", $(Get-ColimaVersion)) +} $tools.AddToolVersion("Fastlane", $(Get-FastlaneVersion)) $tools.AddToolVersion("GHC", $(Get-GHCVersion)) $tools.AddToolVersion("GHCup", $(Get-GHCupVersion)) -$tools.AddToolVersion("Jazzy", $(Get-JazzyVersion)) +if (-not $os.IsVentura) { + $tools.AddToolVersion("Jazzy", $(Get-JazzyVersion)) +} $tools.AddToolVersion("Stack", $(Get-StackVersion)) $tools.AddToolVersion("SwiftFormat", $(Get-SwiftFormatVersion)) -$tools.AddToolVersion("Swig", $(Get-SwigVersion)) +if (-not $os.IsVentura) { + $tools.AddToolVersion("Swig", $(Get-SwigVersion)) +} $tools.AddToolVersion("Xcode Command Line Tools", $(Get-XcodeCommandLineToolsVersion)) # Linters $linters = $installedSoftware.AddHeader("Linters") $linters.AddToolVersion("SwiftLint", $(Get-SwiftLintVersion)) -$linters.AddToolVersion("Yamllint", $(Get-YamllintVersion)) +if (-not $os.IsVentura) { + $linters.AddToolVersion("Yamllint", $(Get-YamllintVersion)) +} # Browsers $browsers = $installedSoftware.AddHeader("Browsers") @@ -159,13 +186,15 @@ $browsers.AddNode($(Build-BrowserWebdriversEnvironmentTable)) $java = $installedSoftware.AddHeader("Java") $java.AddTable($(Get-JavaVersions)) -# Graal -$graalvm = $installedSoftware.AddHeader("GraalVM") -$graalvm.AddTable($(Build-GraalVMTable)) +if (-not $os.IsVentura) { + # Graal + $graalvm = $installedSoftware.AddHeader("GraalVM") + $graalvm.AddTable($(Build-GraalVMTable)) -# Toolcache -$toolcache = $installedSoftware.AddHeader("Cached Tools") -$toolcache.AddNodes($(Build-ToolcacheSection)) + # Toolcache + $toolcache = $installedSoftware.AddHeader("Cached Tools") + $toolcache.AddNodes($(Build-ToolcacheSection)) +} # Rust $rust = $installedSoftware.AddHeader("Rust Tools") @@ -190,14 +219,17 @@ $powerShellModules = $powerShell.AddHeader("PowerShell Modules") $powerShellModules.AddNodes($(Get-PowerShellModules)) # Web Servers -$webServers = $installedSoftware.AddHeader("Web Servers") -$webServers.AddTable($(Build-WebServersSection)) +if (-not $os.IsVentura) { + $webServers = $installedSoftware.AddHeader("Web Servers") + $webServers.AddTable($(Build-WebServersSection)) +} # Xamarin section +if (-not $os.IsVentura) { $xamarin = $installedSoftware.AddHeader("Xamarin") $vsForMac = $xamarin.AddHeader("Visual Studio for Mac") $vsForMac.AddTable($(Build-VSMacTable)) -$note = +$note = @' To use Visual Studio 2019 by default rename the app: mv "/Applications/Visual Studio.app" "/Applications/Visual Studio 2022.app" @@ -206,12 +238,12 @@ mv "/Applications/Visual Studio 2019.app" "/Applications/Visual Studio.app" $vsForMacNotes = $vsForMac.AddHeader("Notes") $vsForMacNotes.AddNote($note) - $xamarinBundles = $xamarin.AddHeader("Xamarin bundles") $xamarinBundles.AddTable($(Build-XamarinTable)) $unitTestFramework = $xamarin.AddHeader("Unit Test Framework") $unitTestFramework.AddToolVersion("NUnit", $(Get-NUnitVersion)) +} # Xcode section $xcode = $installedSoftware.AddHeader("Xcode") @@ -238,11 +270,13 @@ $android.AddTable($androidTable) $androidEnv = $android.AddHeader("Environment variables") $androidEnv.AddTable($(Build-AndroidEnvironmentTable)) -$miscellaneous = $installedSoftware.AddHeader("Miscellaneous") -$miscellaneous.AddToolVersion("libXext", $(Get-LibXextVersion)) -$miscellaneous.AddToolVersion("libXft", $(Get-LibXftVersion)) -$miscellaneous.AddToolVersion("Tcl/Tk", $(Get-TclTkVersion)) -$miscellaneous.AddToolVersion("Zlib", $(Get-ZlibVersion)) +if (-not $os.IsVentura) { + $miscellaneous = $installedSoftware.AddHeader("Miscellaneous") + $miscellaneous.AddToolVersion("libXext", $(Get-LibXextVersion)) + $miscellaneous.AddToolVersion("libXft", $(Get-LibXftVersion)) + $miscellaneous.AddToolVersion("Tcl/Tk", $(Get-TclTkVersion)) + $miscellaneous.AddToolVersion("Zlib", $(Get-ZlibVersion)) +} if ($os.IsMonterey) { $miscellaneousEnv = $miscellaneous.AddHeader("Environment variables") diff --git a/images/macos/tests/Android.Tests.ps1 b/images/macos/tests/Android.Tests.ps1 index a1d18ef41..7ab9e4a43 100644 --- a/images/macos/tests/Android.Tests.ps1 +++ b/images/macos/tests/Android.Tests.ps1 @@ -51,16 +51,25 @@ Describe "Android" { } Context "SDKManagers" { - $testCases = @( - @{ - PackageName = "SDK tools" - Sdkmanager = "$env:ANDROID_HOME/tools/bin/sdkmanager" - }, - @{ - PackageName = "Command-line tools" - Sdkmanager = "$env:ANDROID_HOME/cmdline-tools/latest/bin/sdkmanager" - } - ) + if (-not $os.IsVentura) { + $testCases = @( + @{ + PackageName = "SDK tools" + Sdkmanager = "$env:ANDROID_HOME/tools/bin/sdkmanager" + }, + @{ + PackageName = "Command-line tools" + Sdkmanager = "$env:ANDROID_HOME/cmdline-tools/latest/bin/sdkmanager" + } + ) + }else { + $testCases = @( + @{ + PackageName = "Command-line tools" + Sdkmanager = "$env:ANDROID_HOME/cmdline-tools/latest/bin/sdkmanager" + } + ) + } It "Sdkmanager from is available" -TestCases $testCases { "$Sdkmanager --version" | Should -ReturnZeroExitCode diff --git a/images/macos/tests/BasicTools.Tests.ps1 b/images/macos/tests/BasicTools.Tests.ps1 index 0373d1ddf..ec5afec93 100644 --- a/images/macos/tests/BasicTools.Tests.ps1 +++ b/images/macos/tests/BasicTools.Tests.ps1 @@ -24,7 +24,7 @@ Describe "cmake" { } } -Describe "Subversion" { +Describe "Subversion" -Skip:($os.IsVentura) { It "Subversion" { "svn --version" | Should -ReturnZeroExitCode } @@ -60,7 +60,7 @@ Describe "Perl" { } } -Describe "Helm" -Skip:($os.IsMonterey) { +Describe "Helm" -Skip:($os.IsMonterey -or $os.IsVentura) { It "Helm" { "helm version --short" | Should -ReturnZeroExitCode } @@ -108,7 +108,7 @@ Describe "bazel" { } } -Describe "Aliyun CLI" -Skip:($os.IsMonterey) { +Describe "Aliyun CLI" -Skip:($os.IsMonterey -or $os.IsVentura) { It "Aliyun CLI" { "aliyun --version" | Should -ReturnZeroExitCode } @@ -144,7 +144,7 @@ Describe "vagrant" -Skip:($os.IsBigSur) { } } -Describe "virtualbox" -Skip:($os.IsBigSur) { +Describe "virtualbox" -Skip:($os.IsBigSur -or $os.IsVentura) { It "virtualbox" { "vboxmanage -v" | Should -ReturnZeroExitCode } @@ -170,7 +170,7 @@ Describe "Kotlin" { } } -Describe "sbt" { +Describe "sbt" -Skip:($os.IsVentura) { It "sbt" { "sbt -version" | Should -ReturnZeroExitCode } @@ -182,7 +182,7 @@ Describe "yq" { } } -Describe "imagemagick" { +Describe "imagemagick" -Skip:($os.IsVentura) { It "imagemagick" { "magick -version" | Should -ReturnZeroExitCode } diff --git a/images/macos/tests/Git.Tests.ps1 b/images/macos/tests/Git.Tests.ps1 index 4638c21fa..c0600daec 100644 --- a/images/macos/tests/Git.Tests.ps1 +++ b/images/macos/tests/Git.Tests.ps1 @@ -1,12 +1,13 @@ +$os = Get-OSVersion Describe "Git" { It "git is installed" { "git --version" | Should -ReturnZeroExitCode } - It "git lfs is installed" { "git lfs version" | Should -ReturnZeroExitCode } - +} +Describe "hub CLI" -Skip:($os.IsVentura) { It "hub CLI is installed" { "hub --version" | Should -ReturnZeroExitCode } diff --git a/images/macos/tests/Java.Tests.ps1 b/images/macos/tests/Java.Tests.ps1 index fd67ea656..b1456eb6b 100644 --- a/images/macos/tests/Java.Tests.ps1 +++ b/images/macos/tests/Java.Tests.ps1 @@ -1,6 +1,8 @@ Import-Module "$PSScriptRoot/../helpers/Common.Helpers.psm1" Import-Module "$PSScriptRoot/../helpers/Tests.Helpers.psm1" -DisableNameChecking +$os = Get-OSVersion + function Get-NativeVersionFormat { param($Version) if ($Version -in "8") { @@ -56,7 +58,7 @@ Describe "Java" { } Context "Java Adopt" { - Describe "Java Adopt" { + Describe "Java Adopt" -Skip:($os.IsVentura) { It "Java Adopt " -TestCases $adoptCases { $adoptPath = Join-Path (Get-ChildItem ${env:AGENT_TOOLSDIRECTORY}\Java_Adopt_jdk\${Version}*) "x64\Contents\Home\bin\java" diff --git a/images/macos/tests/RubyGem.Tests.ps1 b/images/macos/tests/RubyGem.Tests.ps1 index 5e15d2f70..5e906096d 100644 --- a/images/macos/tests/RubyGem.Tests.ps1 +++ b/images/macos/tests/RubyGem.Tests.ps1 @@ -19,7 +19,7 @@ Describe "Bundler" { } } -Describe "Nomad shenzhen CLI" -Skip:($os.IsMonterey) { +Describe "Nomad shenzhen CLI" -Skip:($os.IsMonterey -or $os.IsVentura) { It "Nomad shenzhen CLI" { "ipa --version" | Should -ReturnZeroExitCode } @@ -37,7 +37,7 @@ Describe "xcpretty" { } } -Describe "jazzy" { +Describe "jazzy" -Skip:($os.IsVentura) { It "jazzy" { "jazzy --version" | Should -ReturnZeroExitCode }