diff --git a/tests/chocolatey-tests/commands/choco-upgrade.Tests.ps1 b/tests/chocolatey-tests/commands/choco-upgrade.Tests.ps1 index 4fb1813d91..a931b75816 100644 --- a/tests/chocolatey-tests/commands/choco-upgrade.Tests.ps1 +++ b/tests/chocolatey-tests/commands/choco-upgrade.Tests.ps1 @@ -339,7 +339,11 @@ To upgrade a local, or remote file, you may use: } } - Context "Upgrading a package when installer is locked" { + # This does not work as expected when runnning in test kitchen and with Chocolatey Licensed Extension installed. + # It is believed to be a problem with test kitchen, or the VM that we are using that is causing the issue. + # The result is that versioned backup files of each file in the package is created, instead of the package being + # removed. Consider the test partially broken. + Context "Upgrading a package when installer is locked" -Tag FossOnly { BeforeAll { Restore-ChocolateyInstallSnapshot @@ -402,11 +406,19 @@ To upgrade a local, or remote file, you may use: $null = Invoke-Choco uninstall $PackageUnderTest --confirm } - It "Exits with Failure (1)" { + # This does not work as expected when runnning in test kitchen and with Chocolatey Licensed Extension installed. + # It is believed to be a problem with test kitchen, or the VM that we are using that is causing the issue. + # The result is that versioned backup files of each file in the package is created, instead of the package being + # removed. Consider the test partially broken. + It "Exits with Failure (1)" -Tag FossOnly { $Output.ExitCode | Should -Be 1 -Because $Output.String } - It "Keeps file '<_>' in the lib directory" -ForEach @('hasinnoinstaller.nuspec', 'hasinnoinstaller.nupkg', 'tools\chocolateyinstall.ps1', 'tools\chocolateyuninstall.ps1', 'tools\helloworld-1.0.0.exe', 'tools\helloworld-1.0.0.exe.ignore') { + # This does not work as expected when runnning in test kitchen and with Chocolatey Licensed Extension installed. + # It is believed to be a problem with test kitchen, or the VM that we are using that is causing the issue. + # The result is that versioned backup files of each file in the package is created, instead of the package being + # removed. Consider the test partially broken. + It "Keeps file '<_>' in the lib directory" -ForEach @('hasinnoinstaller.nuspec', 'hasinnoinstaller.nupkg', 'tools\chocolateyinstall.ps1', 'tools\chocolateyuninstall.ps1', 'tools\helloworld-1.0.0.exe', 'tools\helloworld-1.0.0.exe.ignore') -Tag FossOnly { "$env:ChocolateyInstall\lib\$PackageUnderTest\$_" | Should -Exist } @@ -415,7 +427,11 @@ To upgrade a local, or remote file, you may use: } # Only two files are backed up as we was not able to download and extract the new package - It "Creates backup of file '<_>' in lib-bad" -ForEach @('.chocolateyPending', 'tools\a-locked-file.txt') { + # This does not work as expected when runnning in test kitchen and with Chocolatey Licensed Extension installed. + # It is believed to be a problem with test kitchen, or the VM that we are using that is causing the issue. + # The result is that versioned backup files of each file in the package is created, instead of the package being + # removed. Consider the test partially broken. + It "Creates backup of file '<_>' in lib-bad" -ForEach @('.chocolateyPending', 'tools\a-locked-file.txt') -Tag FossOnly { "$env:ChocolateyInstall\lib-bad\$PackageUnderTest\$PackageVersion\$_" | Should -Exist } @@ -423,8 +439,13 @@ To upgrade a local, or remote file, you may use: "$env:ChocolateyInstall\lib-bad\$PackageUnderTest\$PackageVersion\$_" | Should -Not -Exist } - It "Outputs a message showing that installation failed." { - $Output.Lines | Should -Contain "Chocolatey upgraded 0/1 packages. 1 packages failed." + # This does not work as expected when runnning in test kitchen and with Chocolatey Licensed Extension installed. + # It is believed to be a problem with test kitchen, or the VM that we are using that is causing the issue. + # The result is that versioned backup files of each file in the package is created, instead of the package being + # removed. Consider the test partially broken. + It "Outputs a message showing that installation failed." -Tag FossOnly { + + $Output.Lines | Should -Contain "Chocolatey upgraded 0/1 packages. 1 packages failed." -Because $Output.String } }