diff --git a/images/macos/templates/macOS-13.anka.pkr.hcl b/images/macos/templates/macOS-13.anka.pkr.hcl index d02c4893..28bd20a8 100644 --- a/images/macos/templates/macOS-13.anka.pkr.hcl +++ b/images/macos/templates/macOS-13.anka.pkr.hcl @@ -231,7 +231,8 @@ build { } provisioner "shell" { inline = [ - "pwsh -File \"$HOME/image-generation/software-report/SoftwareReport.Generator.ps1\" -OutputDirectory \"$HOME/image-generation/output/software-report\" -ImageName ${var.build_id}" + "pwsh -File \"$HOME/image-generation/software-report/SoftwareReport.Generator.ps1\" -OutputDirectory \"$HOME/image-generation/output/software-report\" -ImageName ${var.build_id}", + "pwsh -File \"$HOME/image-generation/tests/RunAll-Tests.ps1\"" ] execute_command = "source $HOME/.bash_profile; {{ .Vars }} {{ .Path }}" } diff --git a/images/macos/tests/Common.Tests.ps1 b/images/macos/tests/Common.Tests.ps1 index d3a4dbb0..243ad26f 100644 --- a/images/macos/tests/Common.Tests.ps1 +++ b/images/macos/tests/Common.Tests.ps1 @@ -58,7 +58,7 @@ Describe "AzCopy" { } } -Describe "Miniconda" { +Describe "Miniconda" -Skip:($os.IsVentura) { It "Conda" { Get-EnvironmentVariable "CONDA" | Should -Not -BeNullOrEmpty $condaBinPath = Join-Path $env:CONDA "bin" "conda" @@ -105,7 +105,7 @@ Describe "VSMac" { } } -Describe "Swig" { +Describe "Swig" -Skip:($os.IsVentura) { It "Swig" { "swig -version" | Should -ReturnZeroExitCode } @@ -117,13 +117,13 @@ Describe "Bicep" { } } -Describe "Go" { +Describe "Go" -Skip:($os.IsVentura) { It "Go" { "go version" | Should -ReturnZeroExitCode } } -Describe "VirtualBox" -Skip:($os.IsBigSur) { +Describe "VirtualBox" -Skip:($os.IsBigSur -or $os.IsVentura) { It "Check kext kernel modules" { kextstat | Out-String | Should -Match "org.virtualbox.kext" } @@ -165,7 +165,7 @@ Describe "CodeQLBundles" { } } -Describe "Colima" { +Describe "Colima" -Skip:($os.IsVentura) { It "Colima" { "colima version" | Should -ReturnZeroExitCode } diff --git a/images/macos/tests/Databases.Tests.ps1 b/images/macos/tests/Databases.Tests.ps1 index 084b2d91..4483c7c3 100644 --- a/images/macos/tests/Databases.Tests.ps1 +++ b/images/macos/tests/Databases.Tests.ps1 @@ -1,4 +1,9 @@ -Describe "MongoDB" { + +Import-Module "$PSScriptRoot/../helpers/Common.Helpers.psm1" + +$os = Get-OSVersion + +Describe "MongoDB" -Skip:($os.IsVentura) { It "" -TestCases @( @{ ToolName = "mongo" } @{ ToolName = "mongod" } @@ -8,7 +13,7 @@ Describe "MongoDB" { } } -Describe "PostgreSQL" { +Describe "PostgreSQL" -Skip:($os.IsVentura) { It "PostgreSQL version should correspond to the version in the toolset" { $toolsetVersion = Get-ToolsetValue 'postgresql.version' # Client version diff --git a/images/macos/tests/Node.Tests.ps1 b/images/macos/tests/Node.Tests.ps1 index cb2c4420..b6d37eaf 100644 --- a/images/macos/tests/Node.Tests.ps1 +++ b/images/macos/tests/Node.Tests.ps1 @@ -21,7 +21,7 @@ Describe "Node.js" { } } -Describe "nvm" { +Describe "nvm" -Skip:($os.IsVentura) { BeforeAll { $nvmPath = Join-Path $env:HOME ".nvm" "nvm.sh" $nvmInitCommand = ". $nvmPath > /dev/null 2>&1 || true" diff --git a/images/macos/tests/OpenSSL.Tests.ps1 b/images/macos/tests/OpenSSL.Tests.ps1 index 5abf9efe..4e8a35db 100644 --- a/images/macos/tests/OpenSSL.Tests.ps1 +++ b/images/macos/tests/OpenSSL.Tests.ps1 @@ -1,4 +1,7 @@ -Describe "OpenSSL" { +Import-Module "$PSScriptRoot/../helpers/Common.Helpers.psm1" +$os = Get-OSVersion + +Describe "OpenSSL" -Skip:($os.IsVentura) { Context "OpenSSL Version" { It "OpenSSL is available" { "openssl version" | Should -ReturnZeroExitCode diff --git a/images/macos/tests/PipxPackages.Tests.ps1 b/images/macos/tests/PipxPackages.Tests.ps1 index ed981938..168e0b54 100644 --- a/images/macos/tests/PipxPackages.Tests.ps1 +++ b/images/macos/tests/PipxPackages.Tests.ps1 @@ -1,4 +1,9 @@ -Describe "PipxPackages" { + +Import-Module "$PSScriptRoot/../helpers/Common.Helpers.psm1" + +$os = Get-OSVersion + +Describe "PipxPackages" -Skip:($os.IsVentura) { $pipxToolset = Get-ToolsetValue "pipx" $testCases = $pipxToolset | ForEach-Object { @{package = $_.package; cmd = $_.cmd} } It "" -TestCases $testCases { diff --git a/images/macos/tests/Python.Tests.ps1 b/images/macos/tests/Python.Tests.ps1 index 40be7343..5464fc9e 100644 --- a/images/macos/tests/Python.Tests.ps1 +++ b/images/macos/tests/Python.Tests.ps1 @@ -3,7 +3,7 @@ Import-Module "$PSScriptRoot/../helpers/Tests.Helpers.psm1" -DisableNameChecking $os = Get-OSVersion -Describe "Python" { +Describe "Python" -Skip:($os.IsVentura) { It "Python 2 is available" { "python --version" | Should -ReturnZeroExitCode } diff --git a/images/macos/tests/System.Tests.ps1 b/images/macos/tests/System.Tests.ps1 index 8dd6bdf5..7322062a 100644 --- a/images/macos/tests/System.Tests.ps1 +++ b/images/macos/tests/System.Tests.ps1 @@ -1,3 +1,5 @@ +Import-Module "$PSScriptRoot/../helpers/Common.Helpers.psm1" + $os = Get-OSVersion Describe "Disk free space" { @@ -23,7 +25,7 @@ Describe "Certificate" { } } -Describe "Audio device" { +Describe "Audio device" -Skip:($os.IsVentura) { It "Sox is installed" { "sox --version" | Should -ReturnZeroExitCode } diff --git a/images/macos/tests/Toolcache.Tests.ps1 b/images/macos/tests/Toolcache.Tests.ps1 index aaeb8db9..e397ea12 100644 --- a/images/macos/tests/Toolcache.Tests.ps1 +++ b/images/macos/tests/Toolcache.Tests.ps1 @@ -1,8 +1,6 @@ Import-Module "$PSScriptRoot/../helpers/Common.Helpers.psm1" Import-Module "$PSScriptRoot/../helpers/Tests.Helpers.psm1" -DisableNameChecking -$os = Get-OSVersion - Describe "Toolcache" { $toolcacheDirectory = Join-Path $env:HOME "hostedtoolcache" [array]$packages += Get-ToolsetValue -KeyPath "toolcache" | ForEach-Object { diff --git a/images/macos/tests/WebServers.Tests.ps1 b/images/macos/tests/WebServers.Tests.ps1 index 0763320a..27eb1778 100644 --- a/images/macos/tests/WebServers.Tests.ps1 +++ b/images/macos/tests/WebServers.Tests.ps1 @@ -1,3 +1,5 @@ +Import-Module "$PSScriptRoot/../helpers/Common.Helpers.psm1" + $os = Get-OSVersion Describe "Apache" { @@ -10,7 +12,7 @@ Describe "Apache" { } } -Describe "Nginx" { +Describe "Nginx" -Skip:($os.IsVentura) { It "Nginx CLI" { "nginx -v" | Should -ReturnZeroExitCode } diff --git a/images/macos/tests/Xamarin.Tests.ps1 b/images/macos/tests/Xamarin.Tests.ps1 index 9f523318..2c989b5c 100644 --- a/images/macos/tests/Xamarin.Tests.ps1 +++ b/images/macos/tests/Xamarin.Tests.ps1 @@ -1,6 +1,7 @@ Import-Module "$PSScriptRoot/../helpers/Common.Helpers.psm1" Import-Module "$PSScriptRoot/../helpers/Tests.Helpers.psm1" -DisableNameChecking +$os = Get-OSVersion $MONO_VERSIONS = Get-ToolsetValue "xamarin.mono-versions" $XAMARIN_IOS_VERSIONS = Get-ToolsetValue "xamarin.ios-versions" $XAMARIN_MAC_VERSIONS = Get-ToolsetValue "xamarin.mac-versions" @@ -17,7 +18,7 @@ BeforeAll { } } -Describe "Mono" { +Describe "Mono" -Skip:($os.IsVentura) { $MONO_VERSIONS | ForEach-Object { Context "$_" { $MONO_VERSIONS_PATH = "/Library/Frameworks/Mono.framework/Versions" @@ -81,7 +82,7 @@ Describe "Mono" { } } -Describe "Xamarin.iOS" { +Describe "Xamarin.iOS" -Skip:($os.IsVentura) { $XAMARIN_IOS_VERSIONS | ForEach-Object { Context "$_" { $XAMARIN_IOS_VERSIONS_PATH = "/Library/Frameworks/Xamarin.iOS.framework/Versions" @@ -114,7 +115,7 @@ Describe "Xamarin.iOS" { } } -Describe "Xamarin.Mac" { +Describe "Xamarin.Mac" -Skip:($os.IsVentura) { $XAMARIN_MAC_VERSIONS | ForEach-Object { Context "$_" { $XAMARIN_MAC_VERSIONS_PATH = "/Library/Frameworks/Xamarin.Mac.framework/Versions" @@ -147,7 +148,7 @@ Describe "Xamarin.Mac" { } } -Describe "Xamarin.Android" { +Describe "Xamarin.Android" -Skip:($os.IsVentura) { $XAMARIN_ANDROID_VERSIONS | ForEach-Object { Context "$_" { $XAMARIN_ANDROID_VERSIONS_PATH = "/Library/Frameworks/Xamarin.Android.framework/Versions" @@ -187,7 +188,7 @@ Describe "Xamarin.Android" { } } -Describe "Xamarin Bundles" { +Describe "Xamarin Bundles" -Skip:($os.IsVentura) { BeforeAll { $MONO_VERSIONS_PATH = "/Library/Frameworks/Mono.framework/Versions" $XAMARIN_IOS_VERSIONS_PATH = "/Library/Frameworks/Xamarin.iOS.framework/Versions" @@ -292,7 +293,7 @@ Describe "Xamarin Bundles" { } } -Describe "Nuget" { +Describe "Nuget" -Skip:($os.IsVentura) { It "Nuget config contains nuget.org feed" { Get-Content $env:HOME/.config/NuGet/NuGet.Config | Out-String | Should -Match "nuget.org" }