-
Notifications
You must be signed in to change notification settings - Fork 182
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
(#1039) Improved flow for cases when chocolatey is not installed #1092
Open
LeaDevelop
wants to merge
7
commits into
chocolatey:master
Choose a base branch
from
LeaDevelop:(#1039)-minor-improvement-for-error-action
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
(#1039) Improved flow for cases when chocolatey is not installed #1092
LeaDevelop
wants to merge
7
commits into
chocolatey:master
from
LeaDevelop:(#1039)-minor-improvement-for-error-action
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Test
Test result - Detailed Pester Test Results - Chocolatey Availability TestsTest Summary
Test Environment
Test ConfigurationMock Get-Command returns: null
ParameterFilter: Name -eq 'choco.exe'
ErrorAction: SilentlyContinue Detailed Test Results1️⃣ Test: Throws an error when Chocolatey is not found
{ Test-ChocolateyAvailability } | Should -Throw 2️⃣ Test: Throws the correct error message
$expectedMessage = 'Chocolatey not installed. Cannot install standard packages.'
{ Test-ChocolateyAvailability } | Should -Throw $expectedMessage 3️⃣ Test: Should call Get-Command with correct parameters
Should -Invoke Get-Command -Times 1 -ParameterFilter { $Name -eq 'choco.exe' -and $ErrorAction -eq 'SilentlyContinue' } Function Being Testedfunction Test-ChocolateyAvailability {
if ($null -eq (Get-Command -Name 'choco.exe' -ErrorAction SilentlyContinue)) {
Write-Error "Chocolatey not installed. Cannot install standard packages." -ErrorAction Stop
}
return $true
} |
…ipt for cases when chocolatey is not installed
…ipt for cases when chocolatey is not installed
…ent-for-error-action' into (chocolatey#1039)-minor-improvement-for-error-action
LeaDevelop
changed the title
(#1028) Improved flow for cases when chocolatey is not installed
(#1039) Improved flow for cases when chocolatey is not installed
Oct 28, 2024
…ipt for cases when chocolatey is not installed
…ent-for-error-action' into (chocolatey#1039)-minor-improvement-for-error-action
@pauby I took liberty to just prep this one. I had more than 2 commits, cos I forgot to update issue's ID number in commit message 😓 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description Of Changes
The change has following affects:
Motivation and Context
With this correction script will stop and not attempt to install the chocolatey server.
Automated approach will recognize error and for manual options user is able to spot error and logs as PowerShell's window remains open.
Testing
Change Types Made
Change Checklist
Related Issue
Fixes #1039