-
-
Notifications
You must be signed in to change notification settings - Fork 667
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
Add SpecContext to ReportAfterSuite callback body. #1345
Add SpecContext to ReportAfterSuite callback body. #1345
Conversation
hey sorry for the delay - will take a look at this and share feedback. |
hey - this is good but I'd like to add a test that exercises passing the context into
this should be additive - I want to keep coverage of the non- Let me know if you're up for that - the internal integration tests can take a bit to wrap your head around but you should be able to copy and paste and pattern-match your way to victory. |
sure |
@onsi sorry was a bit busy 😄 updated the PR and also docs |
thjanks! one last thing - rather than add |
@onsi Yeah I was squimish about adding // could be reused for other functions that do reporting
type ReporterBody interface {
func(Report) | func(SpecContext, Report)
}
func ReportAfterSuite[B ReporterBody](text string, body B, args ...interface{}) bool {
combinedArgs := []interface{}{body}
combinedArgs = append(combinedArgs, args...)
return pushNode(internal.NewNode(deprecationTracker, types.NodeTypeReportAfterSuite, text, combinedArgs...))
} but this caused another issue here since generic function has to be instantiated so DSL code would have to have twe aliased functions:
which might be valid approach but also could introduce some confusion ( but let me know your opinion ) or alternatively to use |
hey @eugenenosenko - thanks for giving the generics approach a try. let’s go with Thanks for working on this! I appreciate the contribution :) |
1842b21
to
077c727
Compare
@onsi my pleasure 😄 I've updated the PR and I think that with little effort similar changes can be made to the ReportBeforeSuite and after reporting hooks |
wonderful! this looks great, thank you :) if you're up for it since you've done all this work already converting the other nodes would be great (either in this PR or a subsequent one would be fine by me). thanks so much! |
updated the code to include changes to other reporting nodes 😄 |
@onsi are you ok with the proposed changes? 😄 |
hey @eugenenosenko yes - thanks for the nudge. i was waiting for CI to run and then totally forgot to check back! this all looks good to me. i’ll pull it in and cut a release soon. |
@onsi great, if you have any other improvement tasks let me know, we use ginkgo extensively so I'll be glad to contribute |
thanks @eugenenosenko ! this just shipped in v2.16.0 |
No description provided.