(#107) Honor Pester ExitCode #109
Open
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
Pester always sets
$LASTEXITCODE, so there is no need to manually set it to the number of failed tests. Further, in the event of a container failure, the number of failed tests could be 0 when the failure occurs before enumeration of the tests.Additionally, this exit code doesn't actually help as test-kitchen does
not display the exit code, and itself exits with 20.
I have not added any tests for this, as I'm not entirely sure the best way to add a test for this. The testing steps that I took:
kitchen testand verify that withkitchen-pesterversion1.2.0installed the test completes successfully.kitchen testand verify that with this version installed the tests fail and exit with code 20.Issues Resolved
Type of Change
Note
I have not followed Conventional Commit messages here. I have followed the messages we use at Chocolatey. I am more than happy to fix the commits up prior to merge to follow the Conventional Commit messages format.
As for the question about type of change: I am split between this being a
_fix _, and a_fix!_... On the one hand, this is fixing an issue in that a failure of Pester will actually result in failed tests. On the other hand, this is changing the behavior, and thus might be considered breaking?Our release process assumes you are using Conventional Commit messages.
The most important prefixes you should have in mind are:
_fix_: which represents bug fixes, and correlates to a SemVer patch._feat_: which represents a new feature, and correlates to a SemVer minor._feat!_:, orfix!:,refactor!:, etc., which represent a breaking change (indicated by the !) and will result in a major version change.If you have not included a conventional commit message this can be fixed on merge.
Check List