Skip to content
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

(#2712) Normalize ExitCode pester tests #3373

Merged
merged 1 commit into from
Dec 20, 2023
Merged

Conversation

corbob
Copy link
Member

@corbob corbob commented Dec 19, 2023

Description Of Changes

Normalize the exit code checking of the Pester tests.

Motivation and Context

This normalizes the exit code checking of the pester tests so that if they don't return as expected we have the output of the command.

Testing

Ran through Test Kitchen in Team City (see link to gep13 in Slack)

Operating Systems Testing

Windows Server 2016/2019

Change Types Made

  • Bug fix (non-breaking change).
  • Feature / Enhancement (non-breaking change).
  • Breaking change (fix or feature that could cause existing functionality to change).
  • Documentation changes.
  • PowerShell code changes.
  • Pester test changes

Change Checklist

  • Requires a change to the documentation.
  • Documentation has been updated.
  • Tests to cover my changes, have been added.
  • All new and existing tests passed?
  • PowerShell code changes: PowerShell v2 compatibility checked?

Related Issue

We haven't been consistent when checking the exit code of the Chocolatey
command run. This commit updates all instances where we're testing
ExitCode on the output object to also include the String propery if the
ExitCode doesn't match. This allows us to better deduce issues as we
have the Chocolatey output as well.
@corbob corbob changed the title (#2712) Normalize ExitCode pester tests (#2712) Fixup Pester Tests on Develop Branch Dec 19, 2023
@corbob corbob changed the title (#2712) Fixup Pester Tests on Develop Branch (#2712) Normalize ExitCode pester tests Dec 19, 2023
@corbob corbob marked this pull request as ready for review December 19, 2023 19:06
Copy link
Member

@gep13 gep13 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@gep13 gep13 merged commit 3641b04 into chocolatey:develop Dec 20, 2023
4 checks passed
@gep13
Copy link
Member

gep13 commented Dec 20, 2023

@corbob thank you for getting these fixed up! This is going to help a LOT!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants