diff --git a/tests/chocolatey-tests/commands/choco-install.Tests.ps1 b/tests/chocolatey-tests/commands/choco-install.Tests.ps1 index 6ceaaab799..53874c18e7 100644 --- a/tests/chocolatey-tests/commands/choco-install.Tests.ps1 +++ b/tests/chocolatey-tests/commands/choco-install.Tests.ps1 @@ -1,4 +1,4 @@ -Import-Module helpers/common-helpers +Import-Module helpers/common-helpers # https://github.com/chocolatey/choco/blob/master/src/chocolatey.tests.integration/scenarios/InstallScenarios.cs @@ -662,115 +662,6 @@ Describe "choco install" -Tag Chocolatey, InstallCommand { } } - Context "Installing a side-by-side Package" { - BeforeAll { - Restore-ChocolateyInstallSnapshot - - $PackageUnderTest = "installpackage" - - $Output = Invoke-Choco install $PackageUnderTest --confirm --allowmultipleversions - } - - It "Exits with Success (0)" { - $Output.ExitCode | Should -Be 0 - } - - It "Installed a package to the lib directory" { - "$env:ChocolateyInstall\lib\$($PackageUnderTest).1.0.0" | Should -Exist - } - - It "Installs the expected version of the package" { - "$env:ChocolateyInstall\lib\$($PackageUnderTest).1.0.0\$($PackageUnderTest).1.0.0.nuspec" | Should -Exist - [xml]$XML = Get-Content "$env:ChocolateyInstall\lib\$($PackageUnderTest).1.0.0\$($PackageUnderTest).1.0.0.nuspec" - $XML.package.metadata.version | Should -Be "1.0.0" - } - - It "Outputs a warning message about side by side installs are deprecated" { - $Output.Lines | Should -Contain "Installing the same package with multiple versions is deprecated and will be removed in v2.0.0." -Because $Output.String - } - - It "Outputs a message indicating that it installed the package successfully" { - $Output.Lines | Should -Contain "Chocolatey installed 1/1 packages." - } - } - - Context "Switching a normal Package to a side-by-side Package" { - BeforeAll { - Restore-ChocolateyInstallSnapshot - - $PackageUnderTest = "installpackage" - - $null = Invoke-Choco install $PackageUnderTest --confirm - - $Output = Invoke-Choco install $PackageUnderTest --confirm --force --allowmultipleversions - } - - It "Exits with Success (0)" { - $Output.ExitCode | Should -Be 0 - } - - It "Installed the package to the lib directory" { - "$env:ChocolateyInstall\lib\$($PackageUnderTest).1.0.0" | Should -Exist - } - - It "Removed the previous version of the package from the lib directory" -Tag ExpectBroken { - "$env:ChocolateyInstall\lib\$($PackageUnderTest)" | Should -Not -Exist - } - - It "Installs the expected version of the package" { - "$env:ChocolateyInstall\lib\$($PackageUnderTest).1.0.0\$($PackageUnderTest).1.0.0.nuspec" | Should -Exist - [xml]$XML = Get-Content "$env:ChocolateyInstall\lib\$($PackageUnderTest).1.0.0\$($PackageUnderTest).1.0.0.nuspec" - $XML.package.metadata.version | Should -Be "1.0.0" - } - - It "Outputs a warning message about side by side installs are deprecated" { - $Output.Lines | Should -Contain "Installing the same package with multiple versions is deprecated and will be removed in v2.0.0." -Because $Output.String - } - - It "Outputs a message indicating that it installed the package successfully" { - $Output.Lines | Should -Contain "Chocolatey installed 1/1 packages." - } - } - - Context "Switching a side-by-side Package to a normal Package" { - BeforeAll { - Restore-ChocolateyInstallSnapshot - - $PackageUnderTest = "installpackage" - - $null = Invoke-Choco install $PackageUnderTest --confirm --allowmultipleversion - - $Output = Invoke-Choco install $PackageUnderTest --confirm --force - } - - It "Exits with Success (0)" { - $Output.ExitCode | Should -Be 0 - } - - It "Installed the package to the lib directory" { - "$env:ChocolateyInstall\lib\$($PackageUnderTest)" | Should -Exist - } - - It "Installs the expected version of the package" { - "$env:ChocolateyInstall\lib\$($PackageUnderTest)\$($PackageUnderTest).nuspec" | Should -Exist - [xml]$XML = Get-Content "$env:ChocolateyInstall\lib\$($PackageUnderTest)\$($PackageUnderTest).nuspec" - $XML.package.metadata.version | Should -Be "1.0.0" - } - - It "Does not output a warning message about side by side installs are deprecated" { - $Output.Lines | Should -Not -Contain "Installing the same package with multiple versions is deprecated and will be removed in v2.0.0." -Because $Output.String - } - - It "Does not output a warning message that installed side by side package is deprecated" { - $Output.Lines | Should -Not -Contain "installpackage has been installed as a side by side installation." -Because $Output.String - $Output.Lines | Should -Not -Contain "Side by side installations are deprecated and is pending removal in v2.0.0." -Because $Output.String - } - - It "Outputs a message indicating that it installed the package successfully" { - $Output.Lines | Should -Contain "Chocolatey installed 1/1 packages." - } - } - Context "Installing a Package with dependencies (Happy Path)" { BeforeAll { Restore-ChocolateyInstallSnapshot diff --git a/tests/chocolatey-tests/commands/choco-list.Tests.ps1 b/tests/chocolatey-tests/commands/choco-list.Tests.ps1 index 0e6c53d615..5cae616c07 100644 --- a/tests/chocolatey-tests/commands/choco-list.Tests.ps1 +++ b/tests/chocolatey-tests/commands/choco-list.Tests.ps1 @@ -154,29 +154,6 @@ Describe "choco <_>" -ForEach $Command -Tag Chocolatey, ListCommand, SearchComma } } - # Issue: https://github.com/chocolatey/choco/issues/1843 - Context "List installed package with exact and side-by-side loading" -Skip:(-Not (Test-ChocolateyVersionEqualOrHigherThan "0.10.16-beta-233")) { - BeforeAll { - $null = Invoke-Choco install isdependency --version 2.0.0 --confirm - $null = Invoke-Choco install isdependency --version 1.1.0 --allow-multiple-versions --confirm - - $Output = Invoke-Choco $_ isdependency --AllVersions --exact --local-only - } - - It "Exits with Success (0)" -Tag ExpectBroken { - $Output.ExitCode | Should -Be 0 - } - - It "Shows version <_> of local package" -Tag ExpectBroken -ForEach @("2.0.0"; "1.1.0") { - $Output.Lines | Should -Contain "isdependency $_" - } - - It "Outputs a warning message that installed side by side package is deprecated" { - $Output.Lines | Should -Contain "isdependency has been installed as a side by side installation." - $Output.Lines | Should -Contain "Side by side installations are deprecated and is pending removal in v2.0.0." - } - } - Context "Searching packages with Verbose" { BeforeAll { $Output = Invoke-Choco $_ --Verbose diff --git a/tests/chocolatey-tests/commands/choco-upgrade.Tests.ps1 b/tests/chocolatey-tests/commands/choco-upgrade.Tests.ps1 index 28b0f29839..4c409cd763 100644 --- a/tests/chocolatey-tests/commands/choco-upgrade.Tests.ps1 +++ b/tests/chocolatey-tests/commands/choco-upgrade.Tests.ps1 @@ -12,115 +12,6 @@ Describe "choco upgrade" -Tag Chocolatey, UpgradeCommand { Remove-ChocolateyTestInstall } - Context "Upgrading a side-by-side Package (non-existing)" { - BeforeAll { - Restore-ChocolateyInstallSnapshot - - $PackageUnderTest = "installpackage" - - $Output = Invoke-Choco upgrade $PackageUnderTest --confirm --allowmultipleversions - } - - It "Exits with Success (0)" { - $Output.ExitCode | Should -Be 0 - } - - It "Installed a package to the lib directory" { - "$env:ChocolateyInstall\lib\$($PackageUnderTest).1.0.0" | Should -Exist - } - - It "Installs the expected version of the package" { - "$env:ChocolateyInstall\lib\$($PackageUnderTest).1.0.0\$($PackageUnderTest).1.0.0.nuspec" | Should -Exist - [xml]$XML = Get-Content "$env:ChocolateyInstall\lib\$($PackageUnderTest).1.0.0\$($PackageUnderTest).1.0.0.nuspec" - $XML.package.metadata.version | Should -Be "1.0.0" - } - - It "Outputs a warning message about side by side installs are deprecated" { - $Output.Lines | Should -Contain "Upgrading the same package with multiple versions is deprecated and will be removed in v2.0.0." -Because $Output.String - } - - It "Outputs a message indicating that it upgraded the package successfully" { - $Output.Lines | Should -Contain "Chocolatey upgraded 1/1 packages." -Because $Output.String - } - } - - Context "Switching a normal Package to a side-by-side Package" { - BeforeAll { - Restore-ChocolateyInstallSnapshot - - $PackageUnderTest = "installpackage" - - $null = Invoke-Choco install $PackageUnderTest --confirm - - $Output = Invoke-Choco upgrade $PackageUnderTest --confirm --force --allowmultipleversions - } - - It "Exits with Success (0)" { - $Output.ExitCode | Should -Be 0 - } - - It "Installed the package to the lib directory" { - "$env:ChocolateyInstall\lib\$($PackageUnderTest).1.0.0" | Should -Exist - } - - It "Removed the previous version of the package from the lib directory" { - "$env:ChocolateyInstall\lib\$($PackageUnderTest)" | Should -Not -Exist - } - - It "Installs the expected version of the package" { - "$env:ChocolateyInstall\lib\$($PackageUnderTest).1.0.0\$($PackageUnderTest).1.0.0.nuspec" | Should -Exist - [xml]$XML = Get-Content "$env:ChocolateyInstall\lib\$($PackageUnderTest).1.0.0\$($PackageUnderTest).1.0.0.nuspec" - $XML.package.metadata.version | Should -Be "1.0.0" - } - - It "Outputs a warning message about side by side installs are deprecated" { - $Output.Lines | Should -Contain "Upgrading the same package with multiple versions is deprecated and will be removed in v2.0.0." -Because $Output.String - } - - It "Outputs a message indicating that it upgraded the package successfully" { - $Output.Lines | Should -Contain "Chocolatey upgraded 1/1 packages." -Because $Output.String - } - } - - Context "Switching a side-by-side Package to a normal Package" { - BeforeAll { - Restore-ChocolateyInstallSnapshot - - $PackageUnderTest = "installpackage" - - $null = Invoke-Choco install $PackageUnderTest --confirm --allowmultipleversion - - $Output = Invoke-Choco upgrade $PackageUnderTest --confirm --force - } - - It "Exits with Success (0)" { - $Output.ExitCode | Should -Be 0 - } - - It "Installed the package to the lib directory" { - "$env:ChocolateyInstall\lib\$($PackageUnderTest)" | Should -Exist - } - - It "Installs the expected version of the package" { - "$env:ChocolateyInstall\lib\$($PackageUnderTest)\$($PackageUnderTest).nuspec" | Should -Exist - [xml]$XML = Get-Content "$env:ChocolateyInstall\lib\$($PackageUnderTest)\$($PackageUnderTest).nuspec" - $XML.package.metadata.version | Should -Be "1.0.0" - } - - It "Does not output a warning message about side by side installs are deprecated" { - $Output.Lines | Should -Not -Contain "Upgrading the same package with multiple versions is deprecated and will be removed in v2.0.0." -Because $Output.String - } - - It "Does not output a warning message that installed side by side package is deprecated" { - $Output.Lines | Should -Not -Contain "installpackage has been installed as a side by side installation." -Because $Output.String - $Output.Lines | Should -Not -Contain "Side by side installations are deprecated and is pending removal in v2.0.0." -Because $Output.String - } - - It "Outputs a message indicating that it upgraded the package successfully" { - $Output.Lines | Should -Contain "Chocolatey upgraded 1/1 packages." -Because $Output.String - } - } - Context "Upgrade package with () specified" -ForEach @( @{ Command = '--pin' ; Contains = $true } @{ Command = '' ; Contains = $false }