From feaef58222d3c2bac15ab6953cd06b1e05073175 Mon Sep 17 00:00:00 2001 From: "Andrey Mishechkin (GITHUB INC)" Date: Fri, 11 Sep 2020 12:42:29 +0400 Subject: [PATCH] Vsix Tests have been created. Old files have been removed --- .../win/scripts/Installers/Install-Vsix.ps1 | 4 +++- .../Windows2019/Install-InstallerProjects.ps1 | 11 ---------- .../Windows2019/Install-SSDTExtensions.ps1 | 12 ----------- .../scripts/Tests/InstallerProjects.Tests.ps1 | 7 ------- .../scripts/Tests/SSDTExtensions.Tests.ps1 | 21 ------------------- images/win/scripts/Tests/Vsix.Tests.ps1 | 12 +++++++++++ images/win/toolsets/toolset-2019.json | 12 +++++++---- 7 files changed, 23 insertions(+), 56 deletions(-) delete mode 100644 images/win/scripts/Installers/Windows2019/Install-InstallerProjects.ps1 delete mode 100644 images/win/scripts/Installers/Windows2019/Install-SSDTExtensions.ps1 delete mode 100644 images/win/scripts/Tests/InstallerProjects.Tests.ps1 delete mode 100644 images/win/scripts/Tests/SSDTExtensions.Tests.ps1 create mode 100644 images/win/scripts/Tests/Vsix.Tests.ps1 diff --git a/images/win/scripts/Installers/Install-Vsix.ps1 b/images/win/scripts/Installers/Install-Vsix.ps1 index 3524fa7d..9c913196 100644 --- a/images/win/scripts/Installers/Install-Vsix.ps1 +++ b/images/win/scripts/Installers/Install-Vsix.ps1 @@ -18,4 +18,6 @@ else { $requiredVsixs | ForEach-Object { Install-VsixExtension -url $_.url -name $_.name -VsVersion $VsVersion -} \ No newline at end of file +} + +Invoke-PesterTests -TestFile "Vsix" \ No newline at end of file diff --git a/images/win/scripts/Installers/Windows2019/Install-InstallerProjects.ps1 b/images/win/scripts/Installers/Windows2019/Install-InstallerProjects.ps1 deleted file mode 100644 index b4871038..00000000 --- a/images/win/scripts/Installers/Windows2019/Install-InstallerProjects.ps1 +++ /dev/null @@ -1,11 +0,0 @@ -################################################################################ -## File: Install-InstallerProjects.ps1 -## Desc: Install the InstallerProjects Visual Studio Extension -################################################################################ - -Import-Module -Name ImageHelpers -Force - -$InstallerProjectsUrl = 'https://marketplace.visualstudio.com/_apis/public/gallery/publishers/VisualStudioClient/vsextensions/MicrosoftVisualStudio2017InstallerProjects/latest/vspackage' -Install-VsixExtension -Url $InstallerProjectsUrl -name "InstallerProjects.vsix" -VSversion "2019" - -Invoke-PesterTests -TestFile "InstallerProjects" \ No newline at end of file diff --git a/images/win/scripts/Installers/Windows2019/Install-SSDTExtensions.ps1 b/images/win/scripts/Installers/Windows2019/Install-SSDTExtensions.ps1 deleted file mode 100644 index f678ab54..00000000 --- a/images/win/scripts/Installers/Windows2019/Install-SSDTExtensions.ps1 +++ /dev/null @@ -1,12 +0,0 @@ -################################################################################### -## File: Install-SSDTExtensions.ps1 -## Desc: Install the extensions previously known as SSDT package -################################################################################### - -Import-Module -Name ImageHelpers -Force - -Install-VsixExtension -Url 'https://marketplace.visualstudio.com/_apis/public/gallery/publishers/ProBITools/vsextensions/MicrosoftAnalysisServicesModelingProjects/2.9.5/vspackage' -Name 'Microsoft.DataTools.AnalysisServices.vsix' -VSversion "2019" -Install-VsixExtension -Url 'https://marketplace.visualstudio.com/_apis/public/gallery/publishers/SSIS/vsextensions/SqlServerIntegrationServicesProjects/3.4/vspackage' -Name 'Microsoft.DataTools.IntegrationServices.exe' -VSversion "2019" -Install-VsixExtension -Url 'https://marketplace.visualstudio.com/_apis/public/gallery/publishers/ProBITools/vsextensions/MicrosoftReportProjectsforVisualStudio/2.6.3/vspackage' -Name 'Microsoft.DataTools.ReportingServices.vsix' -VSversion "2019" - -Invoke-PesterTests -TestFile "SSDTExtensions" diff --git a/images/win/scripts/Tests/InstallerProjects.Tests.ps1 b/images/win/scripts/Tests/InstallerProjects.Tests.ps1 deleted file mode 100644 index 4552cd34..00000000 --- a/images/win/scripts/Tests/InstallerProjects.Tests.ps1 +++ /dev/null @@ -1,7 +0,0 @@ -Import-Module -Name VsSetup -Force -Describe "InstallProjects" { - It "InstallProjects exists" { - $InstallProjects = (Get-VSSetupInstance | Select-VsSetupInstance -Product *).Packages | Where-Object {$_.id -eq 'VSInstallerProjects' } - $InstallProjects | Should -Not -BeNullOrEmpty - } -} \ No newline at end of file diff --git a/images/win/scripts/Tests/SSDTExtensions.Tests.ps1 b/images/win/scripts/Tests/SSDTExtensions.Tests.ps1 deleted file mode 100644 index 7d1c6ee0..00000000 --- a/images/win/scripts/Tests/SSDTExtensions.Tests.ps1 +++ /dev/null @@ -1,21 +0,0 @@ -Describe "SSDTExtensions" { -#These extensions don't have any proper name in the state.packages.json file, only id is available, which can be found on extension marketplace download page - - if (Test-isWin19) { - $testExtenions = @( - @{id = "04a86fc2-dbd5-4222-848e-911638e487fe"} - @{id = "851E7A09-7B2B-4F06-A15D-BABFCB26B970"} - @{id = "717ad572-c4b7-435c-c166-c2969777f718"} - ) - - It "Extensions id=" -TestCases $testExtenions { - $version = Get-VSExtensionVersion -packageName "${id}" - $version | Should -Not -BeNullOrEmpty - } - } else { - It "Extension SSDT" { - $version = Get-VSExtensionVersion -packageName "SSDT" - $version | Should -Not -BeNullOrEmpty - } - } -} diff --git a/images/win/scripts/Tests/Vsix.Tests.ps1 b/images/win/scripts/Tests/Vsix.Tests.ps1 new file mode 100644 index 00000000..c10f5571 --- /dev/null +++ b/images/win/scripts/Tests/Vsix.Tests.ps1 @@ -0,0 +1,12 @@ +Describe "VsixTests" { + $toolset = Get-ToolsetContent + $requiredVsixs = $toolset.visualStudio.vsix + + $allPackages = (Get-VSSetupInstance | Select-VsSetupInstance -Product *).Packages + $testCases = $requiredVsixs | ForEach-Object { @{ VsixId = $_.Id; AllPackages = $allPackages }} + + It "" -TestCases $testCases { + $objVsix = $AllPackages | Where-Object {$_.id -eq $VsixId } | Select-Object Id, Version + $objVsix | Should -Not -BeNullOrEmpty + } +} \ No newline at end of file diff --git a/images/win/toolsets/toolset-2019.json b/images/win/toolsets/toolset-2019.json index 040a09fe..5e41bd2b 100644 --- a/images/win/toolsets/toolset-2019.json +++ b/images/win/toolsets/toolset-2019.json @@ -263,19 +263,23 @@ "vsix": [ { "name": "Microsoft.DataTools.AnalysisServices.vsix", - "url": "https://marketplace.visualstudio.com/_apis/public/gallery/publishers/ProBITools/vsextensions/MicrosoftAnalysisServicesModelingProjects/latest/vspackage" + "url": "https://marketplace.visualstudio.com/_apis/public/gallery/publishers/ProBITools/vsextensions/MicrosoftAnalysisServicesModelingProjects/latest/vspackage", + "id": "04a86fc2-dbd5-4222-848e-911638e487fe" }, { "name": "Microsoft.DataTools.IntegrationServices.exe", - "url": "https://marketplace.visualstudio.com/_apis/public/gallery/publishers/SSIS/vsextensions/SqlServerIntegrationServicesProjects/latest/vspackage" + "url": "https://marketplace.visualstudio.com/_apis/public/gallery/publishers/SSIS/vsextensions/SqlServerIntegrationServicesProjects/latest/vspackage", + "id": "851E7A09-7B2B-4F06-A15D-BABFCB26B970" }, { "name": "Microsoft.DataTools.ReportingServices.vsix", - "url": "https://marketplace.visualstudio.com/_apis/public/gallery/publishers/ProBITools/vsextensions/MicrosoftReportProjectsforVisualStudio/latest/vspackage" + "url": "https://marketplace.visualstudio.com/_apis/public/gallery/publishers/ProBITools/vsextensions/MicrosoftReportProjectsforVisualStudio/latest/vspackage", + "id": "717ad572-c4b7-435c-c166-c2969777f718" }, { "name": "Microsoft.VisualStudio.Installer.Projects.vsix", - "url": "https://marketplace.visualstudio.com/_apis/public/gallery/publishers/VisualStudioClient/vsextensions/MicrosoftVisualStudio2017InstallerProjects/latest/vspackage" + "url": "https://marketplace.visualstudio.com/_apis/public/gallery/publishers/VisualStudioClient/vsextensions/MicrosoftVisualStudio2017InstallerProjects/latest/vspackage", + "id": "VSInstallerProjects" } ] }