Skip to content

Conversation

@daxian-dbw
Copy link
Member

@daxian-dbw daxian-dbw commented Aug 12, 2021

PR Summary

This PR adds 39 tests to validate and track the existing command error handling behaviors.
This PR is a preparation for #15177. The new tests added here will protect regressions that could be introduced to the command error handling by #15177.

Please be noted that those tests are by no means covering every aspect of the error handling behaviors.
I tried to cover most of the subtle behaviors -- some are not well known and may even be a little confusing to some extent. This is because these subtle behaviors may not be well tested, and adding those new tests will help guard me from introducing regression without knowing when working on #15177.
For the more obvious/common behaviors, I hope they are already covered by existing tests.

PR Checklist

@daxian-dbw
Copy link
Member Author

daxian-dbw commented Aug 12, 2021

To combine the tests in Context-s in one (per Context) with TestCases - it would be great readable.

@iSazonov, I already did my best grouping test cases with -TestCases. I believe being more aggressive grouping the remaining It tests will make the tests even harder to read.

@iSazonov iSazonov added the CL-Test Indicates that a PR should be marked as a test change in the Change Log label Aug 13, 2021
1/0 ## throw exception.
Write-Verbose -Verbose "verbose-message"
}

Copy link
Collaborator

Choose a reason for hiding this comment

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

Another good one here is parameter binding, where I hit some strangeness in #15833

Copy link
Member Author

Choose a reason for hiding this comment

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

It would be great if you can add tests here (or to another file as you see fit) to cover the scenario after you get it fixed in #15833.

@daxian-dbw daxian-dbw merged commit eeb0407 into PowerShell:master Aug 14, 2021
@daxian-dbw daxian-dbw deleted the errorHandling branch August 14, 2021 21:32
@iSazonov iSazonov added this to the 7.2.0-preview.9 milestone Aug 15, 2021
xtqqczze pushed a commit to xtqqczze/PowerShell-PowerShell that referenced this pull request Aug 20, 2021
@ghost
Copy link

ghost commented Aug 23, 2021

🎉v7.2.0-preview.9 has been released which incorporates this pull request.:tada:

Handy links:

@ghost
Copy link

ghost commented Sep 28, 2021

🎉v7.2.0-preview.10 has been released which incorporates this pull request.:tada:

Handy links:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CL-Test Indicates that a PR should be marked as a test change in the Change Log

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants