You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello! I know it is probably not a recommended practice to write tests with so many nested container nodes (and I'm currently rewriting specs in my test to be independent), but I thought it's worth to report this issue anyway.
When I run the tests with env var SKIP=true (which results in all specs in container node Describe level 2 to be skipped), the DeferCleanup, level 1 is called, which is expected (see the log 2022/05/18 11:06:30 Executing DeferCleanup, level 1)
➜ ginkgo SKIP=true ginkgo
Running Suite: Ginkgo Suite - /Users/psturc/learn/go/ginkgo
===========================================================
Random Seed: 1652864789
Will run 2 of 2 specs
•2022/05/18 11:06:30 Executing BeforeAll, level 1
2022/05/18 11:06:30 Executing It1 level 1
------------------------------
S [SKIPPED] [0.000 seconds]
Describe level 1
/Users/psturc/learn/go/ginkgo/main_test.go:11
Describe level 2 [BeforeAll]
/Users/psturc/learn/go/ginkgo/main_test.go:21
It1 level 2
/Users/psturc/learn/go/ginkgo/main_test.go:28
Skipping Describe level 2
In [BeforeAll] at: /Users/psturc/learn/go/ginkgo/main_test.go:23
------------------------------
2022/05/18 11:06:30 Executing DeferCleanup, level 1
Ran 1 of 2 Specs in 0.001 seconds
SUCCESS! -- 1 Passed | 0 Failed | 0 Pending | 1 Skipped
PASS
Ginkgo ran 1 suite in 1.190130184s
Test Suite Passed
However if I uncomment the code for Describe level 3, and run the test with the same command, the cleanup (DeferCleanup, level 1) doesn't happen.
➜ ginkgo SKIP=true ginkgo
Running Suite: Ginkgo Suite - /Users/psturc/learn/go/ginkgo
===========================================================
Random Seed: 1652865119
Will run 3 of 3 specs
•2022/05/18 11:12:01 Executing BeforeAll, level 1
2022/05/18 11:12:01 Executing It1 level 1
------------------------------
S [SKIPPED] [0.000 seconds]
Describe level 1
/Users/psturc/learn/go/ginkgo/main_test.go:11
Describe level 2 [BeforeAll]
/Users/psturc/learn/go/ginkgo/main_test.go:21
It1 level 2
/Users/psturc/learn/go/ginkgo/main_test.go:28
Skipping Describe level 2
In [BeforeAll] at: /Users/psturc/learn/go/ginkgo/main_test.go:23
------------------------------
S [SKIPPED] [0.000 seconds]
Describe level 1
/Users/psturc/learn/go/ginkgo/main_test.go:11
Describe level 2
/Users/psturc/learn/go/ginkgo/main_test.go:20
Describe level 3
/Users/psturc/learn/go/ginkgo/main_test.go:32
[It] It1 level 3
/Users/psturc/learn/go/ginkgo/main_test.go:37
Spec skipped because Skip() was called in BeforeAll
In [It] at: /Users/psturc/learn/go/ginkgo/main_test.go:37
------------------------------
Ran 1 of 3 Specs in 0.001 seconds
SUCCESS! -- 1 Passed | 0 Failed | 0 Pending | 2 Skipped
PASS
Ginkgo ran 1 suite in 1.892848673s
Test Suite Passed
It happens only in case the specs in second container node (Describe level 2) are skipped. (If I run the tests with SKIP=false ginkgo, the cleanup works as expected).
The text was updated successfully, but these errors were encountered:
hey @psturc thanks for reporting this. Looks like it might be an edge-case bug that you've found. I'll dig into it and see how if I can push a fix out soon.
Hello! I know it is probably not a recommended practice to write tests with so many nested container nodes (and I'm currently rewriting specs in my test to be independent), but I thought it's worth to report this issue anyway.
This is the code
When I run the tests with env var
SKIP=true
(which results in all specs in container nodeDescribe level 2
to be skipped), theDeferCleanup, level 1
is called, which is expected (see the log2022/05/18 11:06:30 Executing DeferCleanup, level 1
)However if I uncomment the code for
Describe level 3
, and run the test with the same command, the cleanup (DeferCleanup, level 1
) doesn't happen.It happens only in case the specs in second container node (
Describe level 2
) are skipped. (If I run the tests withSKIP=false ginkgo
, the cleanup works as expected).The text was updated successfully, but these errors were encountered: