ginkgo
ginkgo copied to clipboard
Get reporter to access PreRunStats?
Hi!
I been looking like crazy, but it seems that its not possible to access the reporter anywhere in order to obtain the PreRunStats
?
Im interested in running a check in BeforeSuite
that checks the number of tests that are gonna run, in order to take some expensive actions (reset a VM to its original state) and thought about getting the number of specs that its gonna run, so its its just 1, I can ignore any cleanup in the VM, otherwise I need to reset the whole thing so the next spec has a clean VM testing environment.
Before on ginkgo v1 I think it was possible as long as you created a reporter and run the spec suite with that, you were able to have that reporter around and access it but with V2 that has been deprecated, so I cannot access it that way.
There is also not a ReportBeforeSuite
which will also work, to access the suite report, I can only access the SpecReport
Any ideas?
hey there - sorry if this has been frustrating. i'm planning to reintroduce a ReportBeforeSuite
in an upcoming release but don't have a timeline for you yet. :(
oh, there was that before? Nice to know. Maybe I should try to send a PR with that, although seems a bit complicated, I could have a look at it :D
hey thanks @Itxaka - there was support for getting a report before the suite ran if you implemented a custom reporter in V1 but it was a bit janky (specifically, if you were running in parallel, it would be called multiple times on each process). What I'd like to do for V2 is have it only run on the first Ginkgo process and make all the PreRunStats
available.
And thanks for an offer for a PR - I think this bit of code will be kind of gnarly, though... so not a great candidate as a PR for someone not super familiar with the codebase.
yeah Im seeing it @onsi, tried my luck but it seems a bit complicated for me :D
Thanks for the feedback!
/cc
Expect to see NumberOfSpecsThatWillBeRun
is available when the ReportBeforeSuite
is back. :)
this is fixed now in 2.6.0 with the introduction of ReportBeforeSuite
@onsi thanks for fixing this!
Thanks @onsi , really appreciate it!!