diff --git a/Invoke-Tests.ps1 b/Invoke-Tests.ps1 index f4f486cbf3..95fc45f412 100644 --- a/Invoke-Tests.ps1 +++ b/Invoke-Tests.ps1 @@ -93,7 +93,7 @@ try { Verbosity = 'Minimal' } Filter = @{ - ExcludeTag = 'Background', 'Licensed', 'CCM', 'WIP', 'NonAdmin' + ExcludeTag = 'Background', 'Licensed', 'CCM', 'WIP', 'NonAdmin', 'Internal' } } diff --git a/tests/chocolatey-tests/choco-install.Tests.ps1 b/tests/chocolatey-tests/choco-install.Tests.ps1 index e7f09c4aed..2a810317b5 100644 --- a/tests/chocolatey-tests/choco-install.Tests.ps1 +++ b/tests/chocolatey-tests/choco-install.Tests.ps1 @@ -1392,4 +1392,36 @@ Describe "choco install" -Tag Chocolatey, InstallCommand { $result2.Lines | Should -Contain "Circular dependency detected 'circulardependency2 0.0.1 => circulardependency1 0.0.1 => circulardependency2 0.0.1'." } } + + Context "Installing package that extracts local zip archive while disabling logging" { + BeforeAll { + Restore-ChocolateyInstallSnapshot + + $Output = Invoke-Choco install zip-log-disable-test --verbose --debug -y + } + + It "Exits with Success (0)" { + $Output.ExitCode | Should -Be 0 + } + + It "Does not output extracted file path '<_>'" -ForEach @('tools\'; 'tools\chocolateybeforemodify.ps1'; 'tools\chocolateyinstall.ps1'; 'tools\chocolateyuninstall.ps1'; 'zip-log-disable-test.nuspec') { + $Output.String | Should -Not -Match "- $([regex]::Escape($_))" + } + } + + Context "Installing package that extracts external zip archive while disabling logging" -Tag Internal { + BeforeAll { + Restore-ChocolateyInstallSnapshot + + $Output = Invoke-Choco install zip-log-disable-test-external --verbose --debug -y + } + + It "Exits with Success (0)" { + $Output.ExitCode | Should -Be 0 + } + + It "Does not output extracted file path '<_>'" -ForEach @('tools\'; 'tools\chocolateybeforemodify.ps1'; 'tools\chocolateyinstall.ps1'; 'tools\chocolateyuninstall.ps1'; 'zip-log-disable-test.nuspec') { + $Output.String | Should -Not -Match "- $([regex]::Escape($_))" + } + } } diff --git a/tests/chocolatey-tests/testpackages/zip-log-disable-test/tools/chocolateyinstall.ps1 b/tests/chocolatey-tests/testpackages/zip-log-disable-test/tools/chocolateyinstall.ps1 new file mode 100644 index 0000000000..cd1f15bd37 --- /dev/null +++ b/tests/chocolatey-tests/testpackages/zip-log-disable-test/tools/chocolateyinstall.ps1 @@ -0,0 +1,12 @@ + +$ErrorActionPreference = 'Stop'; +$toolsDir = "$(Split-Path -parent $MyInvocation.MyCommand.Definition)" + +$packageArgs = @{ + packageName = $env:ChocolateyPackageName + destination = "$toolsDir\extraction" + file = "$toolsDir\zip-log-disable-test.zip" + disableLogging= $true +} + +Get-ChocolateyUnzip @packageArgs diff --git a/tests/chocolatey-tests/testpackages/zip-log-disable-test/tools/zip-log-disable-test.zip b/tests/chocolatey-tests/testpackages/zip-log-disable-test/tools/zip-log-disable-test.zip new file mode 100644 index 0000000000..0d949ab396 Binary files /dev/null and b/tests/chocolatey-tests/testpackages/zip-log-disable-test/tools/zip-log-disable-test.zip differ diff --git a/tests/chocolatey-tests/testpackages/zip-log-disable-test/zip-log-disable-test.nuspec b/tests/chocolatey-tests/testpackages/zip-log-disable-test/zip-log-disable-test.nuspec new file mode 100644 index 0000000000..4703bf281d --- /dev/null +++ b/tests/chocolatey-tests/testpackages/zip-log-disable-test/zip-log-disable-test.nuspec @@ -0,0 +1,15 @@ + + + + + zip-log-disable-test + 1.0.0 + zip-log-disable-test (Install) + __REPLACE_AUTHORS_OF_SOFTWARE_COMMA_SEPARATED__ + zip-log-disable-test SPACE_SEPARATED + Package used to test disabling verbose file log for zip extraction + + + + +