forked from chocolatey/choco
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
(test) Add unit tests to cover exit code changes
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.
- Loading branch information
Showing
4 changed files
with
1,124 additions
and
4 deletions.
There are no files selected for viewing
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
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
Oops, something went wrong.