Closed fflaten closed 3 months ago
I thought this was implemented, but maybe I've implemented it just on a smaller scope. Should we put this into 6.0.0 milestone?
I think so. Just in case it affects something.
Not sure where to implement this yet. Mark block as Skip during PostProcess-DiscoveredBlock
?
Related #2424. If the plugin skips remaining tests the Before-/AfterAll
should not run on subsequent blocks. That means we might need to make the decision during Run or both.
I don't remember where this is done, there was some function that is recursing down to figure out all the skipped steps, and then recursing up to mark all items as skipped, when they have all children skipped.
Checklist
What is the issue?
BeforeAll
andAfterAll
are executed when all tests are skipped using-Skip
.This is a known limitation/backlog item as seen in this runtime test: https://github.com/pester/Pester/blob/7889a88acd0ecd632d725185a061eab78b4e4c9b/tst/Pester.Runtime.ts.ps1#L1228-L1275
Expected Behavior
Setup and teardown are not executed when they're not needed
Note: Tests skipped using
Set-ItResult
doesn't count as they're skipped during Run-phase (too late)Steps To Reproduce
Output:
Describe your environment
Pester version : 5.6.0-beta1 /workspaces/Pester/bin/Pester.psm1
PowerShell version : 7.4.1 OS version : Unix 5.15.133.1
Possible Solution?
No response