-
Notifications
You must be signed in to change notification settings - Fork 902
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
choco feature
- Exit 2 if nothing to do (enhanced exit code)
#1761
Comments
TheCakeIsNaOH
added a commit
to TheCakeIsNaOH/choco
that referenced
this issue
Jan 17, 2022
If enhanced exit codes are enabled, this sets the feature command to exit with 2 if there is nothing to do (i.e. if NOCHANGEMESSAGE is output).
7 tasks
TheCakeIsNaOH
added a commit
to TheCakeIsNaOH/choco
that referenced
this issue
Mar 21, 2022
If enhanced exit codes are enabled, this sets the feature command to exit with 2 if there is nothing to do (i.e. if NOCHANGEMESSAGE is output).
TheCakeIsNaOH
added a commit
to TheCakeIsNaOH/choco
that referenced
this issue
Jun 27, 2022
If enhanced exit codes are enabled, this sets the feature command to exit with 2 if there is nothing to do (i.e. if NOCHANGEMESSAGE is output).
TheCakeIsNaOH
added a commit
to TheCakeIsNaOH/choco
that referenced
this issue
Dec 22, 2022
If enhanced exit codes are enabled, this sets the feature command to exit with 2 if there is nothing to do (i.e. if NOCHANGEMESSAGE is output).
TheCakeIsNaOH
added a commit
to TheCakeIsNaOH/choco
that referenced
this issue
Jun 16, 2023
If enhanced exit codes are enabled, this sets the feature command to exit with 2 if there is nothing to do (i.e. if NOCHANGEMESSAGE is output).
TheCakeIsNaOH
added a commit
to TheCakeIsNaOH/choco
that referenced
this issue
Jan 10, 2024
If enhanced exit codes are enabled, this sets the feature command to exit with 2 if there is nothing to do (i.e. if NOCHANGEMESSAGE is output).
gep13
pushed a commit
to TheCakeIsNaOH/choco
that referenced
this issue
Apr 19, 2024
If enhanced exit codes are enabled, this sets the feature command to exit with 2 if there is nothing to do (i.e. if NOCHANGEMESSAGE is output).
gep13
added a commit
to TheCakeIsNaOH/choco
that referenced
this issue
Apr 23, 2024
Within the following issues, a number of changes were made to allow Chocolatey CLI to exit with a ExitCode of 2, when no action was taken: chocolatey#2200 - Upgrade chocolatey#1764 - Source chocolatey#1762 - Pin chocolatey#1761 - Feature chocolatey#1760 - Config chocolatey#1759 - ApiKey This commit adds the unit tests to exercise these changes to ensure that they work as expected, and also that they continue to work as additional changes are made. No new test files have been created in this commit, but rather test were added to existing test files. The tests that have been added are a carbon copy of each other, to an extent, i.e. setup and run the required action, then assert the logs and ExitCode of 0. Then enable the UseEnhancedExitCodes feature and run the action again and assert the logs and ExitCode of 2. One change was made to the TinySpec file to ensure that the Environment.ExitCode is set to 0 (default) at the start of each test execution. This was required due to the fact that some test executions result in the ExitCode being set to 2 explicitly, but the next test didn't set it to 0, due to the fact that it relies on the default value being returned. Since this is a concern across all test executions, the decision was made to put it into the TinySpec file.
gep13
pushed a commit
to TheCakeIsNaOH/choco
that referenced
this issue
Apr 23, 2024
If enhanced exit codes are enabled, this sets the feature command to exit with 2 if there is nothing to do (i.e. if NOCHANGEMESSAGE is output).
gep13
added a commit
to TheCakeIsNaOH/choco
that referenced
this issue
Apr 23, 2024
Within the following issues, a number of changes were made to allow Chocolatey CLI to exit with a ExitCode of 2, when no action was taken: chocolatey#2200 - Upgrade chocolatey#1764 - Source chocolatey#1762 - Pin chocolatey#1761 - Feature chocolatey#1760 - Config chocolatey#1759 - ApiKey This commit adds the unit tests to exercise these changes to ensure that they work as expected, and also that they continue to work as additional changes are made. No new test files have been created in this commit, but rather test were added to existing test files. The tests that have been added are a carbon copy of each other, to an extent, i.e. setup and run the required action, then assert the logs and ExitCode of 0. Then enable the UseEnhancedExitCodes feature and run the action again and assert the logs and ExitCode of 2. One change was made to the TinySpec file to ensure that the Environment.ExitCode is set to 0 (default) at the start of each test execution. This was required due to the fact that some test executions result in the ExitCode being set to 2 explicitly, but the next test didn't set it to 0, due to the fact that it relies on the default value being returned. Since this is a concern across all test executions, the decision was made to put it into the TinySpec file.
gep13
added a commit
to TheCakeIsNaOH/choco
that referenced
this issue
Apr 23, 2024
Within the following issues, a number of changes were made to allow Chocolatey CLI to exit with a ExitCode of 2, when no action was taken: chocolatey#2200 - Upgrade chocolatey#1764 - Source chocolatey#1762 - Pin chocolatey#1761 - Feature chocolatey#1760 - Config chocolatey#1759 - ApiKey This commit adds the unit tests to exercise these changes to ensure that they work as expected, and also that they continue to work as additional changes are made. No new test files have been created in this commit, but rather test were added to existing test files. The tests that have been added are a carbon copy of each other, to an extent, i.e. setup and run the required action, then assert the logs and ExitCode of 0. Then enable the UseEnhancedExitCodes feature and run the action again and assert the logs and ExitCode of 2. One change was made to the TinySpec file to ensure that the Environment.ExitCode is set to 0 (default) at the start of each test execution. This was required due to the fact that some test executions result in the ExitCode being set to 2 explicitly, but the next test didn't set it to 0, due to the fact that it relies on the default value being returned. Since this is a concern across all test executions, the decision was made to put it into the TinySpec file.
gep13
added a commit
to TheCakeIsNaOH/choco
that referenced
this issue
Apr 23, 2024
Within the following issues, a number of changes were made to allow Chocolatey CLI to exit with a ExitCode of 2, when no action was taken: chocolatey#2200 - Upgrade chocolatey#1764 - Source chocolatey#1762 - Pin chocolatey#1761 - Feature chocolatey#1760 - Config chocolatey#1759 - ApiKey This commit adds the unit tests to exercise these changes to ensure that they work as expected, and also that they continue to work as additional changes are made. No new test files have been created in this commit, but rather test were added to existing test files. The tests that have been added are a carbon copy of each other, to an extent, i.e. setup and run the required action, then assert the logs and ExitCode of 0. Then enable the UseEnhancedExitCodes feature and run the action again and assert the logs and ExitCode of 2. One change was made to the TinySpec file to ensure that the Environment.ExitCode is set to 0 (default) at the start of each test execution. This was required due to the fact that some test executions result in the ExitCode being set to 2 explicitly, but the next test didn't set it to 0, due to the fact that it relies on the default value being returned. Since this is a concern across all test executions, the decision was made to put it into the TinySpec file.
gep13
pushed a commit
to TheCakeIsNaOH/choco
that referenced
this issue
Apr 23, 2024
If enhanced exit codes are enabled, this sets the feature command to exit with 2 if there is nothing to do (i.e. if NOCHANGEMESSAGE is output).
gep13
added a commit
to TheCakeIsNaOH/choco
that referenced
this issue
Apr 23, 2024
Within the following issues, a number of changes were made to allow Chocolatey CLI to exit with a ExitCode of 2, when no action was taken: chocolatey#2200 - Upgrade chocolatey#1764 - Source chocolatey#1762 - Pin chocolatey#1761 - Feature chocolatey#1760 - Config chocolatey#1759 - ApiKey This commit adds the unit tests to exercise these changes to ensure that they work as expected, and also that they continue to work as additional changes are made. No new test files have been created in this commit, but rather test were added to existing test files. The tests that have been added are a carbon copy of each other, to an extent, i.e. setup and run the required action, then assert the logs and ExitCode of 0. Then enable the UseEnhancedExitCodes feature and run the action again and assert the logs and ExitCode of 2. One change was made to the TinySpec file to ensure that the Environment.ExitCode is set to 0 (default) at the start of each test execution. This was required due to the fact that some test executions result in the ExitCode being set to 2 explicitly, but the next test didn't set it to 0, due to the fact that it relies on the default value being returned. Since this is a concern across all test executions, the decision was made to put it into the TinySpec file.
gep13
added a commit
that referenced
this issue
May 21, 2024
When we introduced the concept of an enhanced exit code for the choco feature command, we didn't update the Pester tests that are explicitly looking for an exit code of 0 when running the choco feature command. In some circumstances, the useEnhancedExitCodes feature of Chocolatey CLi is enabled, and the exit code can be 2, rather than 0, so the assertion had to be updated to use -notin, rather than a straight -ne. In addition, the output of the Write-Host was changed to made it clearer that the exit code was actually the exit code, and that the Chocolatey Output fro the executing command was what it said it was.
gep13
added a commit
to gep13/choco
that referenced
this issue
May 24, 2024
Now, when you have useEnhancedExitCodes turned on, if you try to enable/disable a feature that is already in the desired state, the exit code will change to be a 2, giving a clear indication that no action was taken. This commit adds a Pester test to verify that this works as expected.
corbob
pushed a commit
to gep13/choco
that referenced
this issue
May 27, 2024
Now, when you have useEnhancedExitCodes turned on, if you try to enable/disable a feature that is already in the desired state, the exit code will change to be a 2, giving a clear indication that no action was taken. This commit adds a Pester test to verify that this works as expected.
gep13
added a commit
to gep13/choco
that referenced
this issue
May 28, 2024
Now, when you have useEnhancedExitCodes turned on, if you try to enable/disable a feature that is already in the desired state, the exit code will change to be a 2, giving a clear indication that no action was taken. This commit adds a Pester test to verify that this works as expected.
gep13
added a commit
to gep13/choco
that referenced
this issue
May 30, 2024
Now, when you have useEnhancedExitCodes turned on, if you try to enable/disable a feature that is already in the desired state, the exit code will change to be a 2, giving a clear indication that no action was taken. This commit adds a Pester test to verify that this works as expected.
gep13
changed the title
feature - Exit 2 if nothing to do (enhanced exit code)
May 30, 2024
choco feature
- Exit 2 if nothing to do (enhanced exit code)
🎉 This issue has been resolved in version 2.3.0 🎉 The release is available on: Your GitReleaseManager bot 📦 🚀 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Related to #1758
The text was updated successfully, but these errors were encountered: