-
Notifications
You must be signed in to change notification settings - Fork 8.1k
Added cmdlets to get Pester failures #2600
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
Changes from all commits
3df4081
1cf3d74
97f9765
b793956
613be77
5e1d48a
40ce3d6
6795cc1
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -84,18 +84,34 @@ When running tests in this way, be sure that you have started PowerShell with `- | |
| environment is not the default or has any customization. | ||
|
|
||
| For example, to run all the Pester tests for CI (assuming you are at the root of the PowerShell repo): | ||
| ``` | ||
| ```PowerShell | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. MINOR: lowercase
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @TravisEz13 as a maintainer, you can make small edits directly into this PR
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'll make this change since I'm already updating this PR |
||
| Import-Module ./build.psm1 | ||
| Start-PSPester | ||
| ``` | ||
| If you wish to run specific tests, that is possible as well: | ||
| ``` | ||
| ```PowerShell | ||
| Start-PSPester -Directory test/powershell/engine/Api | ||
| ``` | ||
| Or a specific Pester test file: | ||
| ``` | ||
| ```PowerShell | ||
| Start-PSPester -Directory test/powershell/engine/Api -Test XmlAdapter.Tests.Api | ||
| ``` | ||
| If you added a `Feature` test and not a `CI` test, then you would specify the tag: | ||
| ```PowerShell | ||
| Start-PSPester -Path ./myTest.ps1 -Tag Feature | ||
| ``` | ||
|
|
||
| ### How to deal with failures? | ||
| As part of your PR, you must ensure all existing tests pass. | ||
| If you see any failures from `Start-PSPester` (summary reported at end), then you must investigate them and fix your PR so those tests pass or fix the test if the test case is wrong. | ||
| Two helper functions are part of the build.psm1 module to help with that: | ||
| * `Get-PSPesterFailure` will parse the NUnit test result log and return PowerShell objects for each failure so you can do additional filtering, sorting, grouping, etc... | ||
| * `Format-PSPesterFailure` will call `Get-PSPesterFailure` if no parameters are provided and show just the failures at the console similar to what Pester displays | ||
|
|
||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Maybe add call samples as above for
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. added |
||
| ```PowerShell | ||
| Start-PSPester # summary shows failures | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This seems to be a typo and comment must be on a new line. |
||
| Format-PSPesterFailure | ||
| ``` | ||
|
|
||
| ### What happens after your PR? | ||
| When your PR has successfully passed the CI test gates, your changes will be used to create PowerShell binaries which can be run | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps the properties could be more readable
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@TravisEz13 do you have a specific suggestion as it seems readable to me?
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Guidance developed in the DSC Resource project is to have each name-value pair on a new line
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
got it, will change