-
-
Notifications
You must be signed in to change notification settings - Fork 473
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
Set-ItResult: Return distinctive ErrorId depending on switch used #2401
Set-ItResult: Return distinctive ErrorId depending on switch used #2401
Conversation
…sive or PesterTestPending
@@ -680,7 +680,7 @@ function Invoke-TestItem { | |||
|
|||
$Test.FrameworkData.Runtime.ExecutionStep = 'Finished' | |||
|
|||
if ($Result.ErrorRecord.FullyQualifiedErrorId -eq 'PesterTestSkipped') { | |||
if (@('PesterTestSkipped', 'PesterTestInconclusive', 'PesterTestPending') -contains $Result.ErrorRecord.FullyQualifiedErrorId) { |
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.
@fflaten what you commented on in the Issue happens here. The error record id is translated to .Skipped = $true on the test object. So all the accounting that is done above this is correct, but you can still see the actual reason for marking the test as skipped on the ErrorRecord itself on the Result object.
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.
Thanks 🙂 Didn't remember that Add-RSpecTestObjectProperties
would set the correct result based on Skipped = $true
during teardown.
LGTM as a first step. 🙂 I'd prefer to change the output a little, but unfortunately it could be a minor breaking change since it was the only identifier for inconclusive/pending until now. E.g.
|
@fflaten yeah let's not change the output, so we don't break the existing workarounds, while there is no complete solution in place. |
Merged, thanks guys :) |
My pleasure :) |
PR Summary
PesterTestSkipped
).-Inconclusive
now returnsPesterTestInconclusive
-Pending
now returnsPesterTestPending
Skipped
still returnsPesterTestSkipped
I am not sure if these changes require additional tests and/or documentation updates - let me know if they do.
Related to issue #2400.
PR Checklist
Create Pull Request
to mark it as a draft. PR can be markedReady for review
when it's ready.