diff --git a/images/win/Windows2016-Azure.json b/images/win/Windows2016-Azure.json index faf1bac3..4bc34890 100644 --- a/images/win/Windows2016-Azure.json +++ b/images/win/Windows2016-Azure.json @@ -269,12 +269,6 @@ "{{ template_dir }}/scripts/Installers/Validate-Wix.ps1" ] }, - { - "type": "powershell", - "scripts":[ - "{{ template_dir }}/scripts/Installers/Validate-NET48.ps1" - ] - }, { "type": "powershell", "scripts":[ @@ -711,30 +705,6 @@ "{{ template_dir }}/scripts/Installers/Validate-AzCopy.ps1" ] }, - { - "type": "powershell", - "scripts":[ - "{{ template_dir }}/scripts/Installers/Validate-Msys2.ps1" - ] - }, - { - "type": "powershell", - "scripts":[ - "{{ template_dir }}/scripts/Installers/Validate-OpenSSL.ps1" - ] - }, - { - "type": "powershell", - "scripts":[ - "{{ template_dir }}/scripts/Installers/Validate-Perl.ps1" - ] - }, - { - "type": "powershell", - "scripts":[ - "{{ template_dir }}/scripts/Installers/Validate-PHP.ps1" - ] - }, { "type": "powershell", "scripts":[ @@ -753,12 +723,6 @@ "{{ template_dir }}/scripts/Installers/Validate-Svn.ps1" ] }, - { - "type": "powershell", - "scripts":[ - "{{ template_dir }}/scripts/Installers/Validate-NodeLts.ps1" - ] - }, { "type": "powershell", "scripts":[ @@ -783,12 +747,6 @@ "{{ template_dir }}/scripts/Installers/Validate-DotnetSDK.ps1" ] }, - { - "type": "powershell", - "scripts":[ - "{{ template_dir }}/scripts/Installers/Validate-MysqlCli.ps1" - ] - }, { "type": "powershell", "scripts":[ @@ -807,36 +765,18 @@ "{{ template_dir }}/scripts/Installers/Validate-Stack.ps1" ] }, - { - "type": "powershell", - "scripts":[ - "{{ template_dir }}/scripts/Installers/Validate-Miniconda.ps1" - ] - }, { "type": "powershell", "scripts":[ "{{ template_dir }}/scripts/Installers/Validate-AzureCosmosDbEmulator.ps1" ] }, - { - "type": "powershell", - "scripts":[ - "{{ template_dir }}/scripts/Installers/Validate-Packer.ps1" - ] - }, { "type": "powershell", "scripts":[ "{{ template_dir }}/scripts/Installers/Validate-Zstd.ps1" ] }, - { - "type": "powershell", - "scripts":[ - "{{ template_dir }}/scripts/Installers/Validate-NSIS.ps1" - ] - }, { "type": "powershell", "scripts":[ diff --git a/images/win/Windows2019-Azure.json b/images/win/Windows2019-Azure.json index 642c3580..db6a013f 100644 --- a/images/win/Windows2019-Azure.json +++ b/images/win/Windows2019-Azure.json @@ -268,12 +268,6 @@ "{{ template_dir }}/scripts/Installers/Windows2019/Validate-SSDTExtensions.ps1" ] }, - { - "type": "powershell", - "scripts":[ - "{{ template_dir }}/scripts/Installers/Validate-NET48.ps1" - ] - }, { "type": "powershell", "scripts":[ @@ -710,30 +704,6 @@ "{{ template_dir }}/scripts/Installers/Validate-AzCopy.ps1" ] }, - { - "type": "powershell", - "scripts":[ - "{{ template_dir }}/scripts/Installers/Validate-Msys2.ps1" - ] - }, - { - "type": "powershell", - "scripts":[ - "{{ template_dir }}/scripts/Installers/Validate-OpenSSL.ps1" - ] - }, - { - "type": "powershell", - "scripts":[ - "{{ template_dir }}/scripts/Installers/Validate-Perl.ps1" - ] - }, - { - "type": "powershell", - "scripts":[ - "{{ template_dir }}/scripts/Installers/Validate-PHP.ps1" - ] - }, { "type": "powershell", "scripts":[ @@ -752,12 +722,6 @@ "{{ template_dir }}/scripts/Installers/Validate-Sbt.ps1" ] }, - { - "type": "powershell", - "scripts":[ - "{{ template_dir }}/scripts/Installers/Validate-NodeLts.ps1" - ] - }, { "type": "powershell", "scripts":[ @@ -770,12 +734,6 @@ "{{ template_dir }}/scripts/Installers/Validate-DotnetSDK.ps1" ] }, - { - "type": "powershell", - "scripts":[ - "{{ template_dir }}/scripts/Installers/Validate-MysqlCli.ps1" - ] - }, { "type": "powershell", "scripts":[ @@ -794,36 +752,18 @@ "{{ template_dir }}/scripts/Installers/Validate-Stack.ps1" ] }, - { - "type": "powershell", - "scripts":[ - "{{ template_dir }}/scripts/Installers/Validate-Miniconda.ps1" - ] - }, { "type": "powershell", "scripts":[ "{{ template_dir }}/scripts/Installers/Validate-AzureCosmosDbEmulator.ps1" ] }, - { - "type": "powershell", - "scripts":[ - "{{ template_dir }}/scripts/Installers/Validate-Packer.ps1" - ] - }, { "type": "powershell", "scripts":[ "{{ template_dir }}/scripts/Installers/Validate-Zstd.ps1" ] }, - { - "type": "powershell", - "scripts":[ - "{{ template_dir }}/scripts/Installers/Validate-NSIS.ps1" - ] - }, { "type": "powershell", "scripts":[ diff --git a/images/win/scripts/Installers/Install-Miniconda.ps1 b/images/win/scripts/Installers/Install-Miniconda.ps1 index 7c32f53d..6f716b50 100644 --- a/images/win/scripts/Installers/Install-Miniconda.ps1 +++ b/images/win/scripts/Installers/Install-Miniconda.ps1 @@ -16,3 +16,5 @@ $ArgumentList = ("/S", "/AddToPath=0", "/RegisterPython=0", "/D=$CondaDestinatio Install-Binary -Url $InstallerUrl -Name $InstallerName -ArgumentList $ArgumentList Set-SystemVariable -SystemVariable "CONDA" -Value $CondaDestination + +Invoke-PesterTests -TestFile "Miniconda" \ No newline at end of file diff --git a/images/win/scripts/Installers/Install-Msys2.ps1 b/images/win/scripts/Installers/Install-Msys2.ps1 index 511ff40e..3adf24e3 100644 --- a/images/win/scripts/Installers/Install-Msys2.ps1 +++ b/images/win/scripts/Installers/Install-Msys2.ps1 @@ -87,4 +87,4 @@ pacman.exe -Q | grep -v ^mingw-w64- Write-Host "`nMSYS2 installation completed" -exit 0 +Invoke-PesterTests -TestFile "MSYS2" diff --git a/images/win/scripts/Installers/Install-MysqlCli.ps1 b/images/win/scripts/Installers/Install-MysqlCli.ps1 index 36097643..9547005a 100644 --- a/images/win/scripts/Installers/Install-MysqlCli.ps1 +++ b/images/win/scripts/Installers/Install-MysqlCli.ps1 @@ -25,4 +25,6 @@ $mysqlArchPath = Start-DownloadWithRetry -Url $MysqlVersionUrl -Name "mysql.zip" Extract-7Zip -Path $mysqlArchPath -DestinationPath "C:\" # Adding mysql in system environment path -Add-MachinePathItem $mysqlPath \ No newline at end of file +Add-MachinePathItem $mysqlPath + +Invoke-PesterTests -TestFile "Databases" -TestName "MySQL" \ No newline at end of file diff --git a/images/win/scripts/Installers/Install-NET472.ps1 b/images/win/scripts/Installers/Install-NET472.ps1 deleted file mode 100644 index e558c5c5..00000000 --- a/images/win/scripts/Installers/Install-NET472.ps1 +++ /dev/null @@ -1,13 +0,0 @@ -################################################################################ -## File: Install-NET472.ps1 -## Desc: Install .NET 4.7.2 -################################################################################ - -Import-Module -Name ImageHelpers -Force - -# .NET 4.7.2 Dev pack -$InstallerName = "NDP472-DevPack-ENU.exe" -$InstallerUrl = "https://download.microsoft.com/download/3/B/F/3BFB9C35-405D-45DF-BDAF-0EB57D047888/${InstallerName}" -$ArgumentList = ('Setup', '/passive', '/norestart' ) - -Install-Binary -Url $InstallerUrl -Name $InstallerName -ArgumentList $ArgumentList diff --git a/images/win/scripts/Installers/Install-NET48.ps1 b/images/win/scripts/Installers/Install-NET48.ps1 index ab746ca0..ef343b53 100644 --- a/images/win/scripts/Installers/Install-NET48.ps1 +++ b/images/win/scripts/Installers/Install-NET48.ps1 @@ -11,3 +11,5 @@ $InstallerUrl = "https://download.visualstudio.microsoft.com/download/pr/014120d $ArgumentList = ("Setup", "/passive", "/norestart") Install-Binary -Url $InstallerUrl -Name $InstallerName -ArgumentList $ArgumentList + +Invoke-PesterTests -TestFile "Tools" -TestName "NET48" \ No newline at end of file diff --git a/images/win/scripts/Installers/Install-NSIS.ps1 b/images/win/scripts/Installers/Install-NSIS.ps1 index 71ceb70d..03a8065e 100644 --- a/images/win/scripts/Installers/Install-NSIS.ps1 +++ b/images/win/scripts/Installers/Install-NSIS.ps1 @@ -8,3 +8,5 @@ Choco-Install -PackageName nsis $NsisPath = "${env:ProgramFiles(x86)}\NSIS\" Add-MachinePathItem $NsisPath $env:Path = Get-MachinePath + +Invoke-PesterTests -TestFile "Tools" -TestName "NSIS" \ No newline at end of file diff --git a/images/win/scripts/Installers/Install-NodeLts.ps1 b/images/win/scripts/Installers/Install-NodeLts.ps1 index 1b493ea8..518d8f65 100644 --- a/images/win/scripts/Installers/Install-NodeLts.ps1 +++ b/images/win/scripts/Installers/Install-NodeLts.ps1 @@ -34,3 +34,5 @@ npm install -g yarn npm install -g lerna npm install -g node-sass npm install -g newman + +Invoke-PesterTests -TestFile "Node" \ No newline at end of file diff --git a/images/win/scripts/Installers/Install-Nuget.ps1 b/images/win/scripts/Installers/Install-Nuget.ps1 index 6c5e5e4a..fe10961d 100644 --- a/images/win/scripts/Installers/Install-Nuget.ps1 +++ b/images/win/scripts/Installers/Install-Nuget.ps1 @@ -5,12 +5,4 @@ Choco-Install -PackageName NuGet.CommandLine -if (Get-Command -Name 'nuget.exe') -{ - Write-Host 'nuget on path' -} -else -{ - Write-Host 'nuget is not on path' - exit 1 -} +Invoke-PesterTests -TestFile "Tools" -TestName "Nuget" \ No newline at end of file diff --git a/images/win/scripts/Installers/Install-OpenSSL.ps1 b/images/win/scripts/Installers/Install-OpenSSL.ps1 index 4f43ad43..77965ccb 100644 --- a/images/win/scripts/Installers/Install-OpenSSL.ps1 +++ b/images/win/scripts/Installers/Install-OpenSSL.ps1 @@ -4,3 +4,5 @@ ################################################################################ Choco-Install -PackageName openssl.light + +Invoke-PesterTests -TestFile "Tools" -TestName "OpenSSL" \ No newline at end of file diff --git a/images/win/scripts/Installers/Install-PHP.ps1 b/images/win/scripts/Installers/Install-PHP.ps1 index f4fc4f1d..a51c0e27 100644 --- a/images/win/scripts/Installers/Install-PHP.ps1 +++ b/images/win/scripts/Installers/Install-PHP.ps1 @@ -19,5 +19,5 @@ Choco-Install -PackageName composer -ArgumentList "--ia", "/DEV=$installDir /PHP # Set the PHPROOT environment variable. setx PHPROOT $installDir /M -# Done -exit 0 +# Invoke Pester Tests +Invoke-PesterTests -TestFile "PHP" diff --git a/images/win/scripts/Installers/Install-Packer.ps1 b/images/win/scripts/Installers/Install-Packer.ps1 index 6d74fbf7..7b39e727 100644 --- a/images/win/scripts/Installers/Install-Packer.ps1 +++ b/images/win/scripts/Installers/Install-Packer.ps1 @@ -4,3 +4,5 @@ ################################################################################ Choco-Install -PackageName packer + +Invoke-PesterTests -TestFile "Tools" -TestName "Packer" \ No newline at end of file diff --git a/images/win/scripts/Installers/Install-Perl.ps1 b/images/win/scripts/Installers/Install-Perl.ps1 index 350e6c67..fb831bf0 100644 --- a/images/win/scripts/Installers/Install-Perl.ps1 +++ b/images/win/scripts/Installers/Install-Perl.ps1 @@ -4,3 +4,5 @@ ################################################################################ Choco-Install -PackageName strawberryperl + +Invoke-PesterTests -TestFile "Tools" -TestName "Perl" \ No newline at end of file diff --git a/images/win/scripts/Installers/Validate-Miniconda.ps1 b/images/win/scripts/Installers/Validate-Miniconda.ps1 deleted file mode 100644 index 0c83f36f..00000000 --- a/images/win/scripts/Installers/Validate-Miniconda.ps1 +++ /dev/null @@ -1,27 +0,0 @@ -################################################################################ -## File: Validate-Miniconda.ps1 -## Desc: Validate Miniconda -################################################################################ - -if ($env:CONDA) -{ - Write-Host "The CONDA environment variable is set" - Write-Host $env:CONDA -} -else -{ - Write-Host "The CONDA environment variable is not set" - exit 1 -} - -if ((Test-Path "$env:CONDA\python.exe") -and (Test-Path "$env:CONDA\Scripts\conda.exe")) -{ - Write-Host "Miniconda is successfully installed:" - & "$env:CONDA\Scripts\conda.exe" --version | Write-Host -} -else -{ - Write-Host "Miniconda is not installed" - exit 1 -} - diff --git a/images/win/scripts/Installers/Validate-Msys2.ps1 b/images/win/scripts/Installers/Validate-Msys2.ps1 deleted file mode 100644 index efb4160c..00000000 --- a/images/win/scripts/Installers/Validate-Msys2.ps1 +++ /dev/null @@ -1,43 +0,0 @@ -################################################################################ -## File: Validate-Msys2.ps1 -## Desc: Validate Msys2 -################################################################################ - -$msys2BinDir = "C:\msys64\usr\bin" -$msys2mingwDir = "C:\msys64\mingw64\bin" - -$installedTools = @( - "bash", - "tar", - "make" -) - -$installedMinGWTools = @( - "gcc", - "cmake" -) - -Write-Host "Check installed tools in msys2/usr/bin directory" -$installedTools | ForEach-Object { - $toolName = $_ - try { - Invoke-Expression "$msys2BinDir\$_ --version" - } catch { - Write-Host "$toolName was not installed in MSYS2 bin directory" - Write-Error $_ - exit 1 - } -} - -Write-Host "Check installed tools in msys2/mingw/bin directory" -$installedMinGWTools | ForEach-Object { - $toolName = $_ - try { - Invoke-Expression "$msys2mingwDir\$_ --version" - } catch { - Write-Error "$toolName was not installed in MSYS2 mingw bin directory" - Write-Error $_ - exit 1 - } -} - diff --git a/images/win/scripts/Installers/Validate-MysqlCli.ps1 b/images/win/scripts/Installers/Validate-MysqlCli.ps1 deleted file mode 100644 index a88bbfd2..00000000 --- a/images/win/scripts/Installers/Validate-MysqlCli.ps1 +++ /dev/null @@ -1,15 +0,0 @@ -################################################################################ -## File: Validate-MysqlCli.ps1 -## Desc: Validate Mysql Cli -################################################################################ - -if (Get-Command -Name 'mysql') -{ - Write-Host 'Mysql is on path' -} -else -{ - Write-Host 'Mysql not on path' - exit 1 -} - diff --git a/images/win/scripts/Installers/Validate-NET472.ps1 b/images/win/scripts/Installers/Validate-NET472.ps1 deleted file mode 100644 index 0299304f..00000000 --- a/images/win/scripts/Installers/Validate-NET472.ps1 +++ /dev/null @@ -1,17 +0,0 @@ -################################################################################ -## File: Validate-NET472.ps1 -## Desc: Validate .NET 4.7.2 -################################################################################ - -# For reference, visit https://docs.microsoft.com/en-us/dotnet/framework/migration-guide/how-to-determine-which-versions-are-installed#ps_a -if (Get-ChildItem "HKLM:SOFTWARE\Microsoft\NET Framework Setup\NDP\v4\Full\" | Get-ItemPropertyValue -Name Release | ForEach-Object { $_ -ge 461814 }) -{ - $version = Get-ChildItem "HKLM:SOFTWARE\Microsoft\NET Framework Setup\NDP\v4\Full\" | Get-ItemPropertyValue -Name Version - Write-Host "Installed .Net version $version" -} -else -{ - Write-Host ".Net 472 not found" - exit 1 -} - diff --git a/images/win/scripts/Installers/Validate-NET48.ps1 b/images/win/scripts/Installers/Validate-NET48.ps1 deleted file mode 100644 index 1c1c974a..00000000 --- a/images/win/scripts/Installers/Validate-NET48.ps1 +++ /dev/null @@ -1,16 +0,0 @@ -################################################################################ -## File: Validate-NET48.ps1 -## Desc: Validate .NET 4.8 -################################################################################ - -# For reference, visit https://docs.microsoft.com/en-us/dotnet/framework/migration-guide/how-to-determine-which-versions-are-installed#ps_a -if (Get-ChildItem "HKLM:SOFTWARE\Microsoft\NET Framework Setup\NDP\v4\Full\" | Get-ItemPropertyValue -Name Release | ForEach-Object { $_ -ge 528049 }) -{ - $version = Get-ChildItem "HKLM:SOFTWARE\Microsoft\NET Framework Setup\NDP\v4\Full\" | Get-ItemPropertyValue -Name Version - Write-Host "Installed .Net version $version" -} -else -{ - Write-Host ".Net 48 not found" - exit 1 -} diff --git a/images/win/scripts/Installers/Validate-NSIS.ps1 b/images/win/scripts/Installers/Validate-NSIS.ps1 deleted file mode 100644 index 04b54dcc..00000000 --- a/images/win/scripts/Installers/Validate-NSIS.ps1 +++ /dev/null @@ -1,17 +0,0 @@ -################################################################################ -## File: Validate-NSIS.ps1 -## Desc: Validate NSIS installation. -################################################################################ - -$SoftwareName = 'Nullsoft Install System (NSIS)' - -if (Get-Command -Name 'makensis') -{ - Write-Host "$SoftwareName is installed" -} -else -{ - Write-Host "$SoftwareName is not installed" - exit 1 -} - diff --git a/images/win/scripts/Installers/Validate-NodeLts.ps1 b/images/win/scripts/Installers/Validate-NodeLts.ps1 deleted file mode 100644 index 7e621e39..00000000 --- a/images/win/scripts/Installers/Validate-NodeLts.ps1 +++ /dev/null @@ -1,47 +0,0 @@ -################################################################################ -## File: Validate-NodeLts.ps1 -## Desc: Validate nodejs-lts and other common node tools. -################################################################################ - -if ((Get-Command -Name 'node') -and (Get-Command -Name 'npm')) -{ - Write-Host "Node $(node --version) on path" - Write-Host "Npm $(npm -version) on path" -} -else -{ - Write-Host "Node or npm is not on path" - exit 1 -} - -if ((Get-Command -Name 'gulp') -and (Get-Command -Name 'grunt') -and (Get-Command -Name 'cordova') -and (Get-Command -Name 'yarn')) -{ - Write-Host "Gulp $(gulp -version) on path" - Write-Host "Grunt $(grunt -version) on path" - Write-Host "Yarn $(yarn -version) on path" -} -else -{ - Write-Host "One of Gulp, Grunt, Cordova, or Yarn is not on the path." - exit 1 -} - -if (Get-Command -Name 'lerna') -{ - Write-Host "lerna $(lerna --version) on path" -} -else -{ - Write-Host "lerna is not on path" - exit 1 -} - -if (Get-Command -Name 'newman') -{ - Write-Host "Newman $(newman --version) is on the path." -} -else -{ - Write-Host "Newman is not on the path." - exit 1 -} diff --git a/images/win/scripts/Installers/Validate-OpenSSL.ps1 b/images/win/scripts/Installers/Validate-OpenSSL.ps1 deleted file mode 100644 index 6ec079be..00000000 --- a/images/win/scripts/Installers/Validate-OpenSSL.ps1 +++ /dev/null @@ -1,15 +0,0 @@ -################################################################################ -## File: Validate-OpenSSL.ps1 -## Desc: Validate openssl -################################################################################ - -if (Get-Command -Name 'openssl') -{ - Write-Host 'openssl on path' -} -else -{ - Write-Host 'openssl is not on path' - exit 1 -} - diff --git a/images/win/scripts/Installers/Validate-PHP.ps1 b/images/win/scripts/Installers/Validate-PHP.ps1 deleted file mode 100644 index 0c50e7e2..00000000 --- a/images/win/scripts/Installers/Validate-PHP.ps1 +++ /dev/null @@ -1,49 +0,0 @@ -################################################################################ -## File: Validate-PHP.ps1 -## Desc: Validate PHP -################################################################################ - -# Function that gets the version of php at the specified path -function Get-PHPVersion -{ - Param - ( - [String]$phpRootPath - ) - - $env:Path = "$phpRootPath;" + $env:Path - if($($(php --version)| Out-String) -match 'PHP (?.*) (.*cli).*') - { - $phpVersion = $Matches.version - Write-Host "PHP version at $phpRootPath is $phpVersion" - exit 0 - } - - Write-Host "Unable to determine PHP version at " + $phpRootPath - exit 1 -} - -# Verify that php.exe is on the path -if(Get-Command -Name 'php') -{ - Write-Host "$(php --version) is on the path." -} -else -{ - Write-Host "php is not on the path." - exit 1 -} - -# Verify that composer.exe is on the path -if(Get-Command -Name 'composer') -{ - Write-Host "$(composer --version) is on the path." -} -else -{ - Write-Host "composer is not on the path." - exit 1 -} - -# Get available versions of PHP -Get-PHPVersion -phpRootPath "C:\tools\php72" diff --git a/images/win/scripts/Installers/Validate-Packer.ps1 b/images/win/scripts/Installers/Validate-Packer.ps1 deleted file mode 100644 index c1333d1e..00000000 --- a/images/win/scripts/Installers/Validate-Packer.ps1 +++ /dev/null @@ -1,15 +0,0 @@ -################################################################################ -## File: Validate-Packer.ps1 -## Desc: Validate Packer -################################################################################ - -if (Get-Command -Name 'packer') -{ - Write-Host 'Packer is on path' -} -else -{ - Write-Host 'Packer is not on path' - exit 1 -} - diff --git a/images/win/scripts/Installers/Validate-Perl.ps1 b/images/win/scripts/Installers/Validate-Perl.ps1 deleted file mode 100644 index 09ada6ab..00000000 --- a/images/win/scripts/Installers/Validate-Perl.ps1 +++ /dev/null @@ -1,15 +0,0 @@ -################################################################################ -## File: Validate-Perl.ps1 -## Desc: Validate perl -################################################################################ - -if (Get-Command -Name 'perl') -{ - Write-Host 'perl on path' -} -else -{ - Write-Host 'perl is not on path' - exit 1 -} - diff --git a/images/win/scripts/Tests/Databases.Tests.ps1 b/images/win/scripts/Tests/Databases.Tests.ps1 index b7cda7a4..ab9c908e 100644 --- a/images/win/scripts/Tests/Databases.Tests.ps1 +++ b/images/win/scripts/Tests/Databases.Tests.ps1 @@ -5,4 +5,10 @@ Describe "MongoDB" { ) { "$ToolName --version" | Should -ReturnZeroExitCode } -} \ No newline at end of file +} +Describe "MySQL" { + It "MySQL CLI" { + "mysql -V" | Should -ReturnZeroExitCode + } +} + diff --git a/images/win/scripts/Tests/MSYS2.Tests.ps1 b/images/win/scripts/Tests/MSYS2.Tests.ps1 new file mode 100644 index 00000000..cb8c2000 --- /dev/null +++ b/images/win/scripts/Tests/MSYS2.Tests.ps1 @@ -0,0 +1,22 @@ +BeforeAll { + $msys2BinDir = "C:\msys64\usr\bin" + $msys2mingwDir = "C:\msys64\mingw64\bin" +} + +Describe "MSYS2" { + It "" -TestCases @( + @{ ToolName = "bash.exe" } + @{ ToolName = "tar.exe" } + @{ ToolName = "make.exe" } + ) { + Join-Path $msys2BinDir $ToolName | Should -Exist + } + + It "" -TestCases @( + @{ ToolName = "gcc.exe" } + @{ ToolName = "cmake.exe" } + @{ ToolName = "g++.exe" } + ) { + Join-Path $msys2mingwDir $ToolName | Should -Exist + } +} \ No newline at end of file diff --git a/images/win/scripts/Tests/Miniconda.Tests.ps1 b/images/win/scripts/Tests/Miniconda.Tests.ps1 new file mode 100644 index 00000000..b19f2db5 --- /dev/null +++ b/images/win/scripts/Tests/Miniconda.Tests.ps1 @@ -0,0 +1,14 @@ +Describe "Miniconda" { + It "Miniconda Environment variables is set. " { + ${env:CONDA} | Should -Not -BeNullOrEmpty + } + + It "Miniconda $env:CONDA\ " -TestCases @( + @{ PathTest = "python.exe" } + @{ PathTest = "Scripts\conda.exe" } + ) { + $condaPath = Join-Path ${env:CONDA} $PathTest + $condaPath | Should -Exist + "$condaPath --version" | Should -ReturnZeroExitCode + } +} \ No newline at end of file diff --git a/images/win/scripts/Tests/Node.Tests.ps1 b/images/win/scripts/Tests/Node.Tests.ps1 new file mode 100644 index 00000000..cb8883ad --- /dev/null +++ b/images/win/scripts/Tests/Node.Tests.ps1 @@ -0,0 +1,21 @@ +Describe "Node.JS" { + Context "Basic modules"{ + It " " -TestCases @( + @{ ToolName = "node" } + @{ ToolName = "npm" } + ) { + "$ToolName --version" | Should -ReturnZeroExitCode + } + } + Context "Global NPM Packages" { + It " " -TestCases @( + @{ ToolName = "gulp" } + @{ ToolName = "grunt" } + @{ ToolName = "yarn" } + @{ ToolName = "lerna" } + @{ ToolName = "newman" } + ) { + "$ToolName --version" | Should -ReturnZeroExitCode + } + } +} \ No newline at end of file diff --git a/images/win/scripts/Tests/PHP.Tests.ps1 b/images/win/scripts/Tests/PHP.Tests.ps1 new file mode 100644 index 00000000..74469d9a --- /dev/null +++ b/images/win/scripts/Tests/PHP.Tests.ps1 @@ -0,0 +1,13 @@ +Describe "PHP" { + It "Check in the PATH" -TestCases @( + @{ ToolName = "php" } + @{ ToolName = "composer" } + ) { + "$ToolName --version" | Should -ReturnZeroExitCode + } + + It "PHP Environment variables is set." { + ${env:PHPROOT} | Should -Not -BeNullOrEmpty + ${env:PHPROOT} | Should -Exist + } +} \ No newline at end of file diff --git a/images/win/scripts/Tests/Tools.Tests.ps1 b/images/win/scripts/Tests/Tools.Tests.ps1 index f2317be3..d9ca3906 100644 --- a/images/win/scripts/Tests/Tools.Tests.ps1 +++ b/images/win/scripts/Tests/Tools.Tests.ps1 @@ -1,3 +1,5 @@ +Import-Module (Join-Path $PSScriptRoot "..\SoftwareReport\SoftwareReport.Common.psm1") -DisableNameChecking + Describe "7-Zip" { It "7z" { "7z" | Should -ReturnZeroExitCode @@ -55,16 +57,12 @@ Describe "KubernetesCli" { } Describe "Mingw64" { - It "gcc" { - "gcc --version" | Should -ReturnZeroExitCode - } - - It "g++" { - "g++ --version" | Should -ReturnZeroExitCode - } - - It "make" { - "make --version" | Should -ReturnZeroExitCode + It "" -TestCases @( + @{ ToolName = "gcc" } + @{ ToolName = "g++" } + @{ ToolName = "make" } + ) { + "$ToolName --version" | Should -ReturnZeroExitCode } } @@ -90,16 +88,49 @@ Describe "CloudFoundryCli" { } } -Describe "GoogleCouldSDK" { - It "bq" { - "bq version" | Should -ReturnZeroExitCode +Describe "GoogleCouldSDK" { + It "" -TestCases @( + @{ ToolName = "bq" } + @{ ToolName = "gcloud" } + @{ ToolName = "gsutil" } + ) { + "$ToolName version" | Should -ReturnZeroExitCode } +} - It "gcloud" { - "gcloud version" | Should -ReturnZeroExitCode +Describe "NET48" { + It "NET48" { + $netPath = (Get-DotnetFrameworkTools).Path.Split("<")[0] + ${netPath} + "4.8 Tools" | Should -Exist } +} - It "gsutil" { - "gsutil version" | Should -ReturnZeroExitCode +Describe "NSIS" { + It "NSIS" { + "makensis /VERSION" | Should -ReturnZeroExitCode + } +} + +Describe "Nuget" { + It "Nuget" { + "nuget" | Should -ReturnZeroExitCode + } +} + +Describe "OpenSSL" { + It "OpenSSL" { + "openssl version" | Should -ReturnZeroExitCode + } +} + +Describe "Packer" { + It "Packer" { + "packer --version" | Should -ReturnZeroExitCode + } +} + +Describe "Perl" { + It "Perl" { + "perl --version" | Should -ReturnZeroExitCode } } \ No newline at end of file