Skip to content

Commit

Permalink
(chocolatey#886) Use specific strings for configurations
Browse files Browse the repository at this point in the history
Update the packages.config to be easier to read in the Pester tests.
Update the configurations to use specific strings instead of all of them
being the same "string". This will allow us to identify that they are
actually what they're supposed to be.
  • Loading branch information
corbob committed Sep 26, 2022
1 parent dcbe191 commit 9062644
Showing 1 changed file with 41 additions and 19 deletions.
60 changes: 41 additions & 19 deletions tests/chocolatey-tests/commands/choco-install.Tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -205,19 +205,41 @@ Describe "choco install" -Tag Chocolatey, InstallCommand {
@"
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="installpackage" prerelease="true" overrideArguments="true"
notSilent="true" allowDowngrade="true" forceDependencies="true"
skipAutomationScripts="true" user="string" password="string" cert="string"
certPassword="string" ignoreChecksums="true" allowEmptyChecksums="true"
allowEmptyChecksumsSecure="true" requireChecksums="true"
downloadChecksum="string" downloadChecksum64="string"
downloadChecksumType="sha512" downloadChecksumType64="sha512"
ignorePackageExitCodes="true" usePackageExitCodes="true"
stopOnFirstFailure="true" exitWhenRebootDetected="true"
ignoreDetectedReboot="true" disableRepositoryOptimizations="true"
acceptLicense="true" confirm="true" limitOutput="true" cacheLocation="Z:\"
failOnStderr="true" useSystemPowershell="true" noProgress="true"
force="true" executionTimeout="1000"
<package
id="installpackage"
prerelease="true"
overrideArguments="true"
notSilent="true"
allowDowngrade="true"
forceDependencies="true"
skipAutomationScripts="true"
user="user"
password="string"
cert="cert"
certPassword="string"
ignoreChecksums="true"
allowEmptyChecksums="true"
allowEmptyChecksumsSecure="true"
requireChecksums="true"
downloadChecksum="downloadChecksum"
downloadChecksum64="downloadChecksum64"
downloadChecksumType="downloadChecksumType"
downloadChecksumType64="downloadChecksumType64"
ignorePackageExitCodes="true"
usePackageExitCodes="true"
stopOnFirstFailure="true"
exitWhenRebootDetected="true"
ignoreDetectedReboot="true"
disableRepositoryOptimizations="true"
acceptLicense="true"
confirm="true"
limitOutput="true"
cacheLocation="Z:\"
failOnStderr="true"
useSystemPowershell="true"
noProgress="true"
force="true"
executionTimeout="1000"
/>
</packages>
"@ | Out-File $env:CHOCOLATEY_TEST_PACKAGES_PATH\alloptions.packages.config -Encoding utf8
Expand Down Expand Up @@ -246,11 +268,11 @@ Describe "choco install" -Tag Chocolatey, InstallCommand {
# SkipAutomationScripts sets configuration option SkipPackageInstallProvider
@{ Option = "SkipPackageInstallProvider" ; ExpectedValue = "True" }
# User is expanded to Username
@{ Option = "Username" ; ExpectedValue = "string" }
@{ Option = "Username" ; ExpectedValue = "user" }
# Password should *not* be output in the logging
# @{ Option = "Password" ; ExpectedValue = "string" }
# Cert is expanded to Certificate
@{ Option = "Certificate" ; ExpectedValue = "string" }
@{ Option = "Certificate" ; ExpectedValue = "cert" }
# CertPassword should *not* be output in the logging
# @{ Option = "CertPassword" ; ExpectedValue = "string" }
# IgnoreChecksums sets ChecksumFiles to False
Expand All @@ -259,10 +281,10 @@ Describe "choco install" -Tag Chocolatey, InstallCommand {
# @{ Option = "RequireChecksums" ; ExpectedValue = "True" }
@{ Option = "AllowEmptyChecksums" ; ExpectedValue = "False" }
@{ Option = "AllowEmptyChecksumsSecure" ; ExpectedValue = "False" }
@{ Option = "DownloadChecksum" ; ExpectedValue = "string" }
@{ Option = "DownloadChecksum64" ; ExpectedValue = "string" }
@{ Option = "DownloadChecksumType" ; ExpectedValue = "sha512" }
@{ Option = "DownloadChecksumType64" ; ExpectedValue = "sha512" }
@{ Option = "DownloadChecksum" ; ExpectedValue = "downloadChecksum" }
@{ Option = "DownloadChecksum64" ; ExpectedValue = "downloadChecksum64" }
@{ Option = "DownloadChecksumType" ; ExpectedValue = "downloadChecksumType" }
@{ Option = "DownloadChecksumType64" ; ExpectedValue = "downloadChecksumType64" }
# UsePackageExitCodes and IgnorePackageExitCodes set the same setting, but are opposite of each other.
# UsePackageExitCodes is evaluated last, so takes precidence.
# @{ Option = "IgnorePackageExitCodes" ; ExpectedValue = "True" }
Expand Down

0 comments on commit 9062644

Please sign in to comment.