-
-
Notifications
You must be signed in to change notification settings - Fork 666
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
AfterAll runs before DeferCleanup of last It in Ordered block #1284
Comments
From the documentation,
AfterEach happen before AfterAll. I think your extra It block might be a red herring. It could be causing enough of delay in execution that it appears that behavior is different. Could you clarify what the expected behavior was for the above? |
"AfterEach happen before AfterAll" This is not what I am observing. I would expect this, however After all runs before After each, unless I add that dummy It as last block in the ordered container. |
hey - the introduction of Ideally I'd fix this - but I'm not going to be able to get to it for a while. For now the workaround is to use a Sorry I don't have a cleaner answer for you right now! |
Perhaps just to say a bit more - my sense is that Obviously this isn't the issue you're raising - but I'm just trying to rationalize why I'm not super keen to invest more in |
Thanks for the thorough answer! In my case (large e2e infra provisioning setup) i make use of Ordered because i have a list of distinct test steps, and the ability to focus individual steps (i.e. using FIt) is very helpful for debugging failures on already existing infrastructure. Having some kind of block below |
In case there's interest, please take a look at the new proposal for managing shared resources and having finer-grained control over parallelism here: #1292 |
@onsi hi! We have encountered a relatively similar problem to the one discussed here. We have a self-written package e2e
import (
"context"
. "github.com/onsi/ginkgo/v2"
)
var _ = BeforeEach(func(ctx context.Context) {
if CurrentSpecReport().FullText() != "[foo-bar] sub sub test" {
Skip("skip", 1)
}
})
var _ = Describe("[foo-bar]", Ordered, func() {
AfterAll(func(ctx context.Context) {
println("after all")
})
Describe("sub", Ordered, func() {
BeforeEach(func(ctx context.Context) {
println("before each")
})
It("sub test", func(ctx context.Context) {
println("sub test")
})
})
It("root test", func(ctx context.Context) {
println("root test")
})
}) So am I right that in this case we're losing the How would you solve this problem? Considering that we need to save our |
I noticed the following behavior:
It looks a bit like AfterAll runs before the last Ordered
It
block, but after all others..The text was updated successfully, but these errors were encountered: