-
-
Notifications
You must be signed in to change notification settings - Fork 650
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
AfterSuiteDidRun is not invoked when ginkgo run with -p #365
Comments
Hey @ferozjilla can you point me at the actual code? The Ginkgo is running the You can prove this to yourself like so:
Run The reason Ginkgo doesn't emit the output of your reporter is because it runs custom reporters after it runs the default reporter and it is the default reporter that captures output and emits it. This happens here: Line 205 in 228e3a8
Problem is... I don't remember why I wrote it this way. This is, sadly, a great example of Connascence of Position where I haven't clearly documented if/whether or not the order is significant. I've switched the order around and seen all the Ginkgo tests go green, though. So folks debugging similar things in the future won't have quite as baffling an experience. |
Hey @onsi, thanks for the prompt reply, it has fixed our issue :) The actual code is here: https://github.com/pivotal-cf/cf-redis-smoke-tests. The Thanks again for the quick fix! |
Great! btw @ferozjilla I think a lot of what you are trying to do with the customer reporter and could be accomplished with Ginkgo's |
Hello,
We are using Ginkgo Version 1.4.0.
We have a custom reporter for our tests for which we are failing to generate the AfterSuite report when ginkgo is run with the
-p
flag. Without the flag, the reporter works fine.We have made a simpler test suite to highlight our problem. It can be cloned from: https://github.com/ferozjilla/ginkgo-demo
Without the
-p
flag, the output is:With the
-p
flag, the output is:As can be seen, the AfterSuiteDidRun method is not called in the case when the
-p
flag is included. This results in the loss of the after suite reports for the tests.Upon further investigation, we discovered the following:
The SynchronizedAfterSuite method from ginkgo_dsl.go is not invoked https://github.com/onsi/ginkgo/blob/master/ginkgo_dsl.go#L523:L531. This causes the
afterSuiteNodes
to not be initialized which becomes an issue in this part of the code:https://github.com/onsi/ginkgo/blob/master/internal/specrunner/spec_runner.go#L129:L142
because https://github.com/onsi/ginkgo/blob/master/internal/specrunner/spec_runner.go#L140 method is not invoked.
When run with the -stream flag, we see that each individual nodes does invoke the AfterSuiteDidRun.
cc: @alamages , @jamesjoshuahill, @BooleanCat
Are we missing something or have we found an issue? Thanks
The text was updated successfully, but these errors were encountered: